Re: [eigen] Eigen appears to rock. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen appears to rock.
- From: "Thomas Vaughan" <tevaughan@xxxxxxxxx>
- Date: Fri, 22 Aug 2008 11:49:10 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=dLZb2a16FMUbl1yHORjcX3k1yqm/qvuD2CQnqRnI21A=; b=IUC4gt+TwGD5F6Z5uEpivnilTQ/ptcmQFPdFa5pbRY/5Mj1HCtuFGsbfeSdg26yrhr XvZPGgPlVWsqLxQuTA+ZGRp6MuuZ8dy48+R/p1qVUMJlgxnTy7vSN/a4om8D5aFpErc+ eHERNNHr/8ZS29RkD9KR9B7tr0fAuWs7oGLz4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=lA69HCRDu7lfR/OyXAOiVILX73/91dGB2JbvbHwi3lbVziSdCNwUvUZ5rtPptzN5jK 2QjepF4L+jkk1MkqJWjQ63gGCMxV7JnKNmOPcKlEkW5wefrl7lnvENx5aTEjQriqHVlK bqiMmNErh3vzaCkc4R7Ve24bayxqKE2OHlxyI=
On Fri, Aug 22, 2008 at 7:09 AM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
>
> Thomas Vaughan wrote:
> >
> > > T.affine() is the 3x3 affine part of the above 4x4 matrix (it
> > > represents the rotation + scale + shear)
> >
> > This is a bit confusing because an affine transformation in general
> > combines a linear transformation and a translation. Perhaps it
> > might be better to make "T*p" be equal to "T.linear()*p +
> > T.translation()", where "T.linear()" returns the appropriate 3x3
> > block of the 4x4 inside T.
>
> this change has been done ;)
I just checked anonymous svn. All of the lower-case instances of
"affine" seem to have been replaced by "linear". But how about
something like the attached diff for the rest?
--
Thomas E. Vaughan
There are only two kinds of people; those who accept dogma and know it,
and those who accept dogma and don't know it. - G.K. Chesterton
Index: Transform.h
===================================================================
--- Transform.h (revision 850968)
+++ Transform.h (working copy)
@@ -66,9 +66,9 @@
/** type of the matrix used to represent the transformation */
typedef Matrix<Scalar,HDim,HDim> MatrixType;
/** type of the matrix used to represent the linear part of the transformation */
- typedef Matrix<Scalar,Dim,Dim> AffineMatrixType;
+ typedef Matrix<Scalar,Dim,Dim> LinearMatrixType;
/** type of read/write reference to the linear part of the transformation */
- typedef Block<MatrixType,Dim,Dim> AffinePart;
+ typedef Block<MatrixType,Dim,Dim> LinearPart;
/** type of a vector */
typedef Matrix<Scalar,Dim,1> VectorType;
/** type of a read/write reference to the translation part of the rotation */
@@ -111,9 +111,9 @@
inline MatrixType& matrix() { return m_matrix; }
/** \returns a read-only expression of the linear (linear) part of the transformation */
- inline const AffinePart linear() const { return m_matrix.template block<Dim,Dim>(0,0); }
+ inline const LinearPart linear() const { return m_matrix.template block<Dim,Dim>(0,0); }
/** \returns a writable expression of the linear (linear) part of the transformation */
- inline AffinePart linear() { return m_matrix.template block<Dim,Dim>(0,0); }
+ inline LinearPart linear() { return m_matrix.template block<Dim,Dim>(0,0); }
/** \returns a read-only expression of the translation vector of the transformation */
inline const TranslationPart translation() const { return m_matrix.template block<Dim,1>(0,Dim); }
@@ -162,8 +162,8 @@
Transform& shear(Scalar sx, Scalar sy);
Transform& preshear(Scalar sx, Scalar sy);
- AffineMatrixType extractRotation() const;
- AffineMatrixType extractRotationNoShear() const;
+ LinearMatrixType extractRotation() const;
+ LinearMatrixType extractRotationNoShear() const;
template<typename PositionDerived, typename OrientationType, typename ScaleDerived>
Transform& fromPositionOrientationScale(const MatrixBase<PositionDerived> &position,
@@ -349,7 +349,7 @@
Transform<Scalar,Dim>::preshear(Scalar sx, Scalar sy)
{
EIGEN_STATIC_ASSERT(int(Dim)==2, you_did_a_programming_error);
- m_matrix.template block<Dim,HDim>(0,0) = AffineMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
+ m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
return *this;
}
@@ -357,7 +357,7 @@
* \sa extractRotationNoShear(), class QR
*/
template<typename Scalar, int Dim>
-typename Transform<Scalar,Dim>::AffineMatrixType
+typename Transform<Scalar,Dim>::LinearMatrixType
Transform<Scalar,Dim>::extractRotation() const
{
return linear().qr().matrixQ();
@@ -368,7 +368,7 @@
* \sa extractRotation()
*/
template<typename Scalar, int Dim>
-typename Transform<Scalar,Dim>::AffineMatrixType
+typename Transform<Scalar,Dim>::LinearMatrixType
Transform<Scalar,Dim>::extractRotationNoShear() const
{
return linear().cwise().abs2()
@@ -421,7 +421,7 @@
{
typedef typename Other::Scalar Scalar;
typedef Transform<Scalar,Dim> TransformType;
- typedef typename TransformType::AffinePart MatrixType;
+ typedef typename TransformType::LinearPart MatrixType;
typedef const CwiseUnaryOp<
ei_scalar_multiple_op<Scalar>,
NestByValue<CwiseBinaryOp<