[eigen] Matrix assignment

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


Hi,

I'm wondering what operator is better for matrix (coefficient wise like) 
assignment:

   = or << ?

I have a matrixXd "m" which will store the result of some matrices(Xd) 
operations.
Matrix "m" should have a fixed size, only known at runtime. If for some reason, 
related to a bug in my code, the operations result in a different matrix size, 
the assignment
   m = "operations with m2,m3,m4,..."
will change "m" size.
I rather need, for debug purposes, an assertion failure being raised.

I discover that the "<<" operator does just what I need (it fails even if the 
operations resulting matrix is smaller than "m").
But now I'm wondering if "<<" operator is equal, in terms of speed and laziness 
optimizations, to the "=" operator.

So?

Thanks in advance. And thanks very very very much for Eigen! It was the matrix 
killer library I was looking for! I had tried  Blitz,boost::ublas, GSL, Tvmet, 
Newmat...
Honestly, Eigen (version 2) is just the best single piece of C++ code I ever 
used!



Cristóvão Sousa



---


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