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

Cannot convert Block<Derived> to Ref<Derived>

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

I recently updated to recent Eigen version (3.3.90) and it looks like it broke stuff I though was working before (prior that I was using an Eigen version 3.2.10 shipped with the libigl library).

I would like to store the result of a block into a ref object that will be passed around and ultimately used to update the internals of the matrix form which the block was extracted.

A minimal example which does not compile anymore:

Code: Select all
typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> Mtype;
typedef Eigen::Block<Mtype> Btype;
typedef Eigen::Ref<Mtype> Rtype;
Mtype m(2, 1);
Btype bm = m.block(0, 0, 1, 1);
Rtype rm = m; // OK
Rtype rbm = bm; // Visual studio 2017 error C2440: 'initialisation' : impossible conversion

Unless some silent update on visual studio compiler has been done which has started to break things, I am lost...

Note that the const version does work, I think this is due to the specialization of Ref for const which recreates a temporary copy:

Code: Select all
typedef Eigen::Ref<const Mtype> CRtype;
CRtype crbm = bm; // OK

Any clues?

Thanks a lot!

Best regards,

Jerome


Bookmarks



Who is online

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