Re: [eigen] Copy into a MappedSparseMatrix

[ Thread Index | Date Index | More Archives ]

On 16.07.2015 at 07:35, Norman Goldstein wrote:
I have the following two matices:

MappedSparseMatrix<...> hmat;  // Points to some data off to the side

MappedSparseMatrix is deprecated, you should use Map<SparseMatrix<...> >

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'm not sure that this is a good idea (what behavior would you expect, if the structure does not match?). If you are certain that the structure is the same, you could directly copy the contents of prod.valuePtr() to hmat.valuePtr() (using std::copy).


Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252

Mail converted by MHonArc 2.6.19+