Re: [eigen] Issues regarding Quaternion-alignment and const Maps

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


On Wed, Jul 7, 2010 at 11:22 AM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> yes, I think the main trick is to detect the const, and then propagate
> it to MapBase such that the m_data pointer can be properly const
> qualified if needed (using ei_meta_if<NeedConst,const
> Scalar*,Scalar*>::ret), and then remove the const_cast in the
> coeffRef/packetRef functions...

True and I did that now. Unfortunately there is another side effect.
Since if you do this and use the following code

typedef Map<const MatrixXd> Derived;
Matrix< Derived::Scalar, Dynamic, Dynamic > some_matrix;

you get

Matrix< const double, Dynamic, Dynamic > some_matrix;

which is not supported and actually does not really make sense. So we
were required to clean up the _Scalar type of matrix with ei_unconst.
That means we need to rewrite EIGEN_DENSE_PUBLIC_INTERFACE which is
totally ugly since it takes Derived and reuses it.

We also need an ei_addconst but that's quite easy.

There seems to be still no blocker but it involves a bunch of changes
and some are quite ugly.

- Hauke



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