Registered Member
|
Hi,
I wrap a class around Eigen's API of SelfAdjointEigenSolver. I.e.:
Matrix is a user defined matrix type wich wraps Eigen's MatrixXd class. Before the actual constructor of the eigen solver can be called, we must check the dimensions of the given input data. This is done by
What is critical, that is the line
It allocates required space for the eigenvectors and eigenvalues, at least of dimension 1 (because we do not know what dimension the input marix will have). The default constructor does not work in the moment (Assert on the dimension). Using VALGRIND, I obtain
Using EIGEN_MAKE_ALIGNED_OPERATOR_NEW does not change anything. But removing the member
Thanks for any advice on that... |
Registered Member
|
First of all, it would greatly help here if you could provide a self-contained test program that we can compile and run valgrind on.
From your description, nothing indicates that the invalid read/writes actually come from Eigen itself... About the fact that the default constructor doesn't work (assert) in the dynamically sized case: this is definitely something we'll fix before the 3.0 release.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Well, I just prepared a small test program - and figured out that the bug does not appear in the test case. Must be somewhere inside of the SWIG bindings...
Anyhow, when applying the generalized eigenvalue problem, I get thousands "uninitialized value" warnings, see code below
|
Registered Member
|
You got me thinking for a long time!
In the critical line:
You are calling the variant to solve the generalized eigenproblem. As is explained in the API docs for that method, http://eigen.tuxfamily.org/dox/classEig ... c4f5c2d11c the 2nd matrix that you pass to this method is required to be positive definite. Here you are passing a non-positive matrix. Because of that, NaN values are generated. I modified your test program to let mat2 be positive and suddenly there's no problem anymore. I'm all for improving eigen to be more tolerant to bad input, but here, the problem happens inside of the LLT decomposition that is internally used by the generalized selfadjoint eigensolver. In that context, checking for positiveness can only be done at the cost of a runtime overhead and even so, it can't be very reliable. So I'm not sure that we should try to do something about it...
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]