Registered Member
|
Hi,
I JUST started using Eig, today actually. I am having a really hard time just inserting values into a SparseMatrix and I was hoping someone could point out my mistake. I've searched all I could on the internet and still can't figure it out. SparseMatrix<double,RowMajor> fr; double val = 1; int row = 0; int col = 3; fr.startVec(row); fr.insertBack(row,col) = val; and it fails at startVec with the error message assertion failed: m_outerIndex[outer]==int(m_data.size()) && "You must call startVec for each inner vector sequentially" from what i read on-line, it seemed that for column-major sparse matrices you would call startVec on the column number and iterate over rows.. In RowMajor Sparse matrices you should call startVec on the row number and iterate over columns... what am i not understanding here?? any help would be VERY much appreciated. sorry for the beginner's question.. |
Moderator
|
Please, for sparse stuff use the alpha2 version (or even the devel version) and follow the recommendation of the tutorial. startVec is for advanced uses only.
http://eigen.tuxfamily.org/dox-devel/Tu ... rseFilling |
Registered Member
|
Hi lizkellogg,
it seems that you have not set the size of your matrix, which may explain the crash. The following code runs fine on my Ubuntu 11.10 with Eigen 3.0.5:
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell