mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Update Umeyama.h: src_var is only used when with_scaling == true. Therefore, the actual computation can be avoided when with_scaling == false.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
ffb78e23a1
commit
d04edff570
@@ -124,9 +124,6 @@ umeyama(const MatrixBase<Derived>& src, const MatrixBase<OtherDerived>& dst, boo
|
||||
const RowMajorMatrixType src_demean = src.colwise() - src_mean;
|
||||
const RowMajorMatrixType dst_demean = dst.colwise() - dst_mean;
|
||||
|
||||
// Eq. (36)-(37)
|
||||
const Scalar src_var = src_demean.rowwise().squaredNorm().sum() * one_over_n;
|
||||
|
||||
// Eq. (38)
|
||||
const MatrixType sigma = one_over_n * dst_demean * src_demean.transpose();
|
||||
|
||||
@@ -146,6 +143,9 @@ umeyama(const MatrixBase<Derived>& src, const MatrixBase<OtherDerived>& dst, boo
|
||||
|
||||
if (with_scaling)
|
||||
{
|
||||
// Eq. (36)-(37)
|
||||
const Scalar src_var = src_demean.rowwise().squaredNorm().sum() * one_over_n;
|
||||
|
||||
// Eq. (42)
|
||||
const Scalar c = Scalar(1)/src_var * svd.singularValues().dot(S);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user