27 #ifndef EIGEN_TRANSFORM_H
28 #define EIGEN_TRANSFORM_H
34 template<
typename Transform>
35 struct transform_traits
40 HDim = Transform::HDim,
41 Mode = Transform::Mode,
46 template<
typename TransformType,
48 int Case = transform_traits<TransformType>::IsProjective ? 0
49 :
int(MatrixType::RowsAtCompileTime) ==
int(transform_traits<TransformType>::HDim) ? 1
51 struct transform_right_product_impl;
53 template<
typename Other,
58 int OtherRows=Other::RowsAtCompileTime,
59 int OtherCols=Other::ColsAtCompileTime>
60 struct transform_left_product_impl;
62 template<
typename Lhs,
65 transform_traits<Lhs>::IsProjective ||
66 transform_traits<Rhs>::IsProjective>
67 struct transform_transform_product_impl;
69 template<
typename Other,
74 int OtherRows=Other::RowsAtCompileTime,
75 int OtherCols=Other::ColsAtCompileTime>
76 struct transform_construct_from_matrix;
78 template<
typename TransformType>
struct transform_take_affine_part;
190 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
247 check_template_params();
254 check_template_params();
260 check_template_params();
265 check_template_params();
268 template<
typename Derived>
271 check_template_params();
276 { m_matrix = other.
m_matrix;
return *
this; }
281 template<
typename OtherDerived>
285 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
287 check_template_params();
288 internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(
this, other.
derived());
292 template<
typename OtherDerived>
296 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
298 internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(
this, other.
derived());
302 template<
int OtherOptions>
305 check_template_params();
307 m_matrix = other.
matrix();
310 template<
int OtherMode,
int OtherOptions>
313 check_template_params();
317 YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
322 YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
328 if(ModeIsAffineCompact == OtherModeIsAffineCompact)
333 m_matrix.template block<Dim,Dim+1>(0,0) = other.
matrix().template block<Dim,Dim+1>(0,0);
336 else if(OtherModeIsAffineCompact)
339 internal::transform_construct_from_matrix<OtherMatrixType,Mode,Options,Dim,HDim>::run(
this, other.
matrix());
346 linear() = other.
linear();
351 template<
typename OtherDerived>
354 check_template_params();
358 template<
typename OtherDerived>
365 #ifdef EIGEN_QT_SUPPORT
367 inline Transform& operator=(
const QMatrix& other);
368 inline QMatrix toQMatrix(
void)
const;
369 inline Transform(
const QTransform& other);
370 inline Transform& operator=(
const QTransform& other);
371 inline QTransform toQTransform(
void)
const;
376 inline Scalar operator() (Index
row, Index
col)
const {
return m_matrix(row,col); }
379 inline Scalar& operator() (Index
row, Index
col) {
return m_matrix(row,col); }
382 inline const MatrixType&
matrix()
const {
return m_matrix; }
384 inline MatrixType&
matrix() {
return m_matrix; }
387 inline ConstLinearPart
linear()
const {
return ConstLinearPart(m_matrix,0,0); }
389 inline LinearPart
linear() {
return LinearPart(m_matrix,0,0); }
392 inline ConstAffinePart
affine()
const {
return take_affine_part::run(m_matrix); }
394 inline AffinePart
affine() {
return take_affine_part::run(m_matrix); }
397 inline ConstTranslationPart
translation()
const {
return ConstTranslationPart(m_matrix,0,Dim); }
399 inline TranslationPart
translation() {
return TranslationPart(m_matrix,0,Dim); }
413 template<
typename OtherDerived>
414 EIGEN_STRONG_INLINE const typename internal::transform_right_product_impl<Transform, OtherDerived>::ResultType
416 {
return internal::transform_right_product_impl<Transform, OtherDerived>::run(*
this,other.
derived()); }
425 template<
typename OtherDerived>
friend
426 inline const typename internal::transform_left_product_impl<OtherDerived,Mode,Options,_Dim,_Dim+1>::ResultType
428 {
return internal::transform_left_product_impl<OtherDerived,Mode,Options,Dim,HDim>::run(a.
derived(),b); }
436 template<
typename DiagonalDerived>
437 inline const TransformTimeDiagonalReturnType
440 TransformTimeDiagonalReturnType res(*
this);
451 template<
typename DiagonalDerived>
452 friend inline TransformTimeDiagonalReturnType
455 TransformTimeDiagonalReturnType res;
463 template<
typename OtherDerived>
469 return internal::transform_transform_product_impl<Transform,Transform>::run(*
this,other);
472 #ifdef __INTEL_COMPILER
481 template<
int OtherMode,
int OtherOptions>
struct icc_11_workaround
483 typedef internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> > ProductType;
484 typedef typename ProductType::ResultType ResultType;
489 template<
int OtherMode,
int OtherOptions>
490 inline typename icc_11_workaround<OtherMode,OtherOptions>::ResultType
491 operator * (
const Transform<Scalar,Dim,OtherMode,OtherOptions>& other)
const
493 typedef typename icc_11_workaround<OtherMode,OtherOptions>::ProductType ProductType;
494 return ProductType::run(*
this,other);
498 template<
int OtherMode,
int OtherOptions>
499 inline typename internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> >::ResultType
502 return internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> >::run(*
this,other);
515 return Transform(MatrixType::Identity());
518 template<
typename OtherDerived>
521 template<
typename OtherDerived>
527 template<
typename OtherDerived>
530 template<
typename OtherDerived>
533 template<
typename RotationType>
534 inline Transform& rotate(
const RotationType& rotation);
536 template<
typename RotationType>
537 inline Transform& prerotate(
const RotationType& rotation);
540 Transform& preshear(Scalar sx, Scalar sy);
542 inline Transform& operator=(
const TranslationType& t);
552 template<
typename Derived>
554 template<
typename Derived>
556 template<
typename Derived>
559 const LinearMatrixType rotation()
const;
560 template<
typename RotationMatrixType,
typename ScalingMatrixType>
561 void computeRotationScaling(RotationMatrixType *rotation, ScalingMatrixType *scaling)
const;
562 template<
typename ScalingMatrixType,
typename RotationMatrixType>
563 void computeScalingRotation(ScalingMatrixType *scaling, RotationMatrixType *rotation)
const;
565 template<
typename PositionDerived,
typename OrientationType,
typename ScaleDerived>
572 const Scalar*
data()
const {
return m_matrix.
data(); }
581 template<
typename NewScalarType>
582 inline typename internal::cast_return_type<Transform,Transform<NewScalarType,Dim,Mode,Options> >::type
cast()
const
583 {
return typename internal::cast_return_type<Transform,Transform<NewScalarType,Dim,Mode,Options> >::type(*
this); }
586 template<
typename OtherScalarType>
589 check_template_params();
590 m_matrix = other.
matrix().template cast<Scalar>();
606 matrix().template block<1,Dim>(Dim,0).setZero();
607 matrix().coeffRef(Dim,Dim) = 1;
616 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }
622 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }
629 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }
635 {
return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }
638 #ifdef EIGEN_TRANSFORM_PLUGIN
639 #include EIGEN_TRANSFORM_PLUGIN
643 #ifndef EIGEN_PARSED_BY_DOXYGEN
692 #ifdef EIGEN_QT_SUPPORT
697 template<
typename Scalar,
int Dim,
int Mode,
int Options>
700 check_template_params();
708 template<
typename Scalar,
int Dim,
int Mode,
int Options>
712 m_matrix << other.m11(), other.m21(), other.dx(),
713 other.m12(), other.m22(), other.dy(),
724 template<
typename Scalar,
int Dim,
int Mode,
int Options>
727 check_template_params();
729 return QMatrix(m_matrix.
coeff(0,0), m_matrix.
coeff(1,0),
738 template<
typename Scalar,
int Dim,
int Mode,
int Options>
741 check_template_params();
749 template<
typename Scalar,
int Dim,
int Mode,
int Options>
752 check_template_params();
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(),
760 other.m13(), other.m23(), other.m33();
768 template<
typename Scalar,
int Dim,
int Mode,
int Options>
773 return QTransform(m_matrix.
coeff(0,0), m_matrix.
coeff(1,0),
777 return QTransform(m_matrix.
coeff(0,0), m_matrix.
coeff(1,0), m_matrix.
coeff(2,0),
791 template<
typename Scalar,
int Dim,
int Mode,
int Options>
792 template<
typename OtherDerived>
798 linearExt().noalias() = (linearExt() * other.
asDiagonal());
806 template<
typename Scalar,
int Dim,
int Mode,
int Options>
818 template<
typename Scalar,
int Dim,
int Mode,
int Options>
819 template<
typename OtherDerived>
825 m_matrix.template block<Dim,HDim>(0,0).noalias() = (other.
asDiagonal() * m_matrix.template block<Dim,HDim>(0,0));
833 template<
typename Scalar,
int Dim,
int Mode,
int Options>
837 m_matrix.template topRows<Dim>() *= s;
845 template<
typename Scalar,
int Dim,
int Mode,
int Options>
846 template<
typename OtherDerived>
851 translationExt() += linearExt() * other;
859 template<
typename Scalar,
int Dim,
int Mode,
int Options>
860 template<
typename OtherDerived>
866 affine() += other * m_matrix.
row(Dim);
868 translation() += other;
889 template<
typename Scalar,
int Dim,
int Mode,
int Options>
890 template<
typename RotationType>
894 linearExt() *= internal::toRotationMatrix<Scalar,Dim>(rotation);
905 template<
typename Scalar,
int Dim,
int Mode,
int Options>
906 template<
typename RotationType>
910 m_matrix.template block<Dim,HDim>(0,0) = internal::toRotationMatrix<Scalar,Dim>(rotation)
911 * m_matrix.template block<Dim,HDim>(0,0);
920 template<
typename Scalar,
int Dim,
int Mode,
int Options>
926 VectorType tmp = linear().col(0)*sy + linear().col(1);
927 linear() << linear().col(0) + linear().col(1)*sx, tmp;
936 template<
typename Scalar,
int Dim,
int Mode,
int Options>
942 m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
950 template<
typename Scalar,
int Dim,
int Mode,
int Options>
954 translation() = t.
vector();
959 template<
typename Scalar,
int Dim,
int Mode,
int Options>
967 template<
typename Scalar,
int Dim,
int Mode,
int Options>
971 linear().diagonal().fill(s.
factor());
976 template<
typename Scalar,
int Dim,
int Mode,
int Options>
984 template<
typename Scalar,
int Dim,
int Mode,
int Options>
985 template<
typename Derived>
988 linear() = internal::toRotationMatrix<Scalar,Dim>(r);
989 translation().setZero();
994 template<
typename Scalar,
int Dim,
int Mode,
int Options>
995 template<
typename Derived>
1014 template<
typename Scalar,
int Dim,
int Mode,
int Options>
1018 LinearMatrixType result;
1019 computeRotationScaling(&result, (LinearMatrixType*)0);
1035 template<
typename Scalar,
int Dim,
int Mode,
int Options>
1036 template<
typename RotationMatrixType,
typename ScalingMatrixType>
1041 Scalar x = (svd.
matrixU() * svd.
matrixV().adjoint()).determinant();
1043 sv.coeffRef(0) *= x;
1044 if(scaling) scaling->lazyAssign(svd.
matrixV() * sv.asDiagonal() * svd.
matrixV().adjoint());
1047 LinearMatrixType m(svd.
matrixU());
1049 rotation->lazyAssign(m * svd.
matrixV().adjoint());
1064 template<
typename Scalar,
int Dim,
int Mode,
int Options>
1065 template<
typename ScalingMatrixType,
typename RotationMatrixType>
1070 Scalar x = (svd.
matrixU() * svd.
matrixV().adjoint()).determinant();
1072 sv.coeffRef(0) *= x;
1073 if(scaling) scaling->lazyAssign(svd.
matrixU() * sv.asDiagonal() * svd.
matrixU().adjoint());
1076 LinearMatrixType m(svd.
matrixU());
1078 rotation->lazyAssign(m * svd.
matrixV().adjoint());
1085 template<
typename Scalar,
int Dim,
int Mode,
int Options>
1086 template<
typename PositionDerived,
typename OrientationType,
typename ScaleDerived>
1091 linear() = internal::toRotationMatrix<Scalar,Dim>(orientation);
1093 translation() = position;
1098 namespace internal {
1101 template<
typename TransformType,
int Mode=TransformType::Mode>
1102 struct projective_transform_inverse
1104 static inline void run(
const TransformType&, TransformType&)
1108 template<
typename TransformType>
1109 struct projective_transform_inverse<TransformType,
Projective>
1111 static inline void run(
const TransformType& m, TransformType& res)
1113 res.matrix() = m.matrix().inverse();
1140 template<
typename Scalar,
int Dim,
int Mode,
int Options>
1141 Transform<Scalar,Dim,Mode,Options>
1147 internal::projective_transform_inverse<Transform>::run(*
this, res);
1153 res.
matrix().template topLeftCorner<Dim,Dim>() = linear().
transpose();
1157 res.
matrix().template topLeftCorner<Dim,Dim>() = linear().
inverse();
1161 eigen_assert(
false &&
"Invalid transform traits in Transform::Inverse");
1164 res.
matrix().template topRightCorner<Dim,1>()
1165 = - res.
matrix().template topLeftCorner<Dim,Dim>() * translation();
1171 namespace internal {
1177 template<
typename TransformType>
struct transform_take_affine_part {
1178 typedef typename TransformType::MatrixType MatrixType;
1179 typedef typename TransformType::AffinePart AffinePart;
1180 typedef typename TransformType::ConstAffinePart ConstAffinePart;
1181 static inline AffinePart run(MatrixType& m)
1182 {
return m.template block<TransformType::Dim,TransformType::HDim>(0,0); }
1183 static inline ConstAffinePart run(
const MatrixType& m)
1184 {
return m.template block<TransformType::Dim,TransformType::HDim>(0,0); }
1187 template<
typename Scalar,
int Dim,
int Options>
1188 struct transform_take_affine_part<Transform<Scalar,Dim,
AffineCompact, Options> > {
1189 typedef typename Transform<Scalar,Dim,AffineCompact,Options>::MatrixType MatrixType;
1190 static inline MatrixType& run(MatrixType& m) {
return m; }
1191 static inline const MatrixType& run(
const MatrixType& m) {
return m; }
1198 template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1199 struct transform_construct_from_matrix<Other, Mode,Options,Dim,HDim, Dim,Dim>
1201 static inline void run(Transform<typename Other::Scalar,Dim,Mode,Options> *transform,
const Other& other)
1203 transform->linear() = other;
1204 transform->translation().setZero();
1205 transform->makeAffine();
1209 template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1210 struct transform_construct_from_matrix<Other, Mode,Options,Dim,HDim, Dim,HDim>
1212 static inline void run(Transform<typename Other::Scalar,Dim,Mode,Options> *transform,
const Other& other)
1214 transform->affine() = other;
1215 transform->makeAffine();
1219 template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1220 struct transform_construct_from_matrix<Other, Mode,Options,Dim,HDim, HDim,HDim>
1222 static inline void run(Transform<typename Other::Scalar,Dim,Mode,Options> *transform,
const Other& other)
1223 { transform->matrix() = other; }
1226 template<
typename Other,
int Options,
int Dim,
int HDim>
1227 struct transform_construct_from_matrix<Other,
AffineCompact,Options,Dim,HDim, HDim,HDim>
1229 static inline void run(Transform<typename Other::Scalar,Dim,AffineCompact,Options> *transform,
const Other& other)
1230 { transform->matrix() = other.template block<Dim,HDim>(0,0); }
1237 template<
int LhsMode,
int RhsMode>
1238 struct transform_product_result
1250 template<
typename TransformType,
typename MatrixType >
1251 struct transform_right_product_impl< TransformType, MatrixType, 0 >
1253 typedef typename MatrixType::PlainObject ResultType;
1255 static EIGEN_STRONG_INLINE ResultType run(
const TransformType& T,
const MatrixType& other)
1257 return T.matrix() * other;
1261 template<
typename TransformType,
typename MatrixType >
1262 struct transform_right_product_impl< TransformType, MatrixType, 1 >
1265 Dim = TransformType::Dim,
1266 HDim = TransformType::HDim,
1267 OtherRows = MatrixType::RowsAtCompileTime,
1268 OtherCols = MatrixType::ColsAtCompileTime
1271 typedef typename MatrixType::PlainObject ResultType;
1273 static EIGEN_STRONG_INLINE ResultType run(
const TransformType& T,
const MatrixType& other)
1277 typedef Block<ResultType, Dim, OtherCols, int(MatrixType::RowsAtCompileTime)==Dim> TopLeftLhs;
1279 ResultType res(other.rows(),other.cols());
1280 TopLeftLhs(res, 0, 0, Dim, other.cols()).noalias() = T.affine() * other;
1281 res.row(OtherRows-1) = other.row(OtherRows-1);
1287 template<
typename TransformType,
typename MatrixType >
1288 struct transform_right_product_impl< TransformType, MatrixType, 2 >
1291 Dim = TransformType::Dim,
1292 HDim = TransformType::HDim,
1293 OtherRows = MatrixType::RowsAtCompileTime,
1294 OtherCols = MatrixType::ColsAtCompileTime
1297 typedef typename MatrixType::PlainObject ResultType;
1299 static EIGEN_STRONG_INLINE ResultType run(
const TransformType& T,
const MatrixType& other)
1303 typedef Block<ResultType, Dim, OtherCols, true> TopLeftLhs;
1304 ResultType res(Replicate<typename TransformType::ConstTranslationPart, 1, OtherCols>(T.translation(),1,other.cols()));
1305 TopLeftLhs(res, 0, 0, Dim, other.cols()).noalias() += T.linear() * other;
1316 template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1317 struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, HDim,HDim>
1319 typedef Transform<typename Other::Scalar,Dim,Mode,Options> TransformType;
1320 typedef typename TransformType::MatrixType MatrixType;
1321 typedef Transform<typename Other::Scalar,Dim,Projective,Options> ResultType;
1322 static ResultType run(
const Other& other,
const TransformType& tr)
1323 {
return ResultType(other * tr.matrix()); }
1327 template<
typename Other,
int Options,
int Dim,
int HDim>
1328 struct transform_left_product_impl<Other,
AffineCompact,Options,Dim,HDim, HDim,HDim>
1330 typedef Transform<typename Other::Scalar,Dim,AffineCompact,Options> TransformType;
1331 typedef typename TransformType::MatrixType MatrixType;
1332 typedef Transform<typename Other::Scalar,Dim,Projective,Options> ResultType;
1333 static ResultType run(
const Other& other,
const TransformType& tr)
1336 res.matrix().noalias() = other.template block<HDim,Dim>(0,0) * tr.matrix();
1337 res.matrix().col(Dim) += other.col(Dim);
1343 template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1344 struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, Dim,HDim>
1346 typedef Transform<typename Other::Scalar,Dim,Mode,Options> TransformType;
1347 typedef typename TransformType::MatrixType MatrixType;
1348 typedef TransformType ResultType;
1349 static ResultType run(
const Other& other,
const TransformType& tr)
1352 res.affine().noalias() = other * tr.matrix();
1353 res.matrix().row(Dim) = tr.matrix().row(Dim);
1359 template<
typename Other,
int Options,
int Dim,
int HDim>
1360 struct transform_left_product_impl<Other,
AffineCompact,Options,Dim,HDim, Dim,HDim>
1362 typedef Transform<typename Other::Scalar,Dim,AffineCompact,Options> TransformType;
1363 typedef typename TransformType::MatrixType MatrixType;
1364 typedef TransformType ResultType;
1365 static ResultType run(
const Other& other,
const TransformType& tr)
1368 res.matrix().noalias() = other.template block<Dim,Dim>(0,0) * tr.matrix();
1369 res.translation() += other.col(Dim);
1375 template<
typename Other,
int Mode,
int Options,
int Dim,
int HDim>
1376 struct transform_left_product_impl<Other,Mode,Options,Dim,HDim, Dim,Dim>
1378 typedef Transform<typename Other::Scalar,Dim,Mode,Options> TransformType;
1379 typedef typename TransformType::MatrixType MatrixType;
1380 typedef TransformType ResultType;
1381 static ResultType run(
const Other& other,
const TransformType& tr)
1385 res.matrix().row(Dim) = tr.matrix().row(Dim);
1386 res.matrix().template topRows<Dim>().noalias()
1387 = other * tr.matrix().template topRows<Dim>();
1396 template<
typename Scalar,
int Dim,
int LhsMode,
int LhsOptions,
int RhsMode,
int RhsOptions>
1397 struct transform_transform_product_impl<Transform<Scalar,Dim,LhsMode,LhsOptions>,Transform<Scalar,Dim,RhsMode,RhsOptions>,false >
1399 enum { ResultMode = transform_product_result<LhsMode,RhsMode>::Mode };
1400 typedef Transform<Scalar,Dim,LhsMode,LhsOptions> Lhs;
1401 typedef Transform<Scalar,Dim,RhsMode,RhsOptions> Rhs;
1402 typedef Transform<Scalar,Dim,ResultMode,LhsOptions> ResultType;
1403 static ResultType run(
const Lhs& lhs,
const Rhs& rhs)
1406 res.linear() = lhs.linear() * rhs.linear();
1407 res.translation() = lhs.linear() * rhs.translation() + lhs.translation();
1413 template<
typename Scalar,
int Dim,
int LhsMode,
int LhsOptions,
int RhsMode,
int RhsOptions>
1414 struct transform_transform_product_impl<Transform<Scalar,Dim,LhsMode,LhsOptions>,Transform<Scalar,Dim,RhsMode,RhsOptions>,true >
1416 typedef Transform<Scalar,Dim,LhsMode,LhsOptions> Lhs;
1417 typedef Transform<Scalar,Dim,RhsMode,RhsOptions> Rhs;
1418 typedef Transform<Scalar,Dim,Projective> ResultType;
1419 static ResultType run(
const Lhs& lhs,
const Rhs& rhs)
1421 return ResultType( lhs.matrix() * rhs.matrix() );
1425 template<
typename Scalar,
int Dim,
int LhsOptions,
int RhsOptions>
1426 struct transform_transform_product_impl<Transform<Scalar,Dim,
AffineCompact,LhsOptions>,Transform<Scalar,Dim,
Projective,RhsOptions>,true >
1428 typedef Transform<Scalar,Dim,AffineCompact,LhsOptions> Lhs;
1429 typedef Transform<Scalar,Dim,Projective,RhsOptions> Rhs;
1430 typedef Transform<Scalar,Dim,Projective> ResultType;
1431 static ResultType run(
const Lhs& lhs,
const Rhs& rhs)
1434 res.matrix().template topRows<Dim>() = lhs.matrix() * rhs.matrix();
1435 res.matrix().row(Dim) = rhs.matrix().row(Dim);
1440 template<
typename Scalar,
int Dim,
int LhsOptions,
int RhsOptions>
1441 struct transform_transform_product_impl<Transform<Scalar,Dim,
Projective,LhsOptions>,Transform<Scalar,Dim,
AffineCompact,RhsOptions>,true >
1443 typedef Transform<Scalar,Dim,Projective,LhsOptions> Lhs;
1444 typedef Transform<Scalar,Dim,AffineCompact,RhsOptions> Rhs;
1445 typedef Transform<Scalar,Dim,Projective> ResultType;
1446 static ResultType run(
const Lhs& lhs,
const Rhs& rhs)
1448 ResultType res(lhs.matrix().template leftCols<Dim>() * rhs.matrix());
1449 res.matrix().col(Dim) += lhs.matrix().col(Dim);
1458 #endif // EIGEN_TRANSFORM_H