Re: [eigen] Issues regarding Quaternion-alignment and const Maps |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Issues regarding Quaternion-alignment and const Maps
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Wed, 7 Jul 2010 11:44:47 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=895FpXYUvJ3ye2YoJ650lywfCAkxqiI+UFlhW2VvR6M=; b=L+R2/8ZKEfQNgXpLXQ4vjEPg4sCL6TLcfH7ZLK2irCwoOxiqfut4aYU8Scw/OrA/3G amLMYQuNgtzLARzNnZApAl43Vodnt/nvf2GZ7/Bz7XXHobhDlPxk11S6o8x5NaTYznNp Htpa9cJ4VZSCIw0n7L8I+V1WaxckBM+5YBVcI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wnwsDjtkqe8A0TjfXQ2R2khPnQ+84ZVYLru7ro1Hvwp9XlcZO3wO1Vah7AzLa3vYd+ iS7uW2Ir2/37wFBL5TgkNAFYW9N3EXigJhmsD9uAqB62r0VcnT909LZvv/6mZzDG1yQy PXNXFkKZmmMbIMdXWRy1RTHm0qdIi5Tf/0srI=
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