Registered Member
|
hi all,
I've just started using eigen and I have a problem with the determinant of a sparse matrix from SparseLU factorisation. It seems, that the its sign is wrong; nearly always is positive. My sparse matrix is a functions of a parameter, lets say p.I calculated the determinant using other methods, not involving eigen, and the sign of the determinant depends on the p parameter. While with eigen a usually get a positive value with a very sharp jumps for some values of p. Did I forget about something? The sign of the derminant can be changed due to an odd pivoting. Is this already included in signDeterminant() function? there is a part of the code: typedef double TT; SparseMatrix<complex<TT>,ColMajor > S(n,n); filling the S matrix; ... S.makeCompressed(); SparseLU<SparseMatrix<complex<TT>, ColMajor> > solver; solver.analyzePattern(S); solver.factorize(S); TT det=solver.signDeterminant()*solver.absDeterminant(); And one more question: How can I see the U matrix? Best regards, Przemek |
Moderator
|
signDeterminant was rather broken. It is now fixed in both devel and 3.2 branches. There is also a determinant() method to directly get the signed determinant.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]