Re: [eigen] new tutorial on writing functions taking Eigen types as paramters |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] new tutorial on writing functions taking Eigen types as paramters
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Tue, 17 Aug 2010 17:23:58 +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 :content-transfer-encoding; bh=7YXdX7mjARKDuPVpcvj3KUdojH4ybxP9B56mgisXQ/8=; b=UFY0WuF+2e0vetdJMkmVzPClXM8mneIaTjS+gnKNEZwLmNx+GTY8GKxNFUyFx0haai cVIvCTXVAxTSzAq1+BEUkqj9se7rUbw7ATqDkl+fcVNBJZxGtkQ1sT1oy2QbMN9nKiLQ 3m6lk1ntaoXyiO0Dp4OONshSwYbiHFYqs9gX8=
- 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:content-transfer-encoding; b=UsCYLrSyR4Sj6yyQ8VYG2C+VI8tLTKs1/q7RHY6rjC+22l0nRPFiY2KOwcODCgEjlW cyZyQWH3Ly++Yd1b8YPK86UrH6e0vCu6RzJl9LE2giAUnRjh5H5INh9LteO9+31CW4pe BzhW9DcBXlxfQNgDmNmJdF9+OfZpEgPPnqYPs=
The failing test fail in 32 bit mode and it is related to the
alignment test of Map. It is so cryptic, that I don't get what is
going on.
ei_assert(EIGEN_IMPLIES(ei_traits<Derived>::Flags&AlignedBit,
(size_t(m_data)&(sizeof(Scalar)*ei_packet_traits<Scalar>::size-1))==0)
&& "data is not aligned");
How about a simple
ei_assert(EIGEN_IMPLIES(ei_traits<Derived>::Flags&AlignedBit,
((size_t)m_data % 16 ==0)) && "data is not aligned");
Just wondering?
- Hauke
On Tue, Aug 17, 2010 at 5:08 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> On Tue, Aug 17, 2010 at 3:26 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>> Note that since the only values that will ever be used are 1,2,Dynamic, we
>> could also make typedefs for them, so that in 99.9% of cases one wouldn't
>> need the template keyword.
>
> good point. Moreover, with the current cost model, it is enough to
> expose only the cases where N==1 and N==Dynamic. Even for the simplest
> expression 2*m, if N=2, then it gets evaluated.
>
> Of course, to be future proof it would still make sense to expose the
> N=2 case but others are really useless, so what about defining only
> the following three types (without the generic template one):
>
> typedef typename ei_nested<Derived,1>::type Nested;
> typedef typename ei_nested<Derived,2>::type NestedForTwoAccess;
> typedef typename ei_nested<Derived,Dynamic>::type NestedForMultipleAccess;
>
>
> alternative names: NestedOnce, NestedTwice, NestedManyTimes ???
>
> gael
>
>
>