Registered Member
|
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. |
Moderator
|
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. |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]