|Re: [eigen] MatrixX multiply|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] MatrixX multiply
- From: "Steven große Deters" <steven.grossedeters@xxxxxxxxx>
- Date: Fri, 16 Feb 2007 12:15:20 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=R1f3PK2nFSBm0aLL2BmzyX68s/meEXUfb9gOIvcPpI4+1454fCo2lPY8AftalNXQurYGMdiJ8MivqHHRIVPtWKacJQMeeB6+T2TncwulPltu388k+DOYtKJNLg/tp8OX2knsZo5SbHgDI6LLYGM1VclId0kx40uDyRXij6W3X2c=
thank you for your advise. I have one additional question: Does Eigen support m*n matrices or is it limited to n*n matrices ?
If it supports m*n matrices, how would I use the size() function to determine the number of rows and columns?
You can certainly do it, but there's a faster way: Eigen allows you to
directly access the elements in the array of matrix entries, by
operator. You can take advantage of it here, i.e. do a single loop like
for( int i = 0; i < size()*size(); i++ )
result_matrix[i] = matrix1[i] * matrix2[i];
As a side-note: if you know at compile-time the size of your matrices and
if this size isn't too big, you'll get much, much better performance with
fixed-size matrices, i.e.
Matrix< float, Size > or Matrix4f instead of MatrixXf.