This forum has been archived. All content is frozen. Please use KDE Discuss instead.

array.matrix() multiplication

Tags: None
(comma "," separated)
GeorgeKnight
Registered Member
Posts
15
Karma
0

array.matrix() multiplication

Fri May 06, 2011 4:48 pm
Hi,

As the following works well:

Code: Select all
ArrayXXf a(3,3);
a <<  1, 2, 3,
      4, 5, 6,
      7, 8, 9;
         
ArrayXXf b(3,1);
b << 1,2,3;

cout << a.matrix() * b.matrix() << endl;


I don't understand why the following doesn't work:

Code: Select all
ArrayXXf a(3,3);
a <<  1, 2, 3,
      4, 5, 6,
      7, 8, 9;
         
ArrayXf b(3);
b << 1,2,3;
   
cout << a.matrix() * b.matrix() << endl;


I get a "No member named 'data' in Eigen::MatrixWrapper" because of the matrix multiplication. If I print b.matrix().rows() and b.matrix().cols() I still get 3 and 1. So why doesn't the multiplication work? A MatrixXf and VectorXf multiplication would work.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: array.matrix() multiplication

Fri May 06, 2011 7:20 pm
that's a bug from us. Fixed in devel and 3.0.x branches. thanks for the report.
GeorgeKnight
Registered Member
Posts
15
Karma
0

Re: array.matrix() multiplication

Fri May 06, 2011 10:19 pm
Thanks!


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora