Re: [eigen] Setting diagonal of a sparse matrix |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Setting diagonal of a sparse matrix*From*: Peter <list@xxxxxxxxxxxxxxxxx>*Date*: Thu, 22 Sep 2016 16:06:41 +0200

Dear Brad, while I'm not an expert on sparse Eigen, the documentation clearly says <https://eigen.tuxfamily.org/dox-devel/classEigen_1_1SparseMatrix.html#ae928a8d31634ba1d62a3446772aae974> Warning If the diagonal entries are written, then all diagonal entries must already exist, otherwise an assertion will be raised. Putting a S.setIdentity() before assigning solves the problem. Whether there is a better way, I don't know. Best regards, Peter

**References**:**[eigen] Setting diagonal of a sparse matrix***From:*Brad Bell

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Setting diagonal of a sparse matrix** - Next by Date:
**Re: [eigen] Setting diagonal of a sparse matrix** - Previous by thread:
**Re: [eigen] Setting diagonal of a sparse matrix** - Next by thread:
**[eigen] 3.3-rc1 released!**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |