umeyama sometimes returns a reflection
Submitted by Charles Karney
Assigned to Nobody
Link to original bugzilla bug (#774)
Version: 3.2
Description
Created attachment 445
Patch to umeyama to address reflection bug
The following code
const int m = 3;
const int n = 3;
Matrix<double, m, n> x, y;
x <<
0, 1,-1,
0, 0, 0,
0, 0, 0;
y <<
0,-1, 1,
0, 0, 0,
0, 0, 0;
Matrix<double, m+1, m+1> ta = umeyama(x, y, false);
returns a matrix with a determinant of -1. Umeyama's paper doesn't
properly explain how to deal with this case. Basically everywhere he
says rank(AB^T) = m - 1, he means to say rank(AB^T) < m. The attached
patch (against version 3.2.1) fixes this bug. Note that I don't look at
the sign of determinant of sigma at all. This is too subject to
errors.
Patch 445, "Patch to umeyama to address reflection bug":
umeyama-reflection-bug.patch
Edited by Eigen Bugzilla