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

SparseMatrix insertion order

Tags: None
(comma "," separated)
eftang
Registered Member
Posts
7
Karma
0

SparseMatrix insertion order

Mon Jun 18, 2012 7:09 pm
I'm using version 3.1.0.a2 for some sparse linear algebra, and I'm building a sparse matrix from a triplet set with setFromTriplets().

If I compile in release mode everything seem to work fine. If I compile in debug mod and run my program, an assertion within eigen is triggered within SparseMatrix.h (l. 385) : Assertion `(m_outerIndex[outer+1]-m_outerIndex[outer]==0 || m_data.index(m_data.size()-1)<inner) && "Invalid ordered insertion (invalid inner index)"' failed.

So it complains that the ordering of my insertion is wrong, but I thought the ordering did not matter when I used setFromTriplets.

The assertion gets triggered at the second line in the following code:
Code: Select all
solver.compute(my_matrix); //solver is a sparse cholesky solver
SparseMatrix<double> B = solver.matrixL();


Any ideas?

Best,
Jens
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: SparseMatrix insertion order

Mon Jun 18, 2012 9:47 pm
maybe you could try the rc1 release to see if the issue is still there. (note that SimplicialLDLt has been renamed SimplicialLDLT and same for SimplicialLLt -> SimplicialLDLT)
eftang
Registered Member
Posts
7
Karma
0

Re: SparseMatrix insertion order

Tue Jun 19, 2012 3:04 pm
Thanks.

The reason for the assertion being triggered was not the insertion order but that my matrix was not spd (!). I guess the factorizer just gets stuck and throws this error when that happens. I was just confused by the error message ...

Jens
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: SparseMatrix insertion order

Tue Jun 19, 2012 8:13 pm
I see, you can check for such errors at runtime with:

solver.info()==Eigen::Success


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell