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: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 26 Oct 2009 22:26:10 +0100
- 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; bh=3diaWovEtZ8jLzBRbJTgMJgvNfSAhGZnDTBnC/Bwzgo=; b=FG9Kb2YCRMB+I6KnElsHlMU5RJaUUrTrA6SeHZpLxVnG1t3r5ascpP++Hvi8RH9XEt Da6HbRjHedJmYACDP24nbMpfg7aqMjVRZuHhUrAbd/TxlDjH7+Y/hoFCveKqDUNw4l8o LMxZrceYOP2/xfPaO8wSoDZ47G5R2O26uU6Vk=
- 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; b=TY8Z81DG+CaLoSKu79WF0l42kbC0qPaJr49IkyPSl/EgkZqnVMKAL787SmwimLwsV8 DuOKhAxwvUvh/lZvinQENjGsrVaMd4PGPr5VpzJT//vL67SCZbkrvNH2XTihL91ZTcHU Z0Y6fdiXvhJrFZrGYrrN6LEZlyaLnZPgQW4U8=
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 ?