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

Is eigen efficient for small matrix

Tags: None
(comma "," separated)
pidanchen
Registered Member
Posts
20
Karma
0

Is eigen efficient for small matrix

Wed Nov 23, 2011 6:26 pm
Hello,

I am doing simple matrix manipulations (sum and inverse) for a small matrix 3*3. However, I need to do it millions of times. Is there any benchmark test on whether eigen is efficient for small matrix computations? Or I should write some simple function to this?

Thanks
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Yes Eigen is optimized for both small fixed sizes and large ones. For small objects, just make sure you specify the sizes at compile times (e.g., Matrix3f, Vector3d, Matrix<T,4,4>, etc.)
pidanchen
Registered Member
Posts
20
Karma
0
Is MatrixXf A(9,8) the same as Matrix<float,9,8> A?


ggael wrote:Yes Eigen is optimized for both small fixed sizes and large ones. For small objects, just make sure you specify the sizes at compile times (e.g., Matrix3f, Vector3d, Matrix<T,4,4>, etc.)
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
They are different. Matrix<float,9,8> is allocated on the stack and the operations on it might be unrolled because the sizes are known at compile time. However, for matrices larger than about 6x6 there is no clear advantage of using fixed sizes objects.


Bookmarks



Who is online

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