### Data error in triangular factorization

Posted:

**Thu Aug 20, 2009 7:56 am**Seems like LU factorization works only for full rank (row or column rank) matrices...

Is this a limitation of the beta, or is this an unimplemented feature?

Below is the example code that I use to run... 32Bit FC10, GTX295 Cuda 2.3

=============================================================

// This example is meant to show a typical program flow when using CULA.

int main(int argc, char** argv)

{

#ifdef NDEBUG

int M = 3;

#else

int M = 3;

#endif

int N = M;

int LWORK = 0;

culaStatus status;

float* A = NULL;

int* TAU = NULL;

A = (float*)malloc(M*N*sizeof(float));

TAU = (int*)malloc((M<N?M:N)*sizeof(int));

uint i,j;

for(i=0;i<M;i++)

for(j=0;j<N;j++)

{

*(A+j*M+i) = (float)(i+j+((int)rand())%10);

printf("%f\t",*(A+j*M+i));

}

if(!A || !TAU)

{

free(A);

free(TAU);

return EXIT_FAILURE;

}

printf("Initializing CULA\n");

status = culaInitialize();

checkStatus(status);

memset(A, 1, M*N*sizeof(float));

printf("Calling SGETRF\n");

status = culaSgetrf(M, N, A, M, TAU);

checkStatus(status);

culaShutdown();

free(A);

free(TAU);

return EXIT_SUCCESS;

}

Is this a limitation of the beta, or is this an unimplemented feature?

Below is the example code that I use to run... 32Bit FC10, GTX295 Cuda 2.3

=============================================================

// This example is meant to show a typical program flow when using CULA.

int main(int argc, char** argv)

{

#ifdef NDEBUG

int M = 3;

#else

int M = 3;

#endif

int N = M;

int LWORK = 0;

culaStatus status;

float* A = NULL;

int* TAU = NULL;

A = (float*)malloc(M*N*sizeof(float));

TAU = (int*)malloc((M<N?M:N)*sizeof(int));

uint i,j;

for(i=0;i<M;i++)

for(j=0;j<N;j++)

{

*(A+j*M+i) = (float)(i+j+((int)rand())%10);

printf("%f\t",*(A+j*M+i));

}

if(!A || !TAU)

{

free(A);

free(TAU);

return EXIT_FAILURE;

}

printf("Initializing CULA\n");

status = culaInitialize();

checkStatus(status);

memset(A, 1, M*N*sizeof(float));

printf("Calling SGETRF\n");

status = culaSgetrf(M, N, A, M, TAU);

checkStatus(status);

culaShutdown();

free(A);

free(TAU);

return EXIT_SUCCESS;

}