- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I've some small square matrices (so around 100x100) that are sparse. I want to use the LAPACK functions to compute the inverse. To do this, I've tried to use the function dgetrf (in C++). But always the info return value is > 0. I've checked the matrix, but it has no zero values on the diagonals. Because the matrix is square, I can use n=m=lda for the input parameters. Is it right? Is there any trouble known when using sparse matrices with LAPACK? I've also check the matrices in Matlab, they are non-singular.
Thanks for any hints,
Thomas
Thanks for any hints,
Thomas
1 솔루션
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Quoting - thomasdd
Quoting - Melvin
Can you post some example code so that I can see what you are doing?
int n = 4, m = 4, lda = 4;
int ipiv = 0, info = 0;
double matrix[16] = {1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};
dgetrf(&m, &n, matrix, &lda, &ipiv, &info);
std::cout << "INFO = " << info << std::endl;
In this case, info is 4! Is there anything wrong in the call of dgetrf?
Thomas
Thomas,
ipiv is the array, but not integer
the dimention at least max(1,min(m,n)), therefore for your case ipiv[4].
Please refer to the mkl's reference manual.
--Gennady
링크가 복사됨
4 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Quoting - thomasdd
I've some small square matrices (so around 100x100) that are sparse. I want to use the LAPACK functions to compute the inverse. To do this, I've tried to use the function dgetrf (in C++). But always the info return value is > 0. I've checked the matrix, but it has no zero values on the diagonals. Because the matrix is square, I can use n=m=lda for the input parameters. Is it right? Is there any trouble known when using sparse matrices with LAPACK? I've also check the matrices in Matlab, they are non-singular.
Thanks for any hints,
Thomas
Thanks for any hints,
Thomas
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Quoting - Melvin
Can you post some example code so that I can see what you are doing?
int n = 4, m = 4, lda = 4;
int ipiv = 0, info = 0;
double matrix[16] = {1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};
dgetrf(&m, &n, matrix, &lda, &ipiv, &info);
std::cout << "INFO = " << info << std::endl;
In this case, info is 4! Is there anything wrong in the call of dgetrf?
Thomas
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Quoting - thomasdd
Quoting - Melvin
Can you post some example code so that I can see what you are doing?
int n = 4, m = 4, lda = 4;
int ipiv = 0, info = 0;
double matrix[16] = {1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};
dgetrf(&m, &n, matrix, &lda, &ipiv, &info);
std::cout << "INFO = " << info << std::endl;
In this case, info is 4! Is there anything wrong in the call of dgetrf?
Thomas
Thomas,
ipiv is the array, but not integer
the dimention at least max(1,min(m,n)), therefore for your case ipiv[4].
Please refer to the mkl's reference manual.
--Gennady
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Quoting - Gennady Fedorov (Intel)
Thomas,
ipiv is the array, but not integer
the dimention at least max(1,min(m,n)), therefore for your case ipiv[4].
Please refer to the mkl's reference manual.
--Gennady
Thomas