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

SimplicialLDLT<SparseMatrix<double>> returning NaNs

Tags: None
(comma "," separated)
dfigueira
Registered Member
Posts
3
Karma
0
Hi ggael,

I can't reproduce this with a minimal example, but I still feel compelled to report it, thus posting here instead of stack overflow.

Code: Select all
#include <iostream>
#include <unsupported/Eigen/SparseExtra>

using namespace std;
using namespace Eigen;

int main()
{
   Eigen::SparseMatrix<double> A;
   Eigen::VectorXd b;
   loadMarket(A, "SimplicialLDLT_outputting_NANs_A.txt");
   loadMarketVector(b, "SimplicialLDLT_outputting_NANs_b.txt");

   SparseMatrix<double> AtA;
   AtA = A.transpose()*A;
   VectorXd Atb;
   Atb = A.transpose()*b;

   SimplicialLDLT<SparseMatrix<double>> ldlt(AtA);
   VectorXd x;
   x.setZero();
   x = ldlt.solve(Atb);
   cout << " : " << ldlt.info() << " ;  err: " << (AtA*x - Atb).norm() / Atb.norm() << endl;

   if (ldlt.info() == Success)
   {
      cout << "EigenSolveInner: LDLT succeeded x(" << x.cols() << "x" << x.rows() << ") domain E [" << x.minCoeff() << ".." << x.maxCoeff() << "] " << endl;
   }
}
The above works perfectly.

However, the above, without the saveMarket/loadMarket, in the middle of other code, I was able to make `SimplicialLDLT.solve()` and have a `.info() == Success` but have `x` filled with nan's.

- It was not in a multi-thread location
- I ran with Application Verifier and Debugdiag and no heap corruption errors were detected
- Creating a separate local variable `x` and `ldlt` still would `.info() == Success` a `x` filled with nan's.
Only when I `saveMarket(A...); saveMarketVector(b,...); loadMarket(A,...); loadMarketVector(b,...)` and re-`.solve()` did the buggy behaviour disappear

Do you have any idea what else could cause such behavior?


Bookmarks



Who is online

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