aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/geo_homogeneous.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-06-08 15:43:41 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-06-08 15:43:41 +0200
commit8f031a3cee9336ecc3fac1134da90a3d77866192 (patch)
tree2e111171cdce6cd1ee1263e4d44026f969b89951 /test/geo_homogeneous.cpp
parente6c5723dcdf81154c9d1bc0f7e4a1a18f2a4ef98 (diff)
bug #997: add missing evaluators for m.lazyProduct(v.homogeneous())
Diffstat (limited to 'test/geo_homogeneous.cpp')
-rw-r--r--test/geo_homogeneous.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp
index 2f9d18c0f..bf63c69ec 100644
--- a/test/geo_homogeneous.cpp
+++ b/test/geo_homogeneous.cpp
@@ -94,6 +94,21 @@ template<typename Scalar,int Size> void homogeneous(void)
VERIFY_IS_APPROX((aff * pts2).colwise().hnormalized(), aff * pts2.colwise().hnormalized());
VERIFY_IS_APPROX((caff * pts2).colwise().hnormalized(), caff * pts2.colwise().hnormalized());
VERIFY_IS_APPROX((proj * pts2).colwise().hnormalized(), (proj * pts2.colwise().hnormalized().colwise().homogeneous()).colwise().hnormalized());
+
+ // Test combination of homogeneous
+
+ VERIFY_IS_APPROX( (t2 * v0.homogeneous()).hnormalized(),
+ (t2.template topLeftCorner<Size,Size>() * v0 + t2.template topRightCorner<Size,1>())
+ / ((t2.template bottomLeftCorner<1,Size>()*v0).value() + t2(Size,Size)) );
+
+ VERIFY_IS_APPROX( (t2 * pts.colwise().homogeneous()).colwise().hnormalized(),
+ (Matrix<Scalar, Size+1, Dynamic>(t2 * pts1).colwise().hnormalized()) );
+
+ VERIFY_IS_APPROX( (t2 .lazyProduct( v0.homogeneous() )).hnormalized(), (t2 * v0.homogeneous()).hnormalized() );
+ VERIFY_IS_APPROX( (t2 .lazyProduct ( pts.colwise().homogeneous() )).colwise().hnormalized(), (t2 * pts1).colwise().hnormalized() );
+
+ VERIFY_IS_APPROX( (v0.transpose().homogeneous() .lazyProduct( t2 )).hnormalized(), (v0.transpose().homogeneous()*t2).hnormalized() );
+ VERIFY_IS_APPROX( (pts.transpose().rowwise().homogeneous() .lazyProduct( t2 )).rowwise().hnormalized(), (pts1.transpose()*t2).rowwise().hnormalized() );
}
void test_geo_homogeneous()