Reply to topic

UmfPackLU and associated matrix lifetime requirement

jrebetez
Registered Member
Posts
2
Karma
0
While debugging a crash in a program running Eigen, I ran into the following problem :
I had a function that "returned" a solver for a given problem, like :
Code: Select all
void ComputeSolver(/*Non-Eigen problem data*/, UmfPackLU<SparseMatrix>>* solver)
{
  SparseMatrix<double, ColMajor> A;
  // Fill A with values
  solver->compute(A);
}

And then, later in the code, I was using the solver multiple times. Now, the crash came from the fact that UmfPackLU has some internal references to the sparse matrix on which it was computed. But in my case, the matrix was deleted before the call to solver.solve();

So it seems the solver and the associated matrix should have the same lifetime, otherwise bad things will happen. I don't really know if this is a bug specific to UmfPackLU or if this is intended behavior, but I didn't find any mention of this in the documentation. Maybe I missed something about objects lifetime ?

I wrote a small example reproducing the problem :
https://gist.github.com/julienr/6046365
Dee33
Registered Member
Posts
54
Karma
0
OS
Hi,
This is the intended behavior.
UMFPACK needs the initial matrix in the solve phase to perform some iterative refinement.
jrebetez
Registered Member
Posts
2
Karma
0
Ok, thanks for the explanation.
I think this should be mentioned in UmfPackLU's documentation to avoid surprises.

 
Reply to topic

Bookmarks



Who is online

Registered users: Andreas Mair, Baidu [Spider], Bing [Bot], capslock, einar, Exabot [Bot], Google [Bot], Hans, koriun, Majestic-12 [Bot], rainbowgoblin, raymondsarver, rulet111, tparrott, urgo, Uri_Herrera, Yahoo [Bot]