4
votes

I am trying to compute if a sparse matrix I am operating on is positive definite. For this I am trying to use the sylvester criterion, meaning that the leading minors are positive.

To calculate the determinant of the matrix I am constructing a sparseLU solver of each block of the matrix, which can then give me the determinant of the matrix. But starting from a certain dimension (around 130*130) I am getting the result that all determinants are 0. This is not some special dimension in my problem (the matrix has blocks of 32*32) so I am believing this issue is related to some truncation algorithm applied by Eigen with determinants simply falling below some thresholds.

My search for such a mechanism has resulted in no decent results. My matrix has dimensions of around 16k*16k and all non-zero elements are on the on the 96 elements near the diagonal.

Is any truncation mechanism implemented in Eigen and can I control its thresholds somehow?

1
It can be a little careless, but can't you just wait for the algorithm that requires a positive definite matrix to fail?Bathsheba
All sparse matrix solver available in Eigen which require the matrix to be positive definite also require the matrix to be symmetric, which mine is notlazyguy
For such big matrices, even sparse, accumulation of rounding errors can be terrible. Have you tried using longer types ?Damien
I am already using doubles and my compiler doesn't support any larger types, but @chtz gave the answer I neededlazyguy

1 Answers

3
votes

This is very likely due to underflow, i.e., the determinant is calculated as a product of lots of numbers smaller than 1.0. If you calculate the product of 130 values around 0.5 you are near the border of what can be represented with single precision floats.

You can use the methods logAbsDeterminant and signDeterminant to get meaningful results.