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

Blitz to eigen

Tags: None
(comma "," separated)
warin
Registered Member
Posts
1
Karma
0

Blitz to eigen

Thu Oct 07, 2010 1:01 pm
Hello dear Eigen developpers,

We consider switching our optimization library from blitz++ to eigen.
We'd like to do it quite automatically (so many lignes codes to change).
The main problem i see comes from the following blitz++ feature.
In blitz++ a useful feature in scientific computing is the use of special constructor :
blitz::Array<double,2> a(5,5);
blitz::Array<double,1> b(a(0,blitz::Range::all()));
b won't be a copy but will encapsulate "a" data row 0. So modifying "b" will modify "a".
Is there an easy way in eigen to do easily such construction ?
Have you heard of special library that move automatically from blitz to eigen
Thank you by advance.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Blitz to eigen

Thu Oct 07, 2010 5:25 pm
Hi,

Your example in Eigen style:

MatrixXd a(5,5);
MatrixXd::RowXpr b(a.row(0));

or:

ArrayXd a(5,5);
ArrayXd::RowXpr b(a.row(0));

I don't believe there exist any automatic conversion tools.

Finally, I just wanted to be clear that Eigen is not a tensor library and it is limited to vectors and 2D matrices. For optimizations I guess you don't need more though.


Bookmarks



Who is online

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