[eigen] Copy into a MappedSparseMatrix

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


I have the following two matices:

MappedSparseMatrix<...> hmat;  // Points to some data off to the side
SparseMatrix<...> prod; // Contains data, same size and structure as hmat

I want to copy the prod data over to where hmat is pointing:

hmat = prod;

I get the

 error: no match for
‘operator=’ (operand types are ‘Eigen::MappedSparseMatrix<double, 1>’ and ‘Eigen::SparseMatrix<double, 1, int>’)
       hmat = prod;
            ^
note: candidate is:
/usr/include/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h:31:7: note:
Eigen::MappedSparseMatrix<double, 1>& Eigen::MappedSparseMatrix<double, 1>::operator=(const Eigen::MappedSparseMatrix<double, 1>&)
 class MappedSparseMatrix
       ^
/usr/include/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h:31:7: note:
no known conversion for argument 1 from ‘Eigen::SparseMatrix<double, 1, int>’ to ‘const Eigen::MappedSparseMatrix<double, 1>&

-------------------

I've seen examples for constructing and printing a MappedSparseMatrix, but not for writing into
a MappedSparseMatrix.

Thank you

PS I was unable to register with the KDE forum -- something odd with my KDE ID, username and email.



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