[eigen] SparseView

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


I'd like to construct a sparse matrix from a dense one.  I realize
this will require iterating over (and testing) all the entries of the
matrix, but I also assume Eigen has a built-in way to do this than the
naive for-loops I would write.

I've found references to SparseView online -- sometimes apparently as
a method of a dense matrix -- other times as a stand-alone class.
I've also found SparseCore/SparseView.h in the Eigen source.

Unfortunately, I haven't found anything resembling documentation or an
example of how to actually use this.  The class definition for
SparseView seems to be self-referencing:

template<typename MatrixType>
class SparseView : public SparseMatrixBase<SparseView<MatrixType> >

Which was more than my feeble mind could handle...

Does anyone have any pointers on the best way to do this?

I'm currently using Eigen 3.2.8.  I can update if required, but
mention it just in case it is relevant.

Thanks in advance,

Rob



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