Eigen::Transform< Scalar_, Dim_, Mode_, Options_ > Class Template Reference

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

#include <Transform.h>

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Static Protected Member Functions

static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void check_template_params ()
 

Protected Attributes

MatrixType m_matrix
 

Friends

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

Detailed Description

template<typename Scalar_, int Dim_, int Mode_, int Options_>
class Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >

Represents an homogeneous transformation in a N dimensional space.

\geometry_module

Template Parameters
Scalar_the scalar type, i.e., the type of the coefficients
Dim_the dimension of the space
Mode_the 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().
Options_has 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
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1

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();
int * m
Definition: level2_cplx_impl.h:294

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

Member Typedef Documentation

◆ AffinePart

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef std::conditional_t<int(Mode) == int(AffineCompact), MatrixType&, Block<MatrixType, Dim, HDim> > Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::AffinePart

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

◆ ConstAffinePart

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef std::conditional_t<int(Mode) == int(AffineCompact), const MatrixType&, const Block<const MatrixType, Dim, HDim> > Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::ConstAffinePart

type of read reference to the affine part of the transformation

◆ ConstLinearPart

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef const Block<ConstMatrixType, Dim, Dim, int(Mode) == (AffineCompact) && (int(Options) & RowMajor) == 0> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::ConstLinearPart

type of read reference to the linear part of the transformation

◆ ConstMatrixType

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef const MatrixType Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::ConstMatrixType

constified MatrixType

◆ ConstTranslationPart

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef const Block<ConstMatrixType, Dim, 1, !(internal::traits<MatrixType>::Flags & RowMajorBit)> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::ConstTranslationPart

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

◆ Index

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Eigen::Index Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Index
Deprecated:
since Eigen 3.3

◆ LinearMatrixType

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Matrix<Scalar, Dim, Dim, Options> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::LinearMatrixType

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

◆ LinearPart

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Block<MatrixType, Dim, Dim, int(Mode) == (AffineCompact) && (int(Options) & RowMajor) == 0> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::LinearPart

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

◆ MatrixType

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef internal::make_proper_matrix_type<Scalar, Rows, HDim, Options>::type Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::MatrixType

type of the matrix used to represent the transformation

◆ RotationReturnType

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef std::conditional_t<int(Mode) == Isometry, ConstLinearPart, const LinearMatrixType> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::RotationReturnType

◆ Scalar

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Scalar_ Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Scalar

the scalar type of the coefficients

◆ StorageIndex

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Eigen::Index Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::StorageIndex

◆ take_affine_part

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef internal::transform_take_affine_part<Transform> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::take_affine_part

◆ TransformTimeDiagonalReturnType

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Transform<Scalar, Dim, TransformTimeDiagonalMode> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::TransformTimeDiagonalReturnType

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

◆ TranslationPart

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Block<MatrixType, Dim, 1, !(internal::traits<MatrixType>::Flags & RowMajorBit)> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::TranslationPart

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

◆ TranslationType

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Translation<Scalar, Dim> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::TranslationType

corresponding translation type

◆ VectorType

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
typedef Matrix<Scalar, Dim, 1> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::VectorType

type of a vector

Member Enumeration Documentation

◆ anonymous enum

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
anonymous enum
Enumerator
TransformTimeDiagonalMode 
235 { TransformTimeDiagonalMode = ((Mode == int(Isometry)) ? Affine : int(Mode)) };
@ TransformTimeDiagonalMode
Definition: Transform.h:235
@ Affine
Definition: Constants.h:458
@ Isometry
Definition: Constants.h:455
return int(ret)+1

Constructor & Destructor Documentation

◆ Transform() [1/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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]

245  {
247  internal::transform_make_affine<(int(Mode) == Affine || int(Mode) == Isometry) ? Affine : AffineCompact>::run(
248  m_matrix);
249  }
MatrixType m_matrix
Definition: Transform.h:240
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void check_template_params()
Definition: Transform.h:664
@ AffineCompact
Definition: Constants.h:460
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414

References Eigen::Affine, Eigen::AffineCompact, Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::check_template_params(), int(), Eigen::Isometry, Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix, and Eigen::run().

Referenced by Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Identity().

◆ Transform() [2/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const TranslationType t)
inlineexplicit
251  {
253  *this = t;
254  }
t
Definition: plotPSD.py:36

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::check_template_params(), and plotPSD::t.

◆ Transform() [3/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const UniformScaling< Scalar > &  s)
inlineexplicit
255  {
257  *this = s;
258  }
RealScalar s
Definition: level1_cplx_impl.h:130

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::check_template_params(), and s.

◆ Transform() [4/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const RotationBase< Derived, Dim > &  r)
inlineexplicit
260  {
262  *this = r;
263  }
r
Definition: UniformPSDSelfTest.py:20

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::check_template_params(), and UniformPSDSelfTest::r.

◆ Transform() [5/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const EigenBase< OtherDerived > &  other)
inlineexplicit

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

269  {
272  YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
273 
276  }
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
@ value
Definition: Meta.h:206
void run(const string &dir_name, LinearSolver *linear_solver_pt, const unsigned nel_1d, bool mess_up_order)
Definition: two_d_poisson_compare_solvers.cc:317

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::check_template_params(), Eigen::EigenBase< Derived >::derived(), EIGEN_STATIC_ASSERT, and run().

◆ Transform() [6/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const Transform< Scalar, Dim, Mode, OtherOptions > &  other)
inline

◆ Transform() [7/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const Transform< Scalar, Dim, OtherMode, OtherOptions > &  other)
inline
297  {
299  // prevent conversions as:
300  // Affine | AffineCompact | Isometry = Projective
301  EIGEN_STATIC_ASSERT(internal::check_implication(OtherMode == int(Projective), Mode == int(Projective)),
302  YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
303 
304  // prevent conversions as:
305  // Isometry = Affine | AffineCompact
307  internal::check_implication(OtherMode == int(Affine) || OtherMode == int(AffineCompact), Mode != int(Isometry)),
308  YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
309 
310  enum {
311  ModeIsAffineCompact = Mode == int(AffineCompact),
312  OtherModeIsAffineCompact = OtherMode == int(AffineCompact)
313  };
314 
315  if (EIGEN_CONST_CONDITIONAL(ModeIsAffineCompact == OtherModeIsAffineCompact)) {
316  // We need the block expression because the code is compiled for all
317  // combinations of transformations and will trigger a compile time error
318  // if one tries to assign the matrices directly
319  m_matrix.template block<Dim, Dim + 1>(0, 0) = other.matrix().template block<Dim, Dim + 1>(0, 0);
320  makeAffine();
321  } else if (EIGEN_CONST_CONDITIONAL(OtherModeIsAffineCompact)) {
322  typedef typename Transform<Scalar, Dim, OtherMode, OtherOptions>::MatrixType OtherMatrixType;
324  } else {
325  // here we know that Mode == AffineCompact and OtherMode != AffineCompact.
326  // if OtherMode were Projective, the static assert above would already have caught it.
327  // So the only possibility is that OtherMode == Affine
328  linear() = other.linear();
329  translation() = other.translation();
330  }
331  }
#define EIGEN_CONST_CONDITIONAL(cond)
Definition: Macros.h:1060
internal::make_proper_matrix_type< Scalar, Rows, HDim, Options >::type MatrixType
Definition: Transform.h:208
EIGEN_DEVICE_FUNC void makeAffine()
Definition: Transform.h:625
EIGEN_DEVICE_FUNC ConstTranslationPart translation() const
Definition: Transform.h:384
EIGEN_DEVICE_FUNC ConstLinearPart linear() const
Definition: Transform.h:374
@ Projective
Definition: Constants.h:462
constexpr bool check_implication(bool a, bool b)
Definition: Meta.h:740

References Eigen::Affine, Eigen::AffineCompact, Eigen::internal::check_implication(), Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::check_template_params(), EIGEN_CONST_CONDITIONAL, EIGEN_STATIC_ASSERT, int(), Eigen::Isometry, Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::linear(), Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix, Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::makeAffine(), Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::matrix(), Eigen::Projective, run(), and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::translation().

◆ Transform() [8/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const ReturnByValue< OtherDerived > &  other)
inline

◆ Transform() [9/9]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform ( const Transform< OtherScalarType, Dim, Mode, Options > &  other)
inlineexplicit

Member Function Documentation

◆ affine() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC AffinePart Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::affine ( )
inline
Returns
a writable expression of the Dim x HDim affine part of the transformation
381 { return take_affine_part::run(m_matrix); }
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE AffinePart run(MatrixType &m)
Definition: Transform.h:1202

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix, and Eigen::internal::transform_take_affine_part< TransformType >::run().

◆ affine() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC ConstAffinePart Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::affine ( ) const
inline
Returns
a read-only expression of the Dim x HDim affine part of the transformation
379 { return take_affine_part::run(m_matrix); }

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix, and Eigen::internal::transform_take_affine_part< TransformType >::run().

Referenced by homogeneous().

◆ cast()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type<Transform, Transform<NewScalarType, Dim, Mode, Options> >::type Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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.

603  {
604  return typename internal::cast_return_type<Transform, Transform<NewScalarType, Dim, Mode, Options> >::type(*this);
605  }
type
Definition: compute_granudrum_aor.py:141

References compute_granudrum_aor::type.

◆ check_template_params()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::check_template_params ( )
inlinestaticprotected
664  {
665  EIGEN_STATIC_ASSERT((Options & (DontAlign | RowMajor)) == Options, INVALID_MATRIX_TEMPLATE_PARAMETERS)
666  }
@ DontAlign
Definition: Constants.h:324
@ RowMajor
Definition: Constants.h:320

References Eigen::DontAlign, EIGEN_STATIC_ASSERT, and Eigen::RowMajor.

Referenced by Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform().

◆ cols()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::cols ( ) const
inline

◆ computeRotationScaling()

template<typename Scalar , int Dim, int Mode, int Options>
template<typename RotationMatrixType , typename ScalingMatrixType >
EIGEN_DEVICE_FUNC void Eigen::Transform< Scalar, Dim, Mode, Options >::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
1053  {
1054  // Note that JacobiSVD is faster than BDCSVD for small matrices.
1055  JacobiSVD<LinearMatrixType, ComputeFullU | ComputeFullV> svd(linear());
1056 
1057  Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant() < Scalar(0)
1058  ? Scalar(-1)
1059  : Scalar(1); // so x has absolute value 1
1060  VectorType sv(svd.singularValues());
1061  sv.coeffRef(Dim - 1) *= x;
1062  if (scaling) *scaling = svd.matrixV() * sv.asDiagonal() * svd.matrixV().adjoint();
1063  if (rotation) {
1064  LinearMatrixType m(svd.matrixU());
1065  m.col(Dim - 1) *= x;
1066  *rotation = m * svd.matrixV().adjoint();
1067  }
1068 }
cout<< "Here is the matrix m:"<< endl<< m<< endl;JacobiSVD< MatrixXf, ComputeThinU|ComputeThinV > svd(m)
SCALAR Scalar
Definition: bench_gemm.cpp:45
Scalar_ Scalar
Definition: Transform.h:202
EIGEN_DEVICE_FUNC RotationReturnType rotation() const
Definition: Transform.h:1035
Matrix< Scalar, Dim, Dim, Options > LinearMatrixType
Definition: Transform.h:212
void determinant(const MatrixType &m)
Definition: determinant.cpp:15
static const unsigned Dim
Problem dimension.
Definition: two_d_tilted_square.cc:62
list x
Definition: plotDoE.py:28
Definition: fft_test_shared.h:66

References Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::coeffRef(), determinant(), Global_Variables::Dim, m, svd(), and plotDoE::x.

◆ computeScalingRotation()

template<typename Scalar , int Dim, int Mode, int Options>
template<typename ScalingMatrixType , typename RotationMatrixType >
EIGEN_DEVICE_FUNC void Eigen::Transform< Scalar, Dim, Mode, Options >::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
1084  {
1085  // Note that JacobiSVD is faster than BDCSVD for small matrices.
1086  JacobiSVD<LinearMatrixType, ComputeFullU | ComputeFullV> svd(linear());
1087 
1088  Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant() < Scalar(0)
1089  ? Scalar(-1)
1090  : Scalar(1); // so x has absolute value 1
1091  VectorType sv(svd.singularValues());
1092  sv.coeffRef(Dim - 1) *= x;
1093  if (scaling) *scaling = svd.matrixU() * sv.asDiagonal() * svd.matrixU().adjoint();
1094  if (rotation) {
1095  LinearMatrixType m(svd.matrixU());
1096  m.col(Dim - 1) *= x;
1097  *rotation = m * svd.matrixV().adjoint();
1098  }
1099 }

References Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::coeffRef(), determinant(), Global_Variables::Dim, m, svd(), and plotDoE::x.

◆ data() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
constexpr EIGEN_DEVICE_FUNC Scalar* Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::data ( )
inlineconstexpr

◆ data() [2/2]

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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

195  : (Dim_ + 1) * (Dim_ + 1))
196  enum {
197  Mode = Mode_,
198  Options = Options_,
199  Dim = Dim_,
200  HDim = Dim_ + 1,
201  Rows = int(Mode) == (AffineCompact) ? Dim : HDim
202  };

References Eigen::AffineCompact, Global_Variables::Dim, and int().

◆ fromPositionOrientationScale() [1/2]

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

◆ fromPositionOrientationScale() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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.

1109  {
1110  linear() = internal::toRotationMatrix<Scalar, Dim>(orientation);
1111  linear() *= scale.asDiagonal();
1112  translation() = position;
1113  makeAffine();
1114  return *this;
1115 }
EIGEN_DEVICE_FUNC Transform & scale(const MatrixBase< OtherDerived > &other)

References Eigen::MatrixBase< Derived >::asDiagonal().

◆ Identity()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
static EIGEN_DEVICE_FUNC const Transform Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Identity ( )
inlinestatic

Returns an identity transformation.

Todo:
In the future this function should be returning a Transform expression.
519 { return Transform(MatrixType::Identity()); }
EIGEN_DEVICE_FUNC Transform()
Definition: Transform.h:245

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform().

◆ inverse()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > Eigen::Transform< Scalar, Dim, Mode, Options >::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()
1172  {
1173  Transform res;
1174  if (hint == Projective) {
1176  } else {
1177  if (hint == Isometry) {
1178  res.matrix().template topLeftCorner<Dim, Dim>() = linear().transpose();
1179  } else if (hint & Affine) {
1180  res.matrix().template topLeftCorner<Dim, Dim>() = linear().inverse();
1181  } else {
1182  eigen_assert(false && "Invalid transform traits in Transform::Inverse");
1183  }
1184  // translation and remaining parts
1185  res.matrix().template topRightCorner<Dim, 1>() = -res.matrix().template topLeftCorner<Dim, Dim>() * translation();
1186  res.makeAffine(); // we do need this, because in the beginning res is uninitialized
1187  }
1188  return res;
1189 }
#define eigen_assert(x)
Definition: Macros.h:910
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
static EIGEN_DEVICE_FUNC void run(const TransformType &, TransformType &)
Definition: Transform.h:1138

References Eigen::Affine, eigen_assert, Eigen::Isometry, Eigen::Projective, res, and Eigen::internal::projective_transform_inverse< TransformType, Mode >::run().

◆ isApprox()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC bool Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::isApprox ( const Transform< Scalar_, Dim_, Mode_, Options_ > &  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()
619  {
620  return m_matrix.isApprox(other.m_matrix, prec);
621  }

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

◆ linear() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC LinearPart Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::linear ( )
inline
Returns
a writable expression of the linear part of the transformation
376 { return LinearPart(m_matrix, 0, 0); }
Block< MatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(int(Options) &RowMajor)==0 > LinearPart
Definition: Transform.h:214

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

◆ linear() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC ConstLinearPart Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::linear ( ) const
inline
Returns
a read-only expression of the linear part of the transformation
374 { return ConstLinearPart(m_matrix, 0, 0); }
const Block< ConstMatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(int(Options) &RowMajor)==0 > ConstLinearPart
Definition: Transform.h:217

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

Referenced by Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, LhsMode, LhsOptions >, Transform< Scalar, Dim, RhsMode, RhsOptions >, false >::run(), and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform().

◆ linearExt() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, Dim> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::linearExt ( )
inline
Returns
the Dim x Dim linear part if the transformation is affine, and the HDim x Dim part for projective transformations.
631  : Dim, Dim> linearExt() {
632  return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, Dim > (0, 0);
633  }
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective) ? HDim :Dim, Dim > linearExt()
Definition: Transform.h:631

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

Referenced by Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator*=().

◆ linearExt() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC const Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, Dim> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::linearExt ( ) const
inline
Returns
the Dim x Dim linear part if the transformation is affine, and the HDim x Dim part for projective transformations.
638  : Dim, Dim> linearExt() const {
639  return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, Dim > (0, 0);
640  }

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

◆ makeAffine()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC void Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::makeAffine ( )
inline

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

625 { internal::transform_make_affine<int(Mode)>::run(m_matrix); }

