aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2012-03-30 23:22:29 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2012-03-30 23:22:29 +0200
commit48f0bbb58624e3a65dc989d6e4b24ed58c4465e4 (patch)
treed8f540a1c5b8382b231e158ec546227a088224f9 /Eigen
parent63ea667ed78b35a0b59be341dc23c1d09c2fa776 (diff)
fix bug #362 and add missing specialization for affine-compact * projective
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Geometry/Transform.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h
index a9e4e3c6d..f17a639ad 100644
--- a/Eigen/src/Geometry/Transform.h
+++ b/Eigen/src/Geometry/Transform.h
@@ -61,7 +61,7 @@ template< typename Lhs,
typename Rhs,
bool AnyProjective =
transform_traits<Lhs>::IsProjective ||
- transform_traits<Lhs>::IsProjective>
+ transform_traits<Rhs>::IsProjective>
struct transform_transform_product_impl;
template< typename Other,
@@ -1395,6 +1395,35 @@ struct transform_transform_product_impl<Transform<Scalar,Dim,LhsMode,LhsOptions>
}
};
+template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
+struct transform_transform_product_impl<Transform<Scalar,Dim,AffineCompact,LhsOptions>,Transform<Scalar,Dim,Projective,RhsOptions>,true >
+{
+ typedef Transform<Scalar,Dim,AffineCompact,LhsOptions> Lhs;
+ typedef Transform<Scalar,Dim,Projective,RhsOptions> Rhs;
+ typedef Transform<Scalar,Dim,Projective> ResultType;
+ static ResultType run(const Lhs& lhs, const Rhs& rhs)
+ {
+ ResultType res;
+ res.matrix().template topRows<Dim>() = lhs.matrix() * rhs.matrix();
+ res.matrix().row(Dim) = rhs.matrix().row(Dim);
+ return res;
+ }
+};
+
+template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
+struct transform_transform_product_impl<Transform<Scalar,Dim,Projective,LhsOptions>,Transform<Scalar,Dim,AffineCompact,RhsOptions>,true >
+{
+ typedef Transform<Scalar,Dim,Projective,LhsOptions> Lhs;
+ typedef Transform<Scalar,Dim,AffineCompact,RhsOptions> Rhs;
+ typedef Transform<Scalar,Dim,Projective> ResultType;
+ static ResultType run(const Lhs& lhs, const Rhs& rhs)
+ {
+ ResultType res(lhs.matrix().template leftCols<Dim>() * rhs.matrix());
+ res.matrix().col(Dim) += lhs.matrix().col(Dim);
+ return res;
+ }
+};
+
} // end namespace internal
#endif // EIGEN_TRANSFORM_H