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

multiplication of a vector with a matrix

Tags: None
(comma "," separated)
jlopes
Registered Member
Posts
3
Karma
0
Hi,


I'm multiplying a vector with a
Matrix with Eigen and it seems a a little bit slow in comparison with other operations

The matrices are,
MatrixXcd v1(SIZE, MEMORY)
MatrixXcd v2(SIZE, 2)
MatrixXcd gamma_tmp(400,400)

gamma_tmp.col(i).segment(count, MEMORY) = v1.adjoint() * v2.col(index);

I'm using MEMORY=50 , count is a position inside a loop ans index also takes values in 0 or 1.
Is there any other way of doing this multiplication in a more efficient way?

Thanks in advance
João
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
you can add .noalias() to avoid a temporary and make sure you compiled with optimizations on (e.g., -O3 with gcc/clang or "release" mode with msvc).


Bookmarks



Who is online

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