The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

Having Problem using spotrf_ method.

Open discussion regarding features, bugs, issues, vendors, etc.

Having Problem using spotrf_ method.

Postby miztaken » Wed Aug 04, 2010 12:46 pm

Hi i am using CLAPACK to find an inverse of the matrix.
My matrix is symmetric and real-definite positive.

Now, when i use the method sgetrf_ and then sgetri_ then i am able to get the inverse of the matrix. As this method is for general matrices.

But since i already have the symmetric and real-definite positive matrix so i wanted to use the special function so that i can have performance boost ( since my matrix is so size 3500 * 3500).
So for this i am trying to use function spotrf_ and spotri_. But i am getting error in the first function i.e. spotrf_

My test code goes like this:-

Code: Select all
    char UPLO='L';
   integer   n=4;
   integer LDA=4;
   integer info;
   int result=-1;
   int v=0;
   real *A=(real*)malloc(sizeof(real)*16);
   A[0]=4.16; A[1]=-3.12; A[2]=0.56; A[3]=-0.10;
   A[4]=-3.12; A[5]=5.03; A[6]=-0.83; A[7]=1.18;
   A[8]=0.56; A[9]=-0.83; A[10]=0.76; A[11]=0.34;
   A[12]=-0.10; A[13]=1.18; A[14]=0.34; A[15]=1.18;

[b]result=spotrf_(UPLO,&n,A,&LDA,&info);[/b]


It compiles, but when i execute it, it gives me following error:-

Unhandled exception at 0x0108464a in CLAPACK-EXAMPLE.exe: 0xC0000005: Access violation reading location 0x0000004c.

Help me find the error.

Thank You
miztaken
miztaken
 
Posts: 8
Joined: Wed Aug 04, 2010 12:38 pm

Re: Having Problem using spotrf_ method.

Postby Julien Langou » Wed Aug 04, 2010 2:37 pm

Try &UPLO instead of UPLO in the spotrf call.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: Having Problem using spotrf_ method.

Postby miztaken » Thu Aug 05, 2010 3:24 pm

thanks that did the trick.. :)
miztaken
 
Posts: 8
Joined: Wed Aug 04, 2010 12:38 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 7 guests