[eigen] C++11 Style Initialisation

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hello,

 

I would very much like to write expressions like:

 

Eigen::Matrix3f example{1, 2, 3, 4, 5, 6, 7, 8, 9};

 

I have tried searching, but I cannot see a current Bugzilla entry for functionality like this. I found http://eigen.tuxfamily.org/bz/show_bug.cgi?id=954, but that’s slightly different. I can think of several use cases for this, and there are similar StackOverflow questions (https://stackoverflow.com/questions/21280476/uniform-initialization-with-eigen-dynamic-types and https://stackoverflow.com/questions/25159349/is-it-possible-to-initialize-a-const-eigen-matrix)

 

I know that Eigen is committed to supporting C++03. Is it possible to add support for this in unsupported/cxx11? I would be tempted to try adding this myself, but I would need some pointers on where to start.

 

Interestingly,

 

Eigen::Vector3f example2{1, 2, 3};

 

does work, similarly Vector2f and Vector4f, because they have specific constructors that allow you to write

 

Eigen::Vector3f example(1, 2, 3);

 

however, these do not extend to the general case.

 

Best wishes,

Toby



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/