[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] SparseView
- From: Rob McDonald <rob.a.mcdonald@xxxxxxxxx>
- Date: Fri, 6 Jan 2017 08:05:13 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=8XMUNQ5RKc/XgpdrxTsx4VgNKJQdm8f3hkV8g1N/u7A=; b=NZNOm/6Gkxk4axgnYs5tjSxia098JcmzexE6GxpWlgMzeNay8qhZfNwb0JO5AMG9oY Xa2ep/Ie7+woPDZf1kH8XfBVlZOYvy7fIbSxD8bjvXpAGga4FyoKH4eCBF1u1Ty+OUUv VMHYX0vzxiNztPC6ZNyITn2SXco/4m60Auln+Lc3xgD8iXLS6WYonLWPw26Rtu8WTvoE MXwwVSb3D+cyJKawvHgaXBcfP4zPrYy9SQoChe3aKFiluohuRZRrNvuWrZ/7gcv5G4fA 9j/KIlmMLBBj2wL5D+koIr6rXMfUKADkX91oDRf6dDwggrpoM9/chYi1YtHZV88IU3u+ W80A==
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