diff --git a/gtsam/sfm/ShonanAveraging.cpp b/gtsam/sfm/ShonanAveraging.cpp index 53f8f6b6c..fb96498ef 100644 --- a/gtsam/sfm/ShonanAveraging.cpp +++ b/gtsam/sfm/ShonanAveraging.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include @@ -553,7 +553,7 @@ static bool PowerMinimumEigenValue( return true; } - const Sparse C = pmEigenValue * Matrix::Identity(A.rows(), A.cols()) - A; + const Sparse C = pmEigenValue * Matrix::Identity(A.rows(), A.cols()).sparseView() - A; const boost::optional initial = perturb(S.row(0)); AcceleratedPowerMethod apmShiftedOperator(C, initial);