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

Multiplication of a diagonal matrix with a dense matrix

Tags: None
(comma "," separated)
learning_to_code_better
Registered Member
Posts
1
Karma
0
Hi everyone,

Mathematically, A * D only requires multiplying the ith row of A with D_ii. Does the eigen class automatically do this if D is specified as in the Diagonal class?

Sorry if I missed the answer somewhere else.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
yes of course! e.g.:

A = A * d.asDiagonal()

will be optimal, i.e., it will perform A.size() multiplications (using SIMD).


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient