Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes | Friends | List of all members
Eigen::Transform Class Reference

Represents an homogeneous transformation in a N dimensional space. More...

#include <ForwardDeclarations.h>

Public Types

enum  { TransformTimeDiagonalMode = ((Mode==int(Isometry))?Affine:int(Mode)) }
 
typedef internal::conditional< int(Mode)==int(AffineCompact), MatrixType &, Block< MatrixType, Dim, HDim > >::type AffinePart
 
typedef internal::conditional< int(Mode)==int(AffineCompact), const MatrixType &, const Block< const MatrixType, Dim, HDim > >::type ConstAffinePart
 
typedef Eigen::Index Index
 
typedef Matrix< Scalar, Dim, Dim, Options > LinearMatrixType
 
typedef Block< MatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(int(Options)&RowMajor)==0 > LinearPart
 
typedef internal::make_proper_matrix_type< Scalar, Rows, HDim, Options >::type MatrixType
 
typedef internal::conditional< int(Mode)==Isometry, ConstLinearPart, const LinearMatrixType >::type RotationReturnType
 
typedef _Scalar Scalar
 
typedef Eigen::Index StorageIndex
 
typedef internal::transform_take_affine_part< Transformtake_affine_part
 
typedef Transform< Scalar, Dim, TransformTimeDiagonalModeTransformTimeDiagonalReturnType
 
typedef Block< MatrixType, Dim, 1,!(internal::traits< MatrixType >::Flags &RowMajorBit)> TranslationPart
 
typedef Translation< Scalar, Dim > TranslationType
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC AffinePart affine ()
 
EIGEN_DEVICE_FUNC ConstAffinePart affine () const
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Transform, Transform< NewScalarType, Dim, Mode, Options > >::type cast () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
template<typename RotationMatrixType , typename ScalingMatrixType >
EIGEN_DEVICE_FUNC void computeRotationScaling (RotationMatrixType *rotation, ScalingMatrixType *scaling) const
 
template<typename ScalingMatrixType , typename RotationMatrixType >
EIGEN_DEVICE_FUNC void computeScalingRotation (ScalingMatrixType *scaling, RotationMatrixType *rotation) const
 
EIGEN_DEVICE_FUNC Scalardata ()
 
const EIGEN_DEVICE_FUNC Scalardata () const
 
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE (_Scalar, _Dim==Dynamic ? Dynamic :(_Dim+1) *(_Dim+1)) enum
 
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC TransformfromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale)
 
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & fromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale)
 
EIGEN_DEVICE_FUNC Transform inverse (TransformTraits traits=(TransformTraits) Mode) const
 
EIGEN_DEVICE_FUNC bool isApprox (const Transform &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC LinearPart linear ()
 
EIGEN_DEVICE_FUNC ConstLinearPart linear () const
 
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > linearExt ()
 
const EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > linearExt () const
 
EIGEN_DEVICE_FUNC void makeAffine ()
 
EIGEN_DEVICE_FUNC MatrixTypematrix ()
 
const EIGEN_DEVICE_FUNC MatrixTypematrix () const
 
EIGEN_DEVICE_FUNC Scalaroperator() (Index row, Index col)
 
EIGEN_DEVICE_FUNC Scalar operator() (Index row, Index col) const
 
template<typename DiagonalDerived >
const EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType operator* (const DiagonalBase< DiagonalDerived > &b) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE internal::transform_right_product_impl< Transform, OtherDerived >::ResultType operator* (const EigenBase< OtherDerived > &other) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform operator* (const RotationBase< Derived, Dim > &r) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > operator* (const RotationBase< Derived, Dim > &r) const
 
const EIGEN_DEVICE_FUNC Transform operator* (const Transform &other) const
 
template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC internal::transform_transform_product_impl< Transform, Transform< Scalar, Dim, OtherMode, OtherOptions > >::ResultType operator* (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other) const
 
EIGEN_DEVICE_FUNC Transform operator* (const TranslationType &t) const
 
EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType operator* (const UniformScaling< Scalar > &s) const
 
EIGEN_DEVICE_FUNC Transformoperator*= (const DiagonalMatrix< Scalar, Dim > &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformoperator*= (const EigenBase< OtherDerived > &other)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transformoperator*= (const RotationBase< Derived, Dim > &r)
 
EIGEN_DEVICE_FUNC Transformoperator*= (const TranslationType &t)
 
EIGEN_DEVICE_FUNC Transformoperator*= (const UniformScaling< Scalar > &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformoperator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformoperator= (const ReturnByValue< OtherDerived > &other)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transformoperator= (const RotationBase< Derived, Dim > &r)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & operator= (const RotationBase< Derived, Dim > &r)
 
EIGEN_DEVICE_FUNC Transformoperator= (const TranslationType &t)
 
EIGEN_DEVICE_FUNC Transformoperator= (const UniformScaling< Scalar > &t)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transformprerotate (const RotationType &rotation)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & prerotate (const RotationType &rotation)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformprescale (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & prescale (const MatrixBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Transformprescale (const Scalar &s)
 
EIGEN_DEVICE_FUNC Transformpreshear (const Scalar &sx, const Scalar &sy)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformpretranslate (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & pretranslate (const MatrixBase< OtherDerived > &other)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transformrotate (const RotationType &rotation)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & rotate (const RotationType &rotation)
 
EIGEN_DEVICE_FUNC RotationReturnType rotation () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformscale (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & scale (const MatrixBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Transformscale (const Scalar &s)
 
EIGEN_DEVICE_FUNC void setIdentity ()
 
EIGEN_DEVICE_FUNC Transformshear (const Scalar &sx, const Scalar &sy)
 
EIGEN_DEVICE_FUNC Transform ()
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform (const ReturnByValue< OtherDerived > &other)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform (const RotationBase< Derived, Dim > &r)
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Transform (const Transform< OtherScalarType, Dim, Mode, Options > &other)
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC Transform (const Transform< Scalar, Dim, Mode, OtherOptions > &other)
 
template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC Transform (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other)
 
EIGEN_DEVICE_FUNC Transform (const TranslationType &t)
 
EIGEN_DEVICE_FUNC Transform (const UniformScaling< Scalar > &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformtranslate (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & translate (const MatrixBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC TranslationPart translation ()
 
EIGEN_DEVICE_FUNC ConstTranslationPart translation () const
 
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > translationExt ()
 
const EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > translationExt () const
 

Static Public Member Functions

static const EIGEN_DEVICE_FUNC Transform Identity ()
 Returns an identity transformation. More...
 

Public Attributes

const typedef Block< ConstMatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(int(Options)&RowMajor)==0 > ConstLinearPart
 
const typedef MatrixType ConstMatrixType
 
const typedef Block< ConstMatrixType, Dim, 1,!(internal::traits< MatrixType >::Flags &RowMajorBit)> ConstTranslationPart
 

Static Protected Member Functions

static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void check_template_params ()
 

Protected Attributes

MatrixType m_matrix
 

Friends

template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC friend TransformTimeDiagonalReturnType operator* (const DiagonalBase< DiagonalDerived > &a, const Transform &b)
 
template<typename OtherDerived >
const EIGEN_DEVICE_FUNC internal::transform_left_product_impl< OtherDerived, Mode, Options, _Dim, _Dim+1 >::ResultType operator* (const EigenBase< OtherDerived > &a, const Transform &b)
 

Detailed Description

Represents an homogeneous transformation in a N dimensional space.

\geometry_module

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients
_Dimthe dimension of the space
_Modethe type of the transformation. Can be:
  • Affine: the transformation is stored as a (Dim+1)^2 matrix, where the last row is assumed to be [0 ... 0 1].
  • AffineCompact: the transformation is stored as a (Dim)x(Dim+1) matrix.
  • Projective: the transformation is stored as a (Dim+1)^2 matrix without any assumption.
  • Isometry: same as Affine with the additional assumption that the linear part represents a rotation. This assumption is exploited to speed up some functions such as inverse() and rotation().
_Optionshas the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor. These Options are passed directly to the underlying matrix type.

The homography is internally represented and stored by a matrix which is available through the matrix() method. To understand the behavior of this class you have to think a Transform object as its internal matrix representation. The chosen convention is right multiply:

v' = T * v

Therefore, an affine transformation matrix M is shaped like this:

$ \left( \begin{array}{cc} linear & translation\\ 0 ... 0 & 1 \end{array} \right) $

Note that for a projective transformation the last row can be anything, and then the interpretation of different parts might be slightly different.

However, unlike a plain matrix, the Transform class provides many features simplifying both its assembly and usage. In particular, it can be composed with any other transformations (Transform,Translation,RotationBase,DiagonalMatrix) and can be directly used to transform implicit homogeneous vectors. All these operations are handled via the operator*. For the composition of transformations, its principle consists to first convert the right/left hand sides of the product to a compatible (Dim+1)^2 matrix and then perform a pure matrix product. Of course, internally, operator* tries to perform the minimal number of operations according to the nature of each terms. Likewise, when applying the transform to points, the latters are automatically promoted to homogeneous vectors before doing the matrix product. The conventions to homogeneous representations are performed as follow:

Translation t (Dim)x(1): $ \left( \begin{array}{cc} I & t \\ 0\,...\,0 & 1 \end{array} \right) $

Rotation R (Dim)x(Dim): $ \left( \begin{array}{cc} R & 0\\ 0\,...\,0 & 1 \end{array} \right) $

Scaling DiagonalMatrix S (Dim)x(Dim): $ \left( \begin{array}{cc} S & 0\\ 0\,...\,0 & 1 \end{array} \right) $

Column point v (Dim)x(1): $ \left( \begin{array}{c} v\\ 1 \end{array} \right) $

Set of column points V1...Vn (Dim)x(n): $ \left( \begin{array}{ccc} v_1 & ... & v_n\\ 1 & ... & 1 \end{array} \right) $

The concatenation of a Transform object with any kind of other transformation always returns a Transform object.

A little exception to the "as pure matrix product" rule is the case of the transformation of non homogeneous vectors by an affine transformation. In that case the last matrix row can be ignored, and the product returns non homogeneous vectors.

Since, for instance, a Dim x Dim matrix is interpreted as a linear transformation, it is not possible to directly transform Dim vectors stored in a Dim x Dim matrix. The solution is either to use a Dim x Dynamic matrix or explicitly request a vector transformation by making the vector homogeneous:

m' = T * m.colwise().homogeneous();

Note that there is zero overhead.

Conversion methods from/to Qt's QMatrix and QTransform are available if the preprocessor token EIGEN_QT_SUPPORT is defined.

This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_TRANSFORM_PLUGIN.

See also
class Matrix, class Quaternion

Definition at line 294 of file ForwardDeclarations.h.

Member Typedef Documentation

◆ AffinePart

type of read/write reference to the affine part of the transformation

Definition at line 232 of file Transform.h.

◆ ConstAffinePart

type of read reference to the affine part of the transformation

Definition at line 236 of file Transform.h.

◆ Index

Deprecated:
since Eigen 3.3

Definition at line 218 of file Transform.h.

◆ LinearMatrixType

type of the matrix used to represent the linear part of the transformation

Definition at line 224 of file Transform.h.

◆ LinearPart

typedef Block<MatrixType,Dim,Dim,int(Mode)==(AffineCompact) && (int(Options)&RowMajor)==0> Eigen::Transform::LinearPart

type of read/write reference to the linear part of the transformation

Definition at line 226 of file Transform.h.

◆ MatrixType

type of the matrix used to represent the transformation

Definition at line 220 of file Transform.h.

◆ RotationReturnType

Definition at line 599 of file Transform.h.

◆ Scalar

typedef _Scalar Eigen::Transform::Scalar

the scalar type of the coefficients

Definition at line 214 of file Transform.h.

◆ StorageIndex

Definition at line 217 of file Transform.h.

◆ take_affine_part

Definition at line 282 of file Transform.h.

◆ TransformTimeDiagonalReturnType

The return type of the product between a diagonal matrix and a transform

Definition at line 249 of file Transform.h.

◆ TranslationPart

type of a read/write reference to the translation part of the rotation

Definition at line 240 of file Transform.h.

◆ TranslationType

corresponding translation type

Definition at line 244 of file Transform.h.

◆ VectorType

type of a vector

Definition at line 238 of file Transform.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TransformTimeDiagonalMode 

Definition at line 247 of file Transform.h.

Constructor & Destructor Documentation

◆ Transform() [1/9]

EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( )
inline

Default constructor without initialization of the meaningful coefficients. If Mode==Affine or Mode==Isometry, then the last row is set to [0 ... 0 1]

Definition at line 259 of file Transform.h.

◆ Transform() [2/9]

EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const TranslationType t)
inlineexplicit

Definition at line 265 of file Transform.h.

◆ Transform() [3/9]

EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const UniformScaling< Scalar > &  s)
inlineexplicit

Definition at line 270 of file Transform.h.

◆ Transform() [4/9]

template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const RotationBase< Derived, Dim > &  r)
inlineexplicit

Definition at line 276 of file Transform.h.

◆ Transform() [5/9]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const EigenBase< OtherDerived > &  other)
inlineexplicit

Constructs and initializes a transformation from a Dim^2 or a (Dim+1)^2 matrix.

Definition at line 286 of file Transform.h.

◆ Transform() [6/9]

template<int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const Transform< Scalar, Dim, Mode, OtherOptions > &  other)
inline

Definition at line 307 of file Transform.h.

◆ Transform() [7/9]

template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const Transform< Scalar, Dim, OtherMode, OtherOptions > &  other)
inline

Definition at line 315 of file Transform.h.

◆ Transform() [8/9]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const ReturnByValue< OtherDerived > &  other)
inline

Definition at line 356 of file Transform.h.

◆ Transform() [9/9]

template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Eigen::Transform::Transform ( const Transform< OtherScalarType, Dim, Mode, Options > &  other)
inlineexplicit

Copy constructor with scalar type conversion

Definition at line 633 of file Transform.h.

Member Function Documentation

◆ affine() [1/2]

EIGEN_DEVICE_FUNC AffinePart Eigen::Transform::affine ( )
inline
Returns
a writable expression of the Dim x HDim affine part of the transformation

Definition at line 401 of file Transform.h.

◆ affine() [2/2]

EIGEN_DEVICE_FUNC ConstAffinePart Eigen::Transform::affine ( ) const
inline
Returns
a read-only expression of the Dim x HDim affine part of the transformation

Definition at line 399 of file Transform.h.

◆ cast()

template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type<Transform,Transform<NewScalarType,Dim,Mode,Options> >::type Eigen::Transform::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

Definition at line 628 of file Transform.h.

◆ check_template_params()

static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::Transform::check_template_params ( )
inlinestaticprotected

Definition at line 686 of file Transform.h.

◆ cols()

EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::Transform::cols ( ) const
inline

Definition at line 379 of file Transform.h.

◆ computeRotationScaling()

template<typename RotationMatrixType , typename ScalingMatrixType >
EIGEN_DEVICE_FUNC void Eigen::Transform::computeRotationScaling ( RotationMatrixType *  rotation,
ScalingMatrixType *  scaling 
) const

decomposes the linear part of the transformation as a product rotation x scaling, the scaling being not necessarily positive.

If either pointer is zero, the corresponding computation is skipped.

\svd_module

See also
computeScalingRotation(), rotation(), class SVD

Definition at line 1098 of file Transform.h.

◆ computeScalingRotation()

template<typename ScalingMatrixType , typename RotationMatrixType >
EIGEN_DEVICE_FUNC void Eigen::Transform::computeScalingRotation ( ScalingMatrixType *  scaling,
RotationMatrixType *  rotation 
) const

decomposes the linear part of the transformation as a product scaling x rotation, the scaling being not necessarily positive.

If either pointer is zero, the corresponding computation is skipped.

\svd_module

See also
computeRotationScaling(), rotation(), class SVD

Definition at line 1128 of file Transform.h.

◆ data() [1/2]

EIGEN_DEVICE_FUNC Scalar* Eigen::Transform::data ( )
inline
Returns
a non-const pointer to the column major internal matrix

Definition at line 620 of file Transform.h.

◆ data() [2/2]

const EIGEN_DEVICE_FUNC Scalar* Eigen::Transform::data ( ) const
inline
Returns
a const pointer to the column major internal matrix

Definition at line 618 of file Transform.h.

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE()

Eigen::Transform::EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE ( _Scalar  ,
_Dim  = =Dynamic ? Dynamic : (_Dim+1)*(_Dim+1) 
)
inline

< space dimension in which the transformation holds

< size of a respective homogeneous vector

Definition at line 207 of file Transform.h.

◆ fromPositionOrientationScale() [1/2]

template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::fromPositionOrientationScale ( const MatrixBase< PositionDerived > &  position,
const OrientationType &  orientation,
const MatrixBase< ScaleDerived > &  scale 
)

◆ fromPositionOrientationScale() [2/2]

template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::fromPositionOrientationScale ( const MatrixBase< PositionDerived > &  position,
const OrientationType &  orientation,
const MatrixBase< ScaleDerived > &  scale 
)

Convenient method to set *this from a position, orientation and scale of a 3D object.

Definition at line 1151 of file Transform.h.

◆ Identity()

static const EIGEN_DEVICE_FUNC Transform Eigen::Transform::Identity ( )
inlinestatic

Returns an identity transformation.

Todo:
In the future this function should be returning a Transform expression.

Definition at line 533 of file Transform.h.

◆ inverse()

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > Eigen::Transform::inverse ( TransformTraits  hint = (TransformTraits)Mode) const
inline
Returns
the inverse transformation according to some given knowledge on *this.
Parameters
hintallows to optimize the inversion process when the transformation is known to be not a general transformation (optional). The possible values are:
  • Projective if the transformation is not necessarily affine, i.e., if the last row is not guaranteed to be [0 ... 0 1]
  • Affine if the last row can be assumed to be [0 ... 0 1]
  • Isometry if the transformation is only a concatenations of translations and rotations. The default is the template class parameter Mode.
Warning
unless traits is always set to NoShear or NoScaling, this function requires the generic inverse method of MatrixBase defined in the LU module. If you forget to include this module, then you will get hard to debug linking errors.
See also
MatrixBase::inverse()

Definition at line 1223 of file Transform.h.

◆ isApprox()

EIGEN_DEVICE_FUNC bool Eigen::Transform::isApprox ( const Transform other,
const typename NumTraits< Scalar >::Real prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()

Definition at line 643 of file Transform.h.

◆ linear() [1/2]

EIGEN_DEVICE_FUNC LinearPart Eigen::Transform::linear ( )
inline
Returns
a writable expression of the linear part of the transformation

Definition at line 396 of file Transform.h.

◆ linear() [2/2]

EIGEN_DEVICE_FUNC ConstLinearPart Eigen::Transform::linear ( ) const
inline
Returns
a read-only expression of the linear part of the transformation

Definition at line 394 of file Transform.h.

◆ linearExt() [1/2]

EIGEN_DEVICE_FUNC Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,Dim> Eigen::Transform::linearExt ( )
inline

Definition at line 657 of file Transform.h.

◆ linearExt() [2/2]

const EIGEN_DEVICE_FUNC Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,Dim> Eigen::Transform::linearExt ( ) const
inline

Definition at line 663 of file Transform.h.

◆ makeAffine()

EIGEN_DEVICE_FUNC void Eigen::Transform::makeAffine ( )
inline

Sets the last row to [0 ... 0 1]

Definition at line 648 of file Transform.h.

◆ matrix() [1/2]

EIGEN_DEVICE_FUNC MatrixType& Eigen::Transform::matrix ( )
inline
Returns
a writable expression of the transformation matrix

Definition at line 391 of file Transform.h.

◆ matrix() [2/2]

const EIGEN_DEVICE_FUNC MatrixType& Eigen::Transform::matrix ( ) const
inline
Returns
a read-only expression of the transformation matrix

Definition at line 389 of file Transform.h.

◆ operator()() [1/2]

EIGEN_DEVICE_FUNC Scalar& Eigen::Transform::operator() ( Index  row,
Index  col 
)
inline

shortcut for m_matrix(row,col);

See also
MatrixBase::operator(Index,Index)

Definition at line 386 of file Transform.h.

◆ operator()() [2/2]

EIGEN_DEVICE_FUNC Scalar Eigen::Transform::operator() ( Index  row,
Index  col 
) const
inline

shortcut for m_matrix(row,col);

See also
MatrixBase::operator(Index,Index) const

Definition at line 383 of file Transform.h.

◆ operator*() [1/8]

template<typename DiagonalDerived >
const EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType Eigen::Transform::operator* ( const DiagonalBase< DiagonalDerived > &  b) const
inline
Returns
The product expression of a transform a times a diagonal matrix b

The rhs diagonal matrix is interpreted as an affine scaling transformation. The product results in a Transform of the same type (mode) as the lhs only if the lhs mode is no isometry. In that case, the returned transform is an affinity.

Definition at line 458 of file Transform.h.

◆ operator*() [2/8]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE internal::transform_right_product_impl<Transform, OtherDerived>::ResultType Eigen::Transform::operator* ( const EigenBase< OtherDerived > &  other) const
inline
Returns
an expression of the product between the transform *this and a matrix expression other.

The right-hand-side other can be either:

  • an homogeneous vector of size Dim+1,
  • a set of homogeneous vectors of size Dim+1 x N,
  • a transformation matrix of size Dim+1 x Dim+1.

Moreover, if *this represents an affine transformation (i.e., Mode!=Projective), then other can also be:

In all cases, the return type is a matrix or vector of same sizes as the right-hand-side other.

If you want to interpret other as a linear or affine transformation, then first convert it to a Transform<> type, or do your own cooking.

Finally, if you want to apply Affine transformations to vectors, then explicitly apply the linear part only:

Vector3f v1, v2;
v2 = A.linear() * v1;

Definition at line 435 of file Transform.h.

◆ operator*() [3/8]

template<typename Derived >
EIGEN_DEVICE_FUNC Transform Eigen::Transform::operator* ( const RotationBase< Derived, Dim > &  r) const
inline

◆ operator*() [4/8]

template<typename Derived >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options> Eigen::Transform::operator* ( const RotationBase< Derived, Dim > &  r) const
inline

Definition at line 1034 of file Transform.h.

◆ operator*() [5/8]

const EIGEN_DEVICE_FUNC Transform Eigen::Transform::operator* ( const Transform other) const
inline

Concatenates two transformations

Definition at line 487 of file Transform.h.

◆ operator*() [6/8]

template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> >::ResultType Eigen::Transform::operator* ( const Transform< Scalar, Dim, OtherMode, OtherOptions > &  other) const
inline

Concatenates two different transformations

Definition at line 520 of file Transform.h.

◆ operator*() [7/8]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > Eigen::Transform::operator* ( const TranslationType t) const
inline

Definition at line 1006 of file Transform.h.

◆ operator*() [8/8]

EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType Eigen::Transform::operator* ( const UniformScaling< Scalar > &  s) const
inline

Definition at line 582 of file Transform.h.

◆ operator*=() [1/5]

EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator*= ( const DiagonalMatrix< Scalar, Dim > &  s)
inline

Definition at line 590 of file Transform.h.

◆ operator*=() [2/5]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator*= ( const EigenBase< OtherDerived > &  other)
inline

Definition at line 484 of file Transform.h.

◆ operator*=() [3/5]

template<typename Derived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator*= ( const RotationBase< Derived, Dim > &  r)
inline

Definition at line 595 of file Transform.h.

◆ operator*=() [4/5]

EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator*= ( const TranslationType t)
inline

Definition at line 571 of file Transform.h.

◆ operator*=() [5/5]

EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator*= ( const UniformScaling< Scalar > &  s)
inline

Definition at line 579 of file Transform.h.

◆ operator=() [1/6]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator= ( const EigenBase< OtherDerived > &  other)
inline

Set *this from a Dim^2 or (Dim+1)^2 matrix.

Definition at line 297 of file Transform.h.

◆ operator=() [2/6]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator= ( const ReturnByValue< OtherDerived > &  other)
inline

Definition at line 363 of file Transform.h.

◆ operator=() [3/6]

template<typename Derived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator= ( const RotationBase< Derived, Dim > &  r)
inline

◆ operator=() [4/6]

template<typename Derived >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::operator= ( const RotationBase< Derived, Dim > &  r)
inline

Definition at line 1024 of file Transform.h.

◆ operator=() [5/6]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform::operator= ( const TranslationType t)
inline

Definition at line 997 of file Transform.h.

◆ operator=() [6/6]

EIGEN_DEVICE_FUNC Transform& Eigen::Transform::operator= ( const UniformScaling< Scalar > &  t)
inline

◆ prerotate() [1/2]

template<typename RotationType >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::prerotate ( const RotationType &  rotation)
inline

◆ prerotate() [2/2]

template<typename RotationType >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::prerotate ( const RotationType &  rotation)

Applies on the left the rotation represented by the rotation rotation to *this and returns a reference to *this.

See rotate() for further details.

See also
rotate()

Definition at line 954 of file Transform.h.

◆ prescale() [1/3]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::prescale ( const MatrixBase< OtherDerived > &  other)
inline

◆ prescale() [2/3]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::prescale ( const MatrixBase< OtherDerived > &  other)

Applies on the left the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.

See also
scale()

Definition at line 867 of file Transform.h.

◆ prescale() [3/3]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform::prescale ( const Scalar s)
inline

Applies on the left a uniform scale of a factor c to *this and returns a reference to *this.

See also
scale(Scalar)

Definition at line 880 of file Transform.h.

◆ preshear()

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform::preshear ( const Scalar sx,
const Scalar sy 
)

Applies on the left the shear transformation represented by the vector other to *this and returns a reference to *this.

Warning
2D only.
See also
shear()

Definition at line 984 of file Transform.h.

◆ pretranslate() [1/2]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::pretranslate ( const MatrixBase< OtherDerived > &  other)
inline

◆ pretranslate() [2/2]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::pretranslate ( const MatrixBase< OtherDerived > &  other)

Applies on the left the translation matrix represented by the vector other to *this and returns a reference to *this.

See also
translate()

Definition at line 908 of file Transform.h.

◆ rotate() [1/2]

template<typename RotationType >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::rotate ( const RotationType &  rotation)
inline

◆ rotate() [2/2]

template<typename RotationType >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::rotate ( const RotationType &  rotation)

Applies on the right the rotation represented by the rotation rotation to *this and returns a reference to *this.

The template parameter RotationType is the type of the rotation which must be known by internal::toRotationMatrix<>.

Natively supported types includes:

This mechanism is easily extendable to support user types such as Euler angles, or a pair of Quaternion for 4D rotations.

See also
rotate(Scalar), class Quaternion, class AngleAxis, prerotate(RotationType)

Definition at line 938 of file Transform.h.

◆ rotation()

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options >::RotationReturnType Eigen::Transform::rotation ( ) const
Returns
the rotation part of the transformation

If Mode==Isometry, then this method is an alias for linear(), otherwise it calls computeRotationScaling() to extract the rotation through a SVD decomposition.

\svd_module

See also
computeRotationScaling(), computeScalingRotation(), class SVD

Definition at line 1079 of file Transform.h.

◆ rows()

EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::Transform::rows ( ) const
inline

Definition at line 378 of file Transform.h.

◆ scale() [1/3]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::scale ( const MatrixBase< OtherDerived > &  other)
inline

◆ scale() [2/3]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::scale ( const MatrixBase< OtherDerived > &  other)

Applies on the right the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.

See also
prescale()

Definition at line 840 of file Transform.h.

◆ scale() [3/3]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform::scale ( const Scalar s)
inline

Applies on the right a uniform scale of a factor c to *this and returns a reference to *this.

See also
prescale(Scalar)

Definition at line 853 of file Transform.h.

◆ setIdentity()

EIGEN_DEVICE_FUNC void Eigen::Transform::setIdentity ( )
inline
See also
MatrixBase::setIdentity()

Definition at line 527 of file Transform.h.

◆ shear()

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform::shear ( const Scalar sx,
const Scalar sy 
)

Applies on the right the shear transformation represented by the vector other to *this and returns a reference to *this.

Warning
2D only.
See also
preshear()

Definition at line 968 of file Transform.h.

◆ translate() [1/2]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform::translate ( const MatrixBase< OtherDerived > &  other)
inline

◆ translate() [2/2]

template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode,Options>& Eigen::Transform::translate ( const MatrixBase< OtherDerived > &  other)

Applies on the right the translation matrix represented by the vector other to *this and returns a reference to *this.

See also
pretranslate()

Definition at line 894 of file Transform.h.

◆ translation() [1/2]

EIGEN_DEVICE_FUNC TranslationPart Eigen::Transform::translation ( )
inline
Returns
a writable expression of the translation vector of the transformation

Definition at line 406 of file Transform.h.

◆ translation() [2/2]

EIGEN_DEVICE_FUNC ConstTranslationPart Eigen::Transform::translation ( ) const
inline
Returns
a read-only expression of the translation vector of the transformation

Definition at line 404 of file Transform.h.

◆ translationExt() [1/2]

EIGEN_DEVICE_FUNC Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,1> Eigen::Transform::translationExt ( )
inline

Definition at line 670 of file Transform.h.

◆ translationExt() [2/2]

const EIGEN_DEVICE_FUNC Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,1> Eigen::Transform::translationExt ( ) const
inline

Definition at line 676 of file Transform.h.

Friends And Related Function Documentation

◆ operator* [1/2]

template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC friend TransformTimeDiagonalReturnType operator* ( const DiagonalBase< DiagonalDerived > &  a,
const Transform b 
)
friend
Returns
The product expression of a diagonal matrix a times a transform b

The lhs diagonal matrix is interpreted as an affine scaling transformation. The product results in a Transform of the same type (mode) as the lhs only if the lhs mode is no isometry. In that case, the returned transform is an affinity.

Definition at line 473 of file Transform.h.

◆ operator* [2/2]

template<typename OtherDerived >
const EIGEN_DEVICE_FUNC internal::transform_left_product_impl<OtherDerived,Mode,Options,_Dim,_Dim+1>::ResultType operator* ( const EigenBase< OtherDerived > &  a,
const Transform b 
)
friend
Returns
the product expression of a transformation matrix a times a transform b

The left hand side other can be either:

  • a linear transformation matrix of size Dim x Dim,
  • an affine transformation matrix of size Dim x Dim+1,
  • a general transformation matrix of size Dim+1 x Dim+1.

Definition at line 447 of file Transform.h.

Member Data Documentation

◆ ConstLinearPart

const typedef Block<ConstMatrixType,Dim,Dim,int(Mode)==(AffineCompact) && (int(Options)&RowMajor)==0> Eigen::Transform::ConstLinearPart

type of read reference to the linear part of the transformation

Definition at line 228 of file Transform.h.

◆ ConstMatrixType

const typedef MatrixType Eigen::Transform::ConstMatrixType

constified MatrixType

Definition at line 222 of file Transform.h.

◆ ConstTranslationPart

const typedef Block<ConstMatrixType,Dim,1,!(internal::traits<MatrixType>::Flags & RowMajorBit)> Eigen::Transform::ConstTranslationPart

type of a read reference to the translation part of the rotation

Definition at line 242 of file Transform.h.

◆ m_matrix

MatrixType Eigen::Transform::m_matrix
protected

Definition at line 253 of file Transform.h.


The documentation for this class was generated from the following files:
Eigen::Transform::linear
EIGEN_DEVICE_FUNC ConstLinearPart linear() const
Definition: Transform.h:394
Eigen::Affine3f
Transform< float, 3, Affine > Affine3f
Definition: Transform.h:706
A
Definition: test_numpy_dtypes.cpp:298
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
Eigen::Transform::translation
EIGEN_DEVICE_FUNC ConstTranslationPart translation() const
Definition: Transform.h:404
v2
Vector v2
Definition: testSerializationBase.cpp:39
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
v1
Vector v1
Definition: testSerializationBase.cpp:38


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:12:53