Re: [eigen] new tutorial on writing functions taking Eigen types as paramters

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


Oh man - posted on the wrong thread. Sorry.

- Hauke

On Tue, Aug 17, 2010 at 5:23 PM, Hauke Heibel
<hauke.heibel@xxxxxxxxxxxxxx> wrote:
> 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
>>
>>
>>
>



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