Re: [eigen] Mapping array of scalars into quaternions

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


2009/10/26 Mathieu Gautier <mathieu.gautier@xxxxxx>:
> Actually the multiplication of two quaternions is not vectorized? Are you
> refering to the version proposed by Rohit in the archives ?

it is, for float. Check the specialization in
Eigen/src/Geometry/arch/Geometry_SSE.h.

>
> As usual, I have some questions :) I don't understand the difference in your
> enum between :
>
>        enum { Unaligned=0, Aligned=1 };
> and     enum { AsRequested=0, EnforceAlignedAccess=2 };

See Gael's explanations in the other thread. Aligned means that you
certify that the pointer that you pass to Map will be aligned.That's
what you want. EnforceAlignedAccess is a different thing, it's
internal, ignore it.

>
> Aligned is used In map in test/map.cpp :
>
>        VectorType ma1 = Map<VectorType, Aligned>(array1, size);

So here we are saying "array1 is an aligned pointer, feel free to use
that information when vectorizing the code".

>
> and AsRequested is used in ForwardDeclarations.h as the default argument for
> PacketAccess.

Well AsRequested is 0 anyway. To make things clear the default
argument could be explicitly 0 as it is always important that default
values of bitfields be 0, regardless of what they mean, so that one
doesnt have to OR with the default value when one just wants to change
1 bit.

>
> Does it means that "AsRequested" and "Unaligned" are equivalent ?

This is a bit field, these 2 values represent the corresponding bit
being 0, but it's not the same bit.

> Because I
> am actually not comfortable how to use PacketAccess and which value to
> provide to QuaternionWrapper.

In case of an aligned pointer, pass Aligned to Map.
Otherwise, pass 0 to Map.

I havent yet checked your new patch. if you could send a unique
combined patch (see other mail) that would help. Also tell me if after
these answers there are changes that you want to make before i
reexamine the code.

Benoit



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