Trouble with LAPCKE_CGETRI while running on PowerPC

Post here if you have a question about LAPACK or ScaLAPACK algorithm or data format

Trouble with LAPCKE_CGETRI while running on PowerPC

Postby Lekshmi » Thu Aug 04, 2016 1:29 am

I have written a program for matrix inversion using LAPACKE_CGETRF and LAPACKE_CGETRI and compiled for PowerPC. The program compiled without any warnings or errors. While running on the PowerPC processor ,the following error was encountered ."On entry to CGETRI,parameter 6 had an illegal value". The code is

#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <complex.h>
#include "mepl.h"
#define NSENSOR 3
complex float* pfcavgMatrix;
lapack_complex_float fcavgMatrix[NSENSOR][NSENSOR];
lapack_complex_float fcavgMatrixInv[NSENSOR][NSENSOR];
//float complex fcavgMatrix[NSENSOR][NSENSOR];
//float complex fcavgMatrixInv[NSENSOR][NSENSOR];
float testdataRe[NSENSOR][NSENSOR]= {
0.5377, 0.8622, -0.4336,
1.8339, 0.3188, 0.3426,
-2.2588, -1.3077, 3.5784 };

float testdataIm[NSENSOR][NSENSOR]= {

2.7694, 0.7254, -0.2050,
-1.3499, -0.0631, -0.1241,
3.0349, 0.7147, 1.4897 };
int main()
{
int valid;
lapack_int ipiv[NSENSOR];
for(int i=0;i<NSENSOR;i++)
{
for(int j=0;j<NSENSOR;j++)
{
fcavgMatrix[i][j] = testdataRe[i][j] +I*testdataIm[i][j];
printf("\n Complex:%f+i%f",creal(fcavgMatrix[i][j]),cimag(fcavgMatrix[i][j]));fflush(stdout);
}
LAPACKE_cgetrf (LAPACK_COL_MAJOR , NSENSOR , NSENSOR ,(lapack_complex_float *)(fcavgMatrix[0]), NSENSOR , &ipiv[0] );
valid=LAPACKE_cgetri (LAPACK_COL_MAJOR , NSENSOR ,(lapack_complex_float *)(fcavgMatrix[0]) , NSENSOR , &ipiv[0] );
for(int i=0;i<NSENSOR;i++)
{
for(int j=0;j<NSENSOR;j++)
printf("{ %1f %1f } \t",(fcavgMatrix[0]+i*NSENSOR+j)->re,(fcavgMatrix[0]+i*NSENSOR+j)->im);
printf("\n");
}
}
return 0;
}



When I give the matrix order as ROW_MAJOR ,both CGETRF and CGETRI shows error while running. "On entry to CGETRF,parameter 6 had an illegal value" and "On entry to CGETRI,parameter 3 had an illegal value"
Lekshmi
 
Posts: 1
Joined: Thu Aug 04, 2016 12:58 am

Return to Algorithm / Data

Who is online

Users browsing this forum: No registered users and 3 guests