References int(), Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix, and Eigen::run().

Referenced by Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform().

◆ matrix() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC MatrixType& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::matrix ( )
inline
Returns
a writable expression of the transformation matrix
371 { return m_matrix; }

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

◆ matrix() [2/2]

◆ operator()() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Scalar& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator() ( Index  row,
Index  col 
)
inline

shortcut for m_matrix(row,col);

See also
MatrixBase::operator(Index,Index)
366 { return m_matrix(row, col); }
m col(1)
m row(1)

References col(), Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix, and row().

◆ operator()() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Scalar Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator() ( Index  row,
Index  col 
) const
inline

shortcut for m_matrix(row,col);

See also
MatrixBase::operator(Index,Index) const
363 { return m_matrix(row, col); }

References col(), Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix, and row().

◆ operator*() [1/8]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC const TransformTimeDiagonalReturnType Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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.

443  {
445  res.linearExt() *= b;
446  return res;
447  }
Scalar * b
Definition: benchVecAdd.cpp:17
Transform< Scalar, Dim, TransformTimeDiagonalMode > TransformTimeDiagonalReturnType
Definition: Transform.h:237

References b, and res.

◆ operator*() [2/8]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::transform_right_product_impl<Transform, OtherDerived>::ResultType Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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:

  • a point of size Dim (computes:
    this->linear() * other + this->translation()
    ),
  • a set of N points as a Dim x N matrix (computes:
    (this->linear() * other).colwise() +
    this->translation()
    ),

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;
Map< RowVectorXf > v2(M2.data(), M2.size())
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9;Map< RowVectorXf > v1(M1.data(), M1.size())
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Transform< float, 3, Affine > Affine3f
Definition: Transform.h:682
417  {
419  }

References Eigen::EigenBase< Derived >::derived(), and run().

◆ operator*() [3/8]

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

◆ operator*() [4/8]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator* ( const RotationBase< Derived, Dim > &  r) const
inline
994  {
995  Transform res = *this;
996  res.rotate(r.derived());
997  return res;
998 }

References UniformPSDSelfTest::r, and res.

◆ operator*() [5/8]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC const Transform Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator* ( const Transform< Scalar_, Dim_, Mode_, Options_ > &  other) const
inline

Concatenates two transformations

471  {
473  }

References run().

◆ operator*() [6/8]

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

Concatenates two different transformations

506  {
507  return internal::transform_transform_product_impl<Transform, Transform<Scalar, Dim, OtherMode, OtherOptions> >::run(
508  *this, other);
509  }

References Eigen::run().

◆ operator*() [7/8]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > Eigen::Transform< Scalar, Dim, Mode, Options >::operator* ( const TranslationType t) const
inline
966  {
967  Transform res = *this;
968  res.translate(t.vector());
969  return res;
970 }

References res, and plotPSD::t.

◆ operator*() [8/8]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator* ( const UniformScaling< Scalar > &  s) const
inline
555  {
557  res.scale(s.factor());
558  return res;
559  }

References res, and s.

◆ operator*=() [1/5]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator*= ( const DiagonalMatrix< Scalar, Dim > &  s)
inline
561  {
562  linearExt() *= s;
563  return *this;
564  }

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::linearExt(), and s.

◆ operator*=() [2/5]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator*= ( const EigenBase< OtherDerived > &  other)
inline
466  {
467  return *this = *this * other;
468  }

◆ operator*=() [3/5]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator*= ( const RotationBase< Derived, Dim > &  r)
inline
569  {
570  return rotate(r.toRotationMatrix());
571  }
EIGEN_DEVICE_FUNC Transform & rotate(const RotationType &rotation)

References UniformPSDSelfTest::r, and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::rotate().

◆ operator*=() [4/5]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator*= ( const TranslationType t)
inline
547 { return translate(t.vector()); }
EIGEN_DEVICE_FUNC Transform & translate(const MatrixBase< OtherDerived > &other)

References plotPSD::t, and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::translate().

◆ operator*=() [5/5]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator*= ( const UniformScaling< Scalar > &  s)
inline
553 { return scale(s.factor()); }

References s, and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::scale().

◆ operator=() [1/6]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator= ( const EigenBase< OtherDerived > &  other)
inline

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

280  {
283  YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
284 
286  return *this;
287  }

