Small vector and matrix proposed for phobos2 now on github

Robert Jacques sandford at jhu.edu
Thu Apr 29 16:38:08 PDT 2010


On Thu, 29 Apr 2010 19:16:49 -0400, Gareth Charnock <gareth.tpc at gmail.com>  
wrote:

> Jérôme M. Berger wrote:
>> Gareth Charnock wrote:
>>> PS: Okay so I just had a looked at the matrix and vector classes in
>>> Ogre3D and irrlicht. Looks like they both define v*v as element wise
>>> multiplication but m*m is matrix multiplication. That just seems even
>>> more inconsistent.
>>  	Eigen (http://eigen.tuxfamily.org/ ) uses '*' for the matrix
>> multiplication. v*v is an error (incompatible shapes). Element wise
>> operations can be done like this: v.cwise()*v
>>  		Jerome
> That's an very impressive looking library if even half of what they  
> claim is true. I can't believe I've missed this for so long (found the  
> boost matrix library, blitz++, the matrix template library, FLENS,  
> something called armadillo but not eigen. I do believe all my C++ linear  
> algebra woes are over.
>
> Eigen seems to treat vectors as 1 by n matrices and if you do this you  
> get the matrix-vector product and the dot product for free as these are  
> all the same operation. Probably v^T*v would be the dot product.  
> Expression templates should make these operations efficient.
>

Actually, express templates, though they give nice syntax result in a lot  
of temporaries, which hurt performance. Check out Don's BLADE library and  
the associated talks and posts.


More information about the Digitalmars-d-announce mailing list