Skip to content

Commit b7319ec

Browse files
authored
Merge pull request #560 from miguelgonrod/fix/jacobiSVD-warning
Fix: updated jacobi as template
2 parents c2f6d12 + b59d445 commit b7319ec

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
@@ -1571,9 +1571,11 @@ namespace gz
15711571
if (numBeamsLocked >= 3)
15721572
{
15731573
// Enough rows for a unique least squares solution
1574-
const auto svdDecomposition =
1575-
beamBasis.topRows(numBeamsLocked).jacobiSvd(
1576-
Eigen::ComputeThinU | Eigen::ComputeThinV);
1574+
const Eigen::MatrixXd svdMat =
1575+
beamBasis.topRows(numBeamsLocked).eval();
1576+
using SvdT = Eigen::JacobiSVD<Eigen::MatrixXd>;
1577+
const SvdT svdDecomposition(svdMat,
1578+
Eigen::ComputeThinU | Eigen::ComputeThinV);
15771579

15781580
// Estimate DVL velocity mean and covariance in the reference frame
15791581
const Eigen::Vector3d velocityMeanInReferenceFrame =
@@ -1821,9 +1823,11 @@ namespace gz
18211823
if (numBeamsLocked >= 3)
18221824
{
18231825
// Enough rows for a unique least squares solution
1824-
const auto svdDecomposition =
1825-
beamBasis.topRows(numBeamsLocked).jacobiSvd(
1826-
Eigen::ComputeThinU | Eigen::ComputeThinV);
1826+
const Eigen::MatrixXd svdMat =
1827+
beamBasis.topRows(numBeamsLocked).eval();
1828+
using SvdT = Eigen::JacobiSVD<Eigen::MatrixXd>;
1829+
const SvdT svdDecomposition(svdMat,
1830+
Eigen::ComputeThinU | Eigen::ComputeThinV);
18271831

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

0 commit comments

Comments
 (0)