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

PermutationMatrix::determinant() disappeared

Tags: None
(comma "," separated)
negroj
Registered Member
Posts
3
Karma
0
I just started using the newest version of eigen ("sudo apt-get install libeigen3-dev" on ubuntu). I think the version I was using before was Eigen 2.[something].

Some things appear to have vanished since the version I used before, although they are still in the online documentation. So far I've found a way around it except for the following:

I need to find the log of a determinant, and have done it the following way before in order to avoid very large/small values:
Code: Select all
Eigen::MatrixXcd Mat=setupMat();
Eigen::PartialPivLU<Eigen::MatrixXcd> LU(Mat);
Eigen::MatrixXcd U=LU.matrixLU().triangularView<Eigen::Upper>();
complex<double> log_det=0;
for(int i=0;i<n;i++) det+=log(U(i,i));
det+=log(complex<double>(LU.permutationP().determinant()));

where "setupMat()" is a function I've defined, and "LU.permutationP().determinant()" is necessary to get the sign of the determinant.

This worked fine up until now, where I get the compiler error
Code: Select all
error: ‘const PermutationType’ has no member named ‘determinant’

Although "determinant()" still there in the documentation: http://eigen.tuxfamily.org/dox/classEigen_1_1PermutationBase.html#a021fa8725bf6224f20a8670afabb6bcd

So far I haven't thought of an efficient way to get the sign of the determinant. Using "indices()" seems like it would be slow. Any ideas?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I don't think you were using Eigen2: In Eigen2 there is no PartialPivLU, no PermutationMatrix, etc. You were more likely using the devel branch (3.3). To get the determinant of a permutation matrix, you need latest 3.2 and devel branch.
negroj
Registered Member
Posts
3
Karma
0
Oh I see, thanks. Is there a way to get the devel branch through apt-get or do I have to do it the old fashioned way?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
debian ships the 3.3-beta1 version which is likely compatible with ubuntu.
negroj
Registered Member
Posts
3
Karma
0
Ok. When you say "ships" do you mean through a package manager? Apparently not apt-get?


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient