guys, I'm using the function "LAPACKE_spbtrs" of MKL library to solve symmetric-positive-definite-band matrix equations. The 1st step is factorizing the matrix by "LAPACKE_spbtrf" according to the office website: https://software.intel.com/content/www/us/en/develop/documentation/mkl-developer-reference-c/top/lapack-routines/lapack-linear-equation-routines/lapack-linear-equation-computational-routines/solving-systems-of-linear-equations-lapack-computational-routines/pbtrs.html#pbtrs.
But when I run the "LAPACKE_spbtrf", it always return 1, which indicates that the input matrix is not positive-definite. But I'm pretty sure it is.
Here is the full code:
/* Parameters */
#define N 5
#define NRHS 1
#define LDA N
#define LDB NRHS
/* Main program */ int main() {
//convert a symmetric band matrix A to lower band storage mode LA
/*A = 1 1
1 3
*/
float ab[4] = { 0,1,
1,3 };
const int n = 2;
int kd = 1;
int lda = kd + 1;
int info = LAPACKE_spbtrf(LAPACK_ROW_MAJOR, 'L', n, kd, ab, lda);
std::cout << "info:" << info << std::endl;
}
What am I missing?