|[eigen] Sparse Matrix Block Insertion|
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
Thank you so much for your quick replies to my previous question.
I have another problem, though.
I'm dealing with a sparse vector.
Am I able to use .block function to insert a block of vector directly to the sparse vector ?
I tried matrix.insert.block() DIDN'T WORK
matrix.block.insert() DIDN'T WORK
Do I have to insert everything one by one?
Appreciate any suggestions. Thanks
using namespace Eigen;
using namespace std;
// I have a Vector A with length of 10
SparseVector<double> vecA (10);
// I have a Vector 4 with length of 4
Vector4d vecB = VectorXd::Ones(4);
// I want to insert the element of Vector B to A starting from 3rd row
vecA.insert.block(2) = vecB; // Problem is HERE
-- Gokturk Poyrazoglu Mitsubishi Electric Research Laboratories (MERL) 201 Broadway, Cambridge, MA
|Mail converted by MHonArc 2.6.19+||http://listengine.tuxfamily.org/|