- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to calculate inversion of a symmetric matrix using Cholesky factorization in C using "dpotri" MKL's LAPACK function. I wrote this code:
int info=0;
int param1=n*n;
int param2=n;
char* uplo="U";
dpotri(uplo, ¶m1, M, ¶m2, &info);
where "M" is a "nxn" symmetric matrix. The is compiled successfully but when I run the pogram, it says that parameter 4 (LDA which is defined "n" here) is incorrect. Should't it be "n" for a "nxn" matrix? Also, should I call "dpotrf" before "dpotri"?
Thanks for your help,
D.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
int info=0;
int param1=n*n;
int param2=n;
char* uplo="U";
dpotri(uplo, ¶m1, M, ¶m2, &info);
where "M" is a "nxn" symmetric matrix. The is compiled successfully but when I run the pogram, it says that parameter 4 (LDA which is defined "n" here) is incorrect. Should't it be "n" for a "nxn" matrix? Also, should I call "dpotrf" before "dpotri
Should it be param1=n ? The matrix has to be dimensionedby the square of that value, which may not exceed param2.
It does require execution of potrf first.
http://www.intel.com/software/products/mkl/docs/WebHelp/lle/functn_potri.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Should it be param1=n ? The matrix has to be dimensionedby the square of that value, which may not exceed param2.
It does require execution of potrf first.
http://www.intel.com/software/products/mkl/docs/WebHelp/lle/functn_potri.html
I think param1 is set correctly which is "n^2" for an "nxn" matrix which is order of that matrix. param2 is the problem which is "LDA" and should be "LDA>=max(1, param1)". Am I right? I don't know what "LDA" is. It is defined as "first dimension of matrix". I set param1=n and param2=n*n and got "segmentation fault" error. Same error for param1=param2=n*n.
D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
param1 should definitely be set to the linear size of the matrix.
LDA is "a leading dimension of A", it could be referred to as a stride. If 2-d array is continuous in memory, the stride is equal to the first dimension of the matrix (in case of 2-d array in C language it would be the last dimension).
In your particular case param1=param2=n should be set.
Michael.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page