Re: [eigen] Mapping array of scalars into quaternions |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Mapping array of scalars into quaternions*From*: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>*Date*: Mon, 26 Oct 2009 19:15:31 -0400*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hZwRqbpojFo1RwBdoGpOj8YDxOaC7YEYjtKQsxWaaOo=; b=QzITrR951ziDwRgTjZTJ0ha0LXGDbOcKE1Sz7d7FZOZl8H652oNEiIlyZNRd/kA/3D Lw2C3pi1ofKfMCrQrE99LEjirjRcaKIm0cY3uMQP8QQQpJGREtt3BWusZKpAURPohVWM 4cF6oqV4D6uAxi2hkCxjOVuiuIhNAB/8+0zgA=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Ikn/GpA5EJSdDaBGRABr50ihf6HFQD+zo7FULvFLb0i3nEusriCMCAdlKlur/sRri+ N2yVKL1muyUXEYC5TFCJi6ZaGHscdO7wOI8Yd6UtRFsHS3xfrczMWDl51IwZ+ZGdBasT 1H10bnXeNN7+7YlkZiL0dcBdIaj02ay+eagZ0=

+1 ! 2009/10/26 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>: > > Sorry I don't have much time to follow this development, but it seems that > in the current patch QuaternionWrapper would be only to map a float* (or > double*) as a Quaternion, right ? while other uses of "Wrapper" are to to > wrap any expressions (including a Map<>) as something else (e.g. a > DiagonalMatrix). > > So instead of QuaternionWrapper, what about using a specialization of Map > for Quaternion: > > template<typename _Scalar, int Alignment> > class Map<Quaternion<_Scalar>, Alignment> : public QuaternionBase<...> > { > // current QuaternionWrapper's code goes here > }; > > User code would look like: > > float data[4]; > Map<Quaternionf,Aligned> q(data); > > Maybe this look more natural ? > > From a practical point of view, this requires to change only 1 or 2 lines in > your patch. > > > > > Then in the future we could still re-introduce QuaternionWrapper to actually > wrap any expression as a Quaternion: > > template<XprType> class QuaternionWrapper : public QuaternionBase<...> > { > }; > > Though I don't think that such a QuaternionWrapper is really needed, perhaps > in the future... who knows. > > gael. > > > > On Mon, Oct 26, 2009 at 8:02 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> > wrote: >> >> 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 >> > >

**References**:**[eigen] Mapping array of scalars into quaternions***From:*Mathieu Gautier

**Re: [eigen] Mapping array of scalars into quaternions***From:*Gael Guennebaud

**Re: [eigen] Mapping array of scalars into quaternions***From:*Benoit Jacob

**Re: [eigen] Mapping array of scalars into quaternions***From:*Mathieu Gautier

**Re: [eigen] Mapping array of scalars into quaternions***From:*Benoit Jacob

**Re: [eigen] Mapping array of scalars into quaternions***From:*Mathieu Gautier

**Re: [eigen] Mapping array of scalars into quaternions***From:*Benoit Jacob

**Re: [eigen] Mapping array of scalars into quaternions***From:*Mathieu Gautier

**Re: [eigen] Mapping array of scalars into quaternions***From:*Benoit Jacob

**Re: [eigen] Mapping array of scalars into quaternions***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Mapping array of scalars into quaternions** - Next by Date:
**Re: [eigen] Skyline matrix** - Previous by thread:
**Re: [eigen] Mapping array of scalars into quaternions** - Next by thread:
**Re: [eigen] Mapping array of scalars into quaternions**

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