Skip to content

Commit 3bc97e4

Browse files
Fix: updated jacobi as template (backport #560)
Squashed the following cherry-picked commits: (cherry picked from commit 961e2f6) (cherry picked from commit f048f92) (cherry picked from commit 2cda290) (cherry picked from commit b59d445) Signed-off-by: miguelgonrod <miguelgonrod2004@gmail.com> Co-authored-by: miguelgonrod <miguelgonrod2004@gmail.com> (cherry picked from commit 91171df)
1 parent 520d266 commit 3bc97e4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/DopplerVelocityLog.cc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,9 +1570,11 @@ namespace gz
15701570
if (numBeamsLocked >= 3)
15711571
{
15721572
// Enough rows for a unique least squares solution
1573-
const auto svdDecomposition =
1574-
beamBasis.topRows(numBeamsLocked).jacobiSvd(
1575-
Eigen::ComputeThinU | Eigen::ComputeThinV);
1573+
const Eigen::MatrixXd svdMat =
1574+
beamBasis.topRows(numBeamsLocked).eval();
1575+
using SvdT = Eigen::JacobiSVD<Eigen::MatrixXd>;
1576+
const SvdT svdDecomposition(svdMat,
1577+
Eigen::ComputeThinU | Eigen::ComputeThinV);
15761578

15771579
// Estimate DVL velocity mean and covariance in the reference frame
15781580
const Eigen::Vector3d velocityMeanInReferenceFrame =
@@ -1798,9 +1800,11 @@ namespace gz
17981800
if (numBeamsLocked >= 3)
17991801
{
18001802
// Enough rows for a unique least squares solution
1801-
const auto svdDecomposition =
1802-
beamBasis.topRows(numBeamsLocked).jacobiSvd(
1803-
Eigen::ComputeThinU | Eigen::ComputeThinV);
1803+
const Eigen::MatrixXd svdMat =
1804+
beamBasis.topRows(numBeamsLocked).eval();
1805+
using SvdT = Eigen::JacobiSVD<Eigen::MatrixXd>;
1806+
const SvdT svdDecomposition(svdMat,
1807+
Eigen::ComputeThinU | Eigen::ComputeThinV);
18041808

18051809
// Estimate DVL velocity mean and covariance in the reference frame
18061810
const Eigen::Vector3d velocityMeanInReferenceFrame =

0 commit comments

Comments
 (0)