References Eigen::EigenBase< Derived >::derived(), EIGEN_STATIC_ASSERT, and run().

◆ operator=() [2/6]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator= ( const ReturnByValue< OtherDerived > &  other)
inline
340  {
341  other.evalTo(*this);
342  return *this;
343  }

References Eigen::ReturnByValue< Derived >::evalTo().

◆ operator=() [3/6]

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

◆ operator=() [4/6]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator= ( const RotationBase< Derived, Dim > &  r)
inline
984  {
985  linear() = internal::toRotationMatrix<Scalar, Dim>(r);
986  translation().setZero();
987  makeAffine();
988  return *this;
989 }

References UniformPSDSelfTest::r.

◆ operator=() [5/6]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::operator= ( const TranslationType t)
inline
957  {
958  linear().setIdentity();
959  translation() = t.vector();
960  makeAffine();
961  return *this;
962 }

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::setIdentity(), and plotPSD::t.

◆ operator=() [6/6]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::operator= ( const UniformScaling< Scalar > &  t)
inline
974  {
975  m_matrix.setZero();
976  linear().diagonal().fill(s.factor());
977  makeAffine();
978  return *this;
979 }
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Definition: CwiseNullaryOp.h:569

References s, and Eigen::PlainObjectBase< Derived >::setZero().

◆ prerotate() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::prerotate ( const RotationType &  rotation)
inline

◆ prerotate() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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()
915  {
916  m_matrix.template block<Dim, HDim>(0, 0) =
917  internal::toRotationMatrix<Scalar, Dim>(rotation) * m_matrix.template block<Dim, HDim>(0, 0);
918  return *this;
919 }

◆ prescale() [1/3]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::prescale ( const MatrixBase< OtherDerived > &  other)
inline

◆ prescale() [2/3]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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()
832  {
834  EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
835  affine().noalias() = (other.asDiagonal() * affine());
836  return *this;
837 }
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)
Definition: StaticAssert.h:50
EIGEN_DEVICE_FUNC ConstAffinePart affine() const
Definition: Transform.h:379

References Eigen::MatrixBase< Derived >::asDiagonal(), Global_Variables::Dim, EIGEN_STATIC_ASSERT, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Isometry.

◆ prescale() [3/3]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::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)
845  {
846  EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
847  m_matrix.template topRows<Dim>() *= s;
848  return *this;
849 }

References EIGEN_STATIC_ASSERT, Eigen::Isometry, and s.

◆ preshear()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::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()
943  {
944  EIGEN_STATIC_ASSERT(int(Dim) == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
945  EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
946  m_matrix.template block<Dim, HDim>(0, 0) =
947  LinearMatrixType({{1, sy}, {sx, 1}}) * m_matrix.template block<Dim, HDim>(0, 0);
948  return *this;
949 }

References Global_Variables::Dim, EIGEN_STATIC_ASSERT, and Eigen::Isometry.

◆ pretranslate() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::pretranslate ( const MatrixBase< OtherDerived > &  other)
inline

◆ pretranslate() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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()
871  {
873  if (EIGEN_CONST_CONDITIONAL(int(Mode) == int(Projective)))
874  affine() += other * m_matrix.row(Dim);
875  else
876  translation() += other;
877  return *this;
878 }

References Global_Variables::Dim, EIGEN_CONST_CONDITIONAL, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Projective.

◆ rotate() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::rotate ( const RotationType &  rotation)
inline

◆ rotate() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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:

  • any scalar (2D),
  • a Dim x Dim matrix expression,
  • a Quaternion (3D),
  • a AngleAxis (3D)

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)
900  {
901  linearExt() *= internal::toRotationMatrix<Scalar, Dim>(rotation);
902  return *this;
903 }

◆ rotation()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options >::RotationReturnType Eigen::Transform< Scalar, Dim, Mode, Options >::rotation
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
1035  {
1037 }
static EIGEN_DEVICE_FUNC const TransformType::LinearMatrixType run(const TransformType &t)
Definition: Transform.h:1008

References Eigen::internal::transform_rotation_impl< Mode >::run().

◆ rows()

◆ scale() [1/3]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::scale ( const MatrixBase< OtherDerived > &  other)
inline

◆ scale() [2/3]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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()
806  {
808  EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
809  linearExt().noalias() = (linearExt() * other.asDiagonal());
810  return *this;
811 }

References Eigen::MatrixBase< Derived >::asDiagonal(), Global_Variables::Dim, EIGEN_STATIC_ASSERT, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Isometry.

◆ scale() [3/3]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::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)
819  {
820  EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
821  linearExt() *= s;
822  return *this;
823 }

References EIGEN_STATIC_ASSERT, Eigen::Isometry, and s.

◆ setIdentity()

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC void Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::setIdentity ( )
inline
See also
MatrixBase::setIdentity()
513 { m_matrix.setIdentity(); }

References Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

Referenced by Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::operator=().

◆ shear()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::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()
928  {
929  EIGEN_STATIC_ASSERT(int(Dim) == 2, YOU_MADE_A_PROGRAMMING_MISTAKE)
930  EIGEN_STATIC_ASSERT(Mode != int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
931  VectorType tmp = linear().col(0) * sy + linear().col(1);
932  linear() << linear().col(0) + linear().col(1) * sx, tmp;
933  return *this;
934 }
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365

References Global_Variables::Dim, EIGEN_STATIC_ASSERT, Eigen::Isometry, and tmp.

◆ translate() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::translate ( const MatrixBase< OtherDerived > &  other)
inline

◆ translate() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::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()
858  {
860  translationExt() += linearExt() * other;
861  return *this;
862 }
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective) ? HDim :Dim, 1 > translationExt()
Definition: Transform.h:646

References Global_Variables::Dim, and EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE.

◆ translation() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC TranslationPart Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::translation ( )
inline
Returns
a writable expression of the translation vector of the transformation
386 { return TranslationPart(m_matrix, 0, Dim); }
Block< MatrixType, Dim, 1, !(internal::traits< MatrixType >::Flags &RowMajorBit)> TranslationPart
Definition: Transform.h:227

References Global_Variables::Dim, and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

◆ translation() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC ConstTranslationPart Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::translation ( ) const
inline
Returns
a read-only expression of the translation vector of the transformation
384 { return ConstTranslationPart(m_matrix, 0, Dim); }
const Block< ConstMatrixType, Dim, 1, !(internal::traits< MatrixType >::Flags &RowMajorBit)> ConstTranslationPart
Definition: Transform.h:230

References Global_Variables::Dim, and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

Referenced by Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, LhsMode, LhsOptions >, Transform< Scalar, Dim, RhsMode, RhsOptions >, false >::run(), Eigen::AlignedBox< Scalar_, AmbientDim_ >::transform(), and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::Transform().

◆ translationExt() [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, 1> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::translationExt ( )
inline
Returns
the translation part if the transformation is affine, and the last column for projective transformations.
646  : Dim, 1> translationExt() {
647  return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, 1 > (0, Dim);
648  }

References Global_Variables::Dim, and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

◆ translationExt() [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
EIGEN_DEVICE_FUNC const Block<MatrixType, int(Mode) == int(Projective) ? HDim : Dim, 1> Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::translationExt ( ) const
inline
Returns
the translation part if the transformation is affine, and the last column for projective transformations.
653  : Dim, 1> translationExt()
654  const {
655  return m_matrix.template block < int(Mode) == int(Projective) ? HDim : Dim, 1 > (0, Dim);
656  }

References Global_Variables::Dim, and Eigen::Transform< Scalar_, Dim_, Mode_, Options_ >::m_matrix.

Friends And Related Function Documentation

◆ operator* [1/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC friend TransformTimeDiagonalReturnType operator* ( const DiagonalBase< DiagonalDerived > &  a,
const Transform< Scalar_, Dim_, Mode_, Options_ > &  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.

457  {
459  res.linear().noalias() = a * b.linear();
460  res.translation().noalias() = a * b.translation();
461  if (EIGEN_CONST_CONDITIONAL(Mode != int(AffineCompact))) res.matrix().row(Dim) = b.matrix().row(Dim);
462  return res;
463  }
const Scalar * a
Definition: level2_cplx_impl.h:32

◆ operator* [2/2]

template<typename Scalar_ , int Dim_, int Mode_, int Options_>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const internal::transform_left_product_impl<OtherDerived, Mode, Options, Dim_, Dim_ + 1>::ResultType operator* ( const EigenBase< OtherDerived > &  a,
const Transform< Scalar_, Dim_, Mode_, Options_ > &  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.

Member Data Documentation

◆ m_matrix


The documentation for this class was generated from the following files: