A hacky fix for the Eigen::FullPivLU changes. Changes in Eigen's implementation for FullPivLU significantly degraded the performance of the line search as reported by Weiguang. We do not completely understand what is going on, as Eigen's changes seem sane. So for now, this change explicitly works around the changes made by Eigen to restore the performance of the line search. Figuring out the underlying problem and fixing it remains an open issue. https://github.com/ceres-solver/ceres-solver/issues/248 Change-Id: I9993d73a09dc990ab567ce6bc447f16eac74abec
diff --git a/internal/ceres/polynomial.cc b/internal/ceres/polynomial.cc index 13bf8ed..aef17bb 100644 --- a/internal/ceres/polynomial.cc +++ b/internal/ceres/polynomial.cc
@@ -370,7 +370,10 @@ } } - return lhs.fullPivLu().solve(rhs); + // TODO(sameeragarwal): This is a hack. + // https://github.com/ceres-solver/ceres-solver/issues/248 + Eigen::FullPivLU<Matrix> lu(lhs); + return lu.setThreshold(0.0).solve(rhs); } void MinimizeInterpolatingPolynomial(const vector<FunctionSample>& samples,