aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/umeyama.cpp
diff options
context:
space:
mode:
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()