If you initialize an LDLT object with a non positive definite matrix and then call compute() with a positive definite matrix argument, LDLT keeps returning isPositive() == false. Example code: #include <Eigen/Core> #include <Eigen/Cholesky> #include <iostream> int main() { Eigen::MatrixXd M = Eigen::MatrixXd::Random(10, 10); Eigen::LDLT<Eigen::MatrixXd> chol(M); std::cout << chol.isPositive() << std::endl; M = (M * M.transpose()).eval(); M = 0.5 * (M + M.transpose()).eval(); chol.compute(M); std::cout << chol.isPositive() << std::endl; M = Eigen::MatrixXd::Random(10, 10); return 0; } Output: 0 0 Expected Output: 0 1 The problem appears both on linux and mac, for version 3.2.2 and the latest mercurial revision, haven't tested other configurations. If I compile against the eigen 3.2.0 shipped with ubuntu 14.04 the example correctly displays 0 1, so I suppose this is a regression. PS: first bug report ever, so I apologize if it's not clear/proper
Thank you for the report, fixed: https://bitbucket.org/eigen/eigen/commits/3e1f580fdb6c/ Changeset: 3e1f580fdb6c User: ggael Date: 2014-10-20 08:48:40+00:00 Summary: Fix bug 894: the sign of LDLT was not re-initialized at each call of compute() https://bitbucket.org/eigen/eigen/commits/c1fd3a329542/ Branch: 3.2
btw, your bug report is very clear, a self-compilable example is a must to have to get bugs fixed quickly and save us time!
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/894.