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

colwise product?

Tags: None
(comma "," separated)
martinakos
Registered Member
Posts
53
Karma
0
OS

colwise product?

Wed Aug 04, 2010 11:52 am
Hi,

I'm translating some MATLAB code to Eigen and I have something I would write in Eigen as:

T = B1.array().colwise() * c1.array() + B2.array().colwise() * c2.array() + ....

with Bs as matrixes and cs as vectors.

I seem to be able to compile

T = B1.array().colwise() + c1.array()

but not

T = B1.array().colwise() * c1.array()

is this pending to be implemented or I'm missing something?

Thanks
Martin
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: colwise product?

Wed Aug 04, 2010 1:33 pm
Indeed, AFAICS this isn't implemenented and would be a good thing to have; however you can already do the same with a diagonal product (which will be optimized just as well) assuming all your objects are matrices:

Code: Select all
T = c1.asDiagonal() * B1;


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
martinakos
Registered Member
Posts
53
Karma
0
OS

Re: colwise product?

Wed Aug 04, 2010 3:28 pm
hi bjacob,

Thanks for your answer. it's a shame it's not implemented yet. I look forward to it :-)

I'll use the expression you suggested.

Martin.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]