aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/umeyama.cpp
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-02-17 13:48:00 +0100
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-02-17 13:48:00 +0100
commitb14a4628aff4b92761229c862a331342a2bb518b (patch)
tree2820a60e68fee983ee4551be8f581c7dccb6c76c /test/umeyama.cpp
parent3573a107120c3762c1f9b6b17f62d817ee1a9ec0 (diff)
Relaxed umeyama test. Problem was ill-posed if linear part was scaled with very small number. This should fix bug #744.
Diffstat (limited to 'test/umeyama.cpp')
-rw-r--r--test/umeyama.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/umeyama.cpp b/test/umeyama.cpp
index 738d0af70..2e8092434 100644
--- a/test/umeyama.cpp
+++ b/test/umeyama.cpp
@@ -130,10 +130,11 @@ void run_fixed_size_test(int num_elements)
// MUST be positive because in any other case det(cR_t) may become negative for
// odd dimensions!
- const Scalar c = abs(internal::random<Scalar>());
+ // Also if c is to small compared to t.norm(), problem is ill-posed (cf. Bug 744)
+ const Scalar c = internal::random<Scalar>(0.5, 2.0);
FixedMatrix R = randMatrixSpecialUnitary<Scalar>(dim);
- FixedVector t = Scalar(50)*FixedVector::Random(dim,1);
+ FixedVector t = Scalar(32)*FixedVector::Random(dim,1);
HomMatrix cR_t = HomMatrix::Identity(dim+1,dim+1);
cR_t.block(0,0,dim,dim) = c*R;
@@ -149,9 +150,9 @@ void run_fixed_size_test(int num_elements)
HomMatrix cR_t_umeyama = umeyama(src_block, dst_block);
- const Scalar error = ( cR_t_umeyama*src - dst ).array().square().sum();
+ const Scalar error = ( cR_t_umeyama*src - dst ).squaredNorm();
- VERIFY(error < Scalar(10)*std::numeric_limits<Scalar>::epsilon());
+ VERIFY(error < Scalar(16)*std::numeric_limits<Scalar>::epsilon());
}
void test_umeyama()