| [eigen] Matrix assignment | 
[ Thread Index | 
Date Index
| More lists.tuxfamily.org/eigen Archives
] 
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Matrix assignment
- From: Cristóvão Sousa <crisjss@xxxxxxxxx>
- Date: Mon, 20 Oct 2008 18:18:24 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;         d=gmail.com; s=gamma;         h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:content-transfer-encoding           :content-disposition:message-id;         bh=of5qF573V1UkzLN3ocmBmtouUCFMkEtikFVGnYSu8HA=; b=CyF+9+j9/5UzPH9BBDUWi9EfgMLT52oW1fXu73vqOjiHejd5R5++VpVpBlYxO1Mzt0       uUd1AY7AqLWEbOeDpfNpOQ8+ocu5LC3YvbvT4iGiGSSseUNrxKueTpFh7FXM0WUOhXVn       2cLZOslaMFHjMfYrlpUJhTsp451lzS4dnKy+s=
- Domainkey-signature: a=rsa-sha1; c=nofws;         d=gmail.com; s=gamma;    h=from:to:subject:date:user-agent:mime-version:content-type           :content-transfer-encoding:content-disposition:message-id;          b=hvCeujcu+yH2/qFS9HtvVh9dyDCSBByYecaeL3wGoq+IlXJablESTgN24ha/0JrfjY       MCXzN0kkKm81Y4DpQoIdPyMn/ZE0ybH77y121OsNyq7OdIxl4m5MKfIjwreOGU0Xa6Ro       MvWQemxpHESElTlrO7Kk9Jp4Wrgf0ktM2uwlo=
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
---