This forum has been archived. All content is frozen. Please use KDE Discuss instead.

sparse matrix determinant

Tags: None
(comma "," separated)
pwalczak
Registered Member
Posts
1
Karma
0

sparse matrix determinant

Fri Dec 19, 2014 9:07 pm
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
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: sparse matrix determinant

Mon Feb 16, 2015 6:20 pm
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.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]