Re: [eigen] Passing Eigen::Map types to functions that take Eigen types

[ Thread Index | Date Index | More Archives ]

On 01.07.2015 17:55, Martin Felis wrote:
Replacing do_work with do_work_ref as suggested by Christoph Hertzberg
does work. This would still mean I have to change my library code.

Would it be possible to subclass MatrixXd to take a pointer and use that
instead of creating a new one?

This would be possible. You might even reinterpret_cast a Map<MatrixXd>& to a MatrixXd& -- I would of course strongly advise against that, mostly because this is merely a hack and you will likely risk compatibility, eventually. Is there a good reason, why your library must take MatrixXd& instead of Ref<MatrixXd>? Or why you can't change your library code?


Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252

Mail converted by MHonArc 2.6.19+