Hello,

I had a question about the implementation of Cholesky decomposition in C using LAPACK. The LAPACK function for Cholesky decomposition that I'm using is spotrf.

The value of INFO is set to zero when the input matrix is symmetric positive definite and there are no errors. Suppose that the matrix for which I want to find the Cholesky decomposition is:

cov = [1 3 4;

3 13 16;

4 16 21]

This is symmetric and positive definite though when I pass it to spotrf, the value of INFO gets set to 1, signifying that the matrix cov is *not* positive definite. The situation is the same even the matrix that I pass (i.e., cov) is the identity matrix.

The relevant code that I'm using is:

int INFO, size;

char UPLO;

UPLO = 'L';

size = 3;

spotrf_(&UPLO, &size, cov, &size, &INFO);

I'm not sure why INFO is being set to 1 on return. Any help would be greatly appreciated.

Thanks,

Rahul.