Re: [eigen] Block sparse matrices and std vector compilation error

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




On Mon, Dec 1, 2014 at 3:32 PM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On 29.11.2014 10:13, Gael Guennebaud wrote:

auto b = a.block(...); // C++11
Block<MatrixXd> b(a, ...); // C++03

Thinking about it, at least for user code, I'd rather suggest this alternative:

  Ref<MatrixXd> b = a.block(...);

that's also an option but to be safe, that requires the use of a non-copy variant for const objects (bug 884).
 
Block is really like a reference. Perhaps it would help to make this
analogy clearer in the doc.

Do we have a recommended way to store views/blocks/... of a bigger matrix into a container? Scenarios related to Hilario's use case might be somewhat justifiable in some cases.

Following the C++ "reference" analogy, we would need sub matrix "pointers" here. One more Ref/Map/Block variant where operator* would dereference to a Ref<> and operator= would change the referenced data...

gael
 



Christoph


--
----------------------------------------------
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+ http://listengine.tuxfamily.org/