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

In place decomposition in 3.3.-beta2 for blocks/maps

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

Over at
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=707
I can see comments that it is possible to use in place decompoistion on blocks and even map matrices.

In my case I actually have a map whose block is what I need to use.
I can get it around it if need be by was wondering if this indeed is possible and if yes what I am missing

I am not sure what the definition would be
Eigen::LLT<Eigen::Ref<Eigen::MatrixXd>> llt(n.block(0, 0, nrows, ncols));
or even
Eigen::LLT<Eigen::Ref<decltype(n.block(0, 0, nrows, ncols))>> llt

Whatever I tried (in msvc 2015 update 3) I get
error C2660: 'Eigen::Ref<Eigen::MatrixXd,0,Eigen::OuterStride<-1>>::Ref': function does not take 2 arguments

Any ideas ?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
The proper type is Eigen::LLT<Eigen::Ref<Eigen::MatrixXd>>, but you must call the non const constructor. In your case, n.block(0, 0, nrows, ncols) returns a temporary which cannot be bounds to a non-const reference, which is why the wrong constructor is called. The fix is thus: (not tested)
Code: Select all
Ref<MatrixXd> bl = n.block(0, 0, nrows, ncols);
LLT<Ref<MatrixXd> > llt(bl);
xerion
Registered Member
Posts
20
Karma
0
Thanks ggael !


Bookmarks



Who is online

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