12#ifndef EIGEN_TRANSFORM_H
13#define EIGEN_TRANSFORM_H
19template<
typename Transform>
31template<
typename TransformType,
36 int RhsCols = MatrixType::ColsAtCompileTime>
39template<
typename Other,
44 int OtherRows=Other::RowsAtCompileTime,
45 int OtherCols=Other::ColsAtCompileTime>
48template<
typename Lhs,
55template<
typename Other,
60 int OtherRows=Other::RowsAtCompileTime,
61 int OtherCols=Other::ColsAtCompileTime>
66template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
75 ColsAtCompileTime = Dim1,
76 MaxRowsAtCompileTime = RowsAtCompileTime,
77 MaxColsAtCompileTime = ColsAtCompileTime,
82template<
int Mode>
struct transform_make_affine;
203template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
275 template<
typename Derived>
285 template<
typename OtherDerived>
289 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
296 template<
typename OtherDerived>
300 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
306 template<
int OtherOptions>
314 template<
int OtherMode,
int OtherOptions>
321 YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
326 YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
337 m_matrix.template block<Dim,Dim+1>(0,0) = other.
matrix().template block<Dim,Dim+1>(0,0);
355 template<
typename OtherDerived>
362 template<
typename OtherDerived>
369 #ifdef EIGEN_QT_SUPPORT
372 inline QMatrix toQMatrix(
void)
const;
373 inline Transform(
const QTransform& other);
375 inline QTransform toQTransform(
void)
const;
433 template<
typename OtherDerived>
445 template<
typename OtherDerived>
friend
456 template<
typename DiagonalDerived>
461 res.linearExt() *=
b;
471 template<
typename DiagonalDerived>
477 res.translation().noalias() =
a*
b.translation();
479 res.matrix().row(Dim) =
b.matrix().row(Dim);
483 template<
typename OtherDerived>
501 template<
int OtherMode,
int OtherOptions>
struct icc_11_workaround
504 typedef typename ProductType::ResultType ResultType;
509 template<
int OtherMode,
int OtherOptions>
510 inline typename icc_11_workaround<OtherMode,OtherOptions>::ResultType
511 operator * (
const Transform<Scalar,Dim,OtherMode,OtherOptions>& other)
const
513 typedef typename icc_11_workaround<OtherMode,OtherOptions>::ProductType ProductType;
514 return ProductType::run(*
this,other);
518 template<
int OtherMode,
int OtherOptions>
519 EIGEN_DEVICE_FUNC inline typename internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> >::ResultType
535 return Transform(MatrixType::Identity());
538 template<
typename OtherDerived>
542 template<
typename OtherDerived>
549 template<
typename OtherDerived>
553 template<
typename OtherDerived>
557 template<
typename RotationType>
561 template<
typename RotationType>
592 template<
typename Derived>
594 template<
typename Derived>
596 template<
typename Derived>
602 template<
typename RotationMatrixType,
typename ScalingMatrixType>
605 template<
typename ScalingMatrixType,
typename RotationMatrixType>
609 template<
typename PositionDerived,
typename OrientationType,
typename ScaleDerived>
627 template<
typename NewScalarType>
632 template<
typename OtherScalarType>
658 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }
664 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }
671 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }
677 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }
680 #ifdef EIGEN_TRANSFORM_PLUGIN
681 #include EIGEN_TRANSFORM_PLUGIN
685 #ifndef EIGEN_PARSED_BY_DOXYGEN
734#ifdef EIGEN_QT_SUPPORT
739template<
typename Scalar,
int Dim,
int Mode,
int Options>
742 check_template_params();
750template<
typename Scalar,
int Dim,
int Mode,
int Options>
755 m_matrix << other.m11(), other.m21(), other.dx(),
756 other.m12(), other.m22(), other.dy();
758 m_matrix << other.m11(), other.m21(), other.dx(),
759 other.m12(), other.m22(), other.dy(),
770template<
typename Scalar,
int Dim,
int Mode,
int Options>
771QMatrix Transform<Scalar,Dim,Mode,Options>::toQMatrix(
void)
const
773 check_template_params();
775 return QMatrix(m_matrix.coeff(0,0), m_matrix.coeff(1,0),
776 m_matrix.coeff(0,1), m_matrix.coeff(1,1),
777 m_matrix.coeff(0,2), m_matrix.coeff(1,2));
784template<
typename Scalar,
int Dim,
int Mode,
int Options>
787 check_template_params();
795template<
typename Scalar,
int Dim,
int Mode,
int Options>
798 check_template_params();
801 m_matrix << other.m11(), other.m21(), other.dx(),
802 other.m12(), other.m22(), other.dy();
804 m_matrix << other.m11(), other.m21(), other.dx(),
805 other.m12(), other.m22(), other.dy(),
806 other.m13(), other.m23(), other.m33();
814template<
typename Scalar,
int Dim,
int Mode,
int Options>
815QTransform Transform<Scalar,Dim,Mode,Options>::toQTransform(
void)
const
819 return QTransform(m_matrix.coeff(0,0), m_matrix.coeff(1,0),
820 m_matrix.coeff(0,1), m_matrix.coeff(1,1),
821 m_matrix.coeff(0,2), m_matrix.coeff(1,2));
823 return QTransform(m_matrix.coeff(0,0), m_matrix.coeff(1,0), m_matrix.coeff(2,0),
824 m_matrix.coeff(0,1), m_matrix.coeff(1,1), m_matrix.coeff(2,1),
825 m_matrix.coeff(0,2), m_matrix.coeff(1,2), m_matrix.coeff(2,2));
837template<
typename Scalar,
int Dim,
int Mode,
int Options>
838template<
typename OtherDerived>
844 linearExt().noalias() = (linearExt() * other.
asDiagonal());
852template<
typename Scalar,
int Dim,
int Mode,
int Options>
864template<
typename Scalar,
int Dim,
int Mode,
int Options>
865template<
typename OtherDerived>
871 affine().noalias() = (other.
asDiagonal() * affine());
879template<
typename Scalar,
int Dim,
int Mode,
int Options>
883 m_matrix.template topRows<Dim>() *=
s;
891template<
typename Scalar,
int Dim,
int Mode,
int Options>
892template<
typename OtherDerived>
897 translationExt() += linearExt() * other;
905template<
typename Scalar,
int Dim,
int Mode,
int Options>
906template<
typename OtherDerived>
912 affine() += other * m_matrix.row(Dim);
914 translation() += other;
935template<
typename Scalar,
int Dim,
int Mode,
int Options>
936template<
typename RotationType>
951template<
typename Scalar,
int Dim,
int Mode,
int Options>
952template<
typename RotationType>
957 * m_matrix.template block<Dim,HDim>(0,0);
966template<
typename Scalar,
int Dim,
int Mode,
int Options>
972 VectorType tmp = linear().col(0)*sy + linear().col(1);
973 linear() << linear().col(0) + linear().col(1)*sx, tmp;
982template<
typename Scalar,
int Dim,
int Mode,
int Options>
988 m_matrix.template block<Dim,HDim>(0,0) =
LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
996template<
typename Scalar,
int Dim,
int Mode,
int Options>
1000 translation() = t.
vector();
1005template<
typename Scalar,
int Dim,
int Mode,
int Options>
1013template<
typename Scalar,
int Dim,
int Mode,
int Options>
1017 linear().diagonal().fill(
s.factor());
1022template<
typename Scalar,
int Dim,
int Mode,
int Options>
1023template<
typename Derived>
1027 translation().setZero();
1032template<
typename Scalar,
int Dim,
int Mode,
int Options>
1033template<
typename Derived>
1047 template<
typename TransformType>
1049 const typename TransformType::LinearMatrixType
run(
const TransformType& t)
1051 typedef typename TransformType::LinearMatrixType LinearMatrixType;
1053 t.computeRotationScaling(&
result, (LinearMatrixType*)0);
1058 template<
typename TransformType>
1060 typename TransformType::ConstLinearPart
run(
const TransformType& t)
1076template<
typename Scalar,
int Dim,
int Mode,
int Options>
1096template<
typename Scalar,
int Dim,
int Mode,
int Options>
1097template<
typename RotationMatrixType,
typename ScalingMatrixType>
1106 if(scaling) *scaling =
svd.matrixV() * sv.asDiagonal() *
svd.matrixV().adjoint();
1126template<
typename Scalar,
int Dim,
int Mode,
int Options>
1127template<
typename ScalingMatrixType,
typename RotationMatrixType>
1136 if(scaling) *scaling =
svd.matrixU() * sv.asDiagonal() *
svd.matrixU().adjoint();
1148template<
typename Scalar,
int Dim,
int Mode,
int Options>
1149template<
typename PositionDerived,
typename OrientationType,
typename ScaleDerived>
1155 linear() *=
scale.asDiagonal();
1156 translation() = position;
1166 template<
typename MatrixType>
1169 static const int Dim = MatrixType::ColsAtCompileTime-1;
1171 mat.coeffRef(Dim,Dim) =
typename MatrixType::Scalar(1);
1182template<
typename TransformType,
int Mode=TransformType::Mode>
1189template<
typename TransformType>
1194 res.matrix() =
m.matrix().inverse();
1221template<
typename Scalar,
int Dim,
int Mode,
int Options>
1234 res.matrix().template topLeftCorner<Dim,Dim>() = linear().transpose();
1238 res.matrix().template topLeftCorner<Dim,Dim>() = linear().inverse();
1242 eigen_assert(
false &&
"Invalid transform traits in Transform::Inverse");
1245 res.matrix().template topRightCorner<Dim,1>()
1246 = -
res.matrix().template topLeftCorner<Dim,Dim>() * translation();
1268template<
typename Scalar,
int Dim,
int Options>
1279template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1290template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1300template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1307template<
typename Other,
int Options,
int Dim,
int HDim>
1318template<
int LhsMode,
int RhsMode>
1331template<
typename TransformType,
typename MatrixType,
int RhsCols>
1338 return T.matrix() * other;
1342template<
typename TransformType,
typename MatrixType,
int RhsCols>
1346 Dim = TransformType::Dim,
1347 HDim = TransformType::HDim,
1348 OtherRows = MatrixType::RowsAtCompileTime,
1349 OtherCols = MatrixType::ColsAtCompileTime
1361 TopLeftLhs(
res, 0, 0, Dim, other.cols()).noalias() =
T.affine() * other;
1362 res.
row(OtherRows-1) = other.row(OtherRows-1);
1368template<
typename TransformType,
typename MatrixType,
int RhsCols>
1372 Dim = TransformType::Dim,
1373 HDim = TransformType::HDim,
1374 OtherRows = MatrixType::RowsAtCompileTime,
1375 OtherCols = MatrixType::ColsAtCompileTime
1386 TopLeftLhs(
res, 0, 0, Dim, other.cols()).noalias() +=
T.linear() * other;
1392template<
typename TransformType,
typename MatrixType >
1397 Dim = TransformType::Dim,
1398 HDim = TransformType::HDim,
1399 OtherRows = MatrixType::RowsAtCompileTime,
1410 rhs.template
head<Dim>() = other; rhs[Dim] =
typename ResultType::Scalar(1);
1421template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1432template<
typename Other,
int Options,
int Dim,
int HDim>
1442 res.matrix().col(Dim) += other.col(Dim);
1448template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1457 res.affine().noalias() = other *
tr.matrix();
1458 res.matrix().row(Dim) =
tr.matrix().row(Dim);
1464template<
typename Other,
int Options,
int Dim,
int HDim>
1474 res.translation() += other.col(Dim);
1480template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1490 res.matrix().row(Dim) =
tr.matrix().row(Dim);
1501template<
typename Scalar,
int Dim,
int LhsMode,
int LhsOptions,
int RhsMode,
int RhsOptions>
1511 res.linear() = lhs.linear() * rhs.linear();
1512 res.translation() = lhs.linear() * rhs.translation() + lhs.translation();
1518template<
typename Scalar,
int Dim,
int LhsMode,
int LhsOptions,
int RhsMode,
int RhsOptions>
1526 return ResultType( lhs.matrix() * rhs.matrix() );
1530template<
typename Scalar,
int Dim,
int LhsOptions,
int RhsOptions>
1540 res.matrix().row(Dim) = rhs.matrix().row(Dim);
1545template<
typename Scalar,
int Dim,
int LhsOptions,
int RhsOptions>
1554 res.matrix().col(Dim) += lhs.matrix().col(Dim);
Matrix3f m
Definition AngleAxis_mimic_euler.cpp:1
EIGEN_DEVICE_FUNC const InverseReturnType inverse() const
Definition ArrayCwiseUnaryOps.h:411
ArrayXXi a
Definition Array_initializer_list_23_cxx11.cpp:1
cout<< "Here is the matrix m:"<< endl<< m<< endl;JacobiSVD< MatrixXf > svd(m, ComputeThinU|ComputeThinV)
#define EIGEN_CONST_CONDITIONAL(cond)
Definition Macros.h:1153
#define EIGEN_PLAIN_ENUM_MIN(a, b)
Definition Macros.h:1288
#define EIGEN_NOEXCEPT
Definition Macros.h:1418
#define EIGEN_CONSTEXPR
Definition Macros.h:787
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define eigen_assert(x)
Definition Macros.h:1037
#define EIGEN_IMPLIES(a, b)
Definition Macros.h:1315
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition PartialRedux_count.cpp:3
float rotation
Definition main.cpp:46
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)
Definition StaticAssert.h:157
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:127
MatrixXf mat
Definition Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
Scalar * b
Definition benchVecAdd.cpp:17
SCALAR Scalar
Definition bench_gemm.cpp:46
MatrixXf MatrixType
Definition benchmark-blocking-sizes.cpp:52
Expression of a fixed-size or dynamic-size block.
Definition Block.h:105
Definition DiagonalMatrix.h:19
Represents a diagonal matrix with its storage.
Definition DiagonalMatrix.h:142
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition JacobiSVD.h:490
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Derived > asDiagonal() const
Definition DiagonalMatrix.h:325
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Definition PlainObjectBase.h:175
Definition ReturnByValue.h:52
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition ReturnByValue.h:61
Common base class for compact rotation representations.
Definition RotationBase.h:30
EIGEN_DEVICE_FUNC const Derived & derived() const
Definition RotationBase.h:41
EIGEN_DEVICE_FUNC RotationMatrixType toRotationMatrix() const
Definition RotationBase.h:45
Represents a translation transformation.
Definition Translation.h:31
EIGEN_DEVICE_FUNC const VectorType & vector() const
Definition Translation.h:87
const StorageIndex & row() const
Definition SparseUtil.h:172
Definition TensorRef.h:81
void determinant(const MatrixType &m)
Definition determinant.cpp:14
EIGEN_DONT_INLINE void transform(const Transformation &t, Data &data)
Definition geometry.cpp:25
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics scale
Definition gnuplot_common_settings.hh:54
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition gnuplot_common_settings.hh:12
Transform< float, 3, Projective > Projective3f
Definition Transform.h:724
Transform< float, 2, Projective > Projective2f
Definition Transform.h:722
Transform< float, 3, AffineCompact > AffineCompact3f
Definition Transform.h:715
Transform< float, 3, Affine > Affine3f
Definition Transform.h:706
Transform< double, 3, Projective > Projective3d
Definition Transform.h:728
Transform< double, 2, Isometry > Isometry2d
Definition Transform.h:699
Transform< double, 3, Isometry > Isometry3d
Definition Transform.h:701
Transform< double, 2, AffineCompact > AffineCompact2d
Definition Transform.h:717
Transform< float, 2, Isometry > Isometry2f
Definition Transform.h:695
Transform< double, 3, Affine > Affine3d
Definition Transform.h:710
Transform< double, 3, AffineCompact > AffineCompact3d
Definition Transform.h:719
Transform< double, 2, Affine > Affine2d
Definition Transform.h:708
Transform< double, 2, Projective > Projective2d
Definition Transform.h:726
Transform< float, 3, Isometry > Isometry3f
Definition Transform.h:697
Transform< float, 2, AffineCompact > AffineCompact2f
Definition Transform.h:713
Transform< float, 2, Affine > Affine2f
Definition Transform.h:704
TransformTraits
Definition Constants.h:455
@ DontAlign
Definition Constants.h:325
@ RowMajor
Definition Constants.h:321
@ ComputeFullV
Definition Constants.h:397
@ ComputeFullU
Definition Constants.h:393
@ Affine
Definition Constants.h:460
@ Projective
Definition Constants.h:464
@ AffineCompact
Definition Constants.h:462
@ Isometry
Definition Constants.h:457
const unsigned int RowMajorBit
Definition Constants.h:66
RealScalar s
Definition level1_cplx_impl.h:126
@ Lhs
Definition TensorContractionMapper.h:19
@ Rhs
Definition TensorContractionMapper.h:18
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
Definition Constants.h:22
Definition BandTriangularSolver.h:13
Definition Constants.h:507
Definition EigenBase.h:30
EIGEN_DEVICE_FUNC Derived & derived()
Definition EigenBase.h:46
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition NumTraits.h:233
Definition ForwardDeclarations.h:17