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

ei_assert on line 59 of coeffs.h

Tags: None
(comma "," separated)
Sean.Whipple
Registered Member
Posts
6
Karma
0
OS

ei_assert on line 59 of coeffs.h

Tue Jul 19, 2011 2:45 pm
I'm developing an application that requires eigenvalues be calculated.

However when I try to calculate the eigenvalues I fail on assert on line 59 of coeffs.h. And this causes a crash. However if I ignore it and keep going the results are correct. I confirmed this with MATLAB. My question is why am I failing the assert if the eigenvalues can be calculated. Is this assert call simply to draw attention to developers?

I'm currently building on Microsoft Visual C++ 2005 Pro on Windows XP
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
What assert? Which eigenvalues decomposition? SelfAdjoint? Complex? general?
Sean.Whipple
Registered Member
Posts
6
Karma
0
OS
I apologize, I actually listed the wrong error.

I'm failing the ei_assert(Flags&SelfAdjointBit); call in selfadjointeigensolver.h
Sean.Whipple
Registered Member
Posts
6
Karma
0
OS
On line 296 in selfadjointeigensolver.h
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
oh your are still using Eigen2, to call .eigenvalues() directly on a matrix you have to mark it as selfadjoint:
mat.mark<SelfAdjointBit>().eigenvalues()
but I'd recommend you to use either the SelfAdjointEigenSolver or EigenSolver classes directly depending on whether your matrix is selfadjoint or general:

SelfAdjointEigenSolver<MatrixType> eig(mat);
... eig.egenvalues() ...;
... eig.egenvvectors() ...;
Sean.Whipple
Registered Member
Posts
6
Karma
0
OS
I seem to be getting syntax errors with both solutions.

For solution 1 I get get the following errors:
SelfAdjointBit undeclared identifier
mark is not a member of Eigen::Matrix

For solution 2 I get the following:
eig : identifier not found
Eigen::Matrix3d illegal use of this type of expression (I'm using that as the matrix type)
SelfAdjointEigenSolver: undeclared identifer

I'm including the following from Eigen2
#include <Eigen/Core>
#include <Eigen/Array>
#include <Eigen/Geometry>
#include <Eigen/LU>
#include <Eigen/Eigen>

and using the following macro:
USING_PART_OF_NAMESPACE_EIGEN

Is there anything else I should be doing? Thanks again for the help
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
sorry it is probably "marked<Eigen::SelfAdjoint>()" and you also need to #include <Eigen/QR>

btw, do you have to stick with Eigen2? Eigen3 is much more mature, and better documented too.
Sean.Whipple
Registered Member
Posts
6
Karma
0
OS
Thanks for all the help. One more quick question. I took your advice and began upgrading to Eigen3 and for the most part the port has gone smoothly except for one syntax problem. I used to have a call
Code: Select all
tempMat.lu().isInvertible()


But in Eigen3 I notice that they have a different function so I'm using:
Code: Select all
tempMat.computeInverseWithCheck(tempMatInv, invertible);


However I keep getting errors that say
'run' is not a member of Eigen::internal::compute_inverse_and_det_with_check

I am including <Eigen/LU> and that's all the documentation on the website says I need. What am I doing wrong here?
Sean.Whipple
Registered Member
Posts
6
Karma
0
OS
Actually I found the problem. Thanks for the help


Bookmarks



Who is online

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