Lint changes from William Rucklidge
Update documentation for
Solver::Options::max_num_line_search_step_size_iterations
Change-Id: I03edc74e67940bed0be7e5ccaffed9e97114a5a5
diff --git a/docs/source/nnls_solving.rst b/docs/source/nnls_solving.rst
index 713d54d..fde62b9 100644
--- a/docs/source/nnls_solving.rst
+++ b/docs/source/nnls_solving.rst
@@ -992,6 +992,11 @@
search, if a step size satisfying the search conditions cannot be
found within this number of trials, the line search will stop.
+ The minimum allowed value is 0 for trust region minimizer and 1
+ otherwise. If 0 is specified for the trust region minimizer, then
+ line search will not be used when solving constrained optimization
+ problems.
+
As this is an 'artificial' constraint (one imposed by the user, not
the underlying math), if ``WOLFE`` line search is being used, *and*
points satisfying the Armijo sufficient (function) decrease
diff --git a/include/ceres/solver.h b/include/ceres/solver.h
index 2141cc4..f0efeb4 100644
--- a/include/ceres/solver.h
+++ b/include/ceres/solver.h
@@ -188,14 +188,15 @@
//
double min_line_search_step_contraction = 0.6;
- // Maximum number of trial step size iterations during each line search,
- // if a step size satisfying the search conditions cannot be found within
- // this number of trials, the line search will terminate.
- //
+ // Maximum number of trial step size iterations during each line
+ // search, if a step size satisfying the search conditions cannot
+ // be found within this number of trials, the line search will
+ // terminate.
+
// The minimum allowed value is 0 for trust region minimizer and 1
// otherwise. If 0 is specified for the trust region minimizer,
- // the line search use when solving constrained optimization
- // problems will be disabled.
+ // then line search will not be used when solving constrained
+ // optimization problems.
int max_num_line_search_step_size_iterations = 20;
// Maximum number of restarts of the line search direction algorithm before
diff --git a/internal/ceres/invert_psd_matrix.h b/internal/ceres/invert_psd_matrix.h
index bbf52fe..2a61c60 100644
--- a/internal/ceres/invert_psd_matrix.h
+++ b/internal/ceres/invert_psd_matrix.h
@@ -54,7 +54,7 @@
using MType = typename EigenTypes<kSize, kSize>::Matrix;
const int size = m.rows();
- // If the matrix can be assumed to be full rank, then if its small
+ // If the matrix can be assumed to be full rank, then if it is small
// (< 5) and fixed size, use Eigen's optimized inverse()
// implementation.
//
diff --git a/internal/ceres/invert_psd_matrix_benchmark.cc b/internal/ceres/invert_psd_matrix_benchmark.cc
index 5aab6b6..02a19f3 100644
--- a/internal/ceres/invert_psd_matrix_benchmark.cc
+++ b/internal/ceres/invert_psd_matrix_benchmark.cc
@@ -62,9 +62,9 @@
BENCHMARK_TEMPLATE(BenchmarkFixedSizedInvertPSDMatrix, 11);
BENCHMARK_TEMPLATE(BenchmarkFixedSizedInvertPSDMatrix, 12);
-
void BenchmarkDynamicallyInvertPSDMatrix(benchmark::State& state) {
- using MatrixType = typename EigenTypes<Eigen::Dynamic, Eigen::Dynamic>::Matrix;
+ using MatrixType =
+ typename EigenTypes<Eigen::Dynamic, Eigen::Dynamic>::Matrix;
const int size = state.range(0);
MatrixType input = MatrixType::Random(size, size);
input += input.transpose() + MatrixType::Identity(size, size);
diff --git a/internal/ceres/invert_psd_matrix_test.cc b/internal/ceres/invert_psd_matrix_test.cc
index 0078e21..9ca38e3 100644
--- a/internal/ceres/invert_psd_matrix_test.cc
+++ b/internal/ceres/invert_psd_matrix_test.cc
@@ -42,7 +42,8 @@
template <int kSize>
typename EigenTypes<kSize, kSize>::Matrix RandomPSDMatrixWithEigenValues(
const typename EigenTypes<kSize>::Vector& eigenvalues) {
- typename EigenTypes<kSize, kSize>::Matrix m(eigenvalues.rows(), eigenvalues.rows());
+ typename EigenTypes<kSize, kSize>::Matrix m(eigenvalues.rows(),
+ eigenvalues.rows());
m.setRandom();
Eigen::SelfAdjointEigenSolver<typename EigenTypes<kSize, kSize>::Matrix> es(
m);
@@ -64,7 +65,8 @@
eigenvalues = eigenvalues.array().abs().matrix();
const Matrix m = RandomPSDMatrixWithEigenValues<5>(eigenvalues);
const Matrix inverse_m = InvertPSDMatrix<5>(kFullRank, m);
- EXPECT_NEAR((m * inverse_m - Matrix::Identity(5,5)).norm() / 5.0, 0.0,
+ EXPECT_NEAR((m * inverse_m - Matrix::Identity(5, 5)).norm() / 5.0,
+ 0.0,
10 * std::numeric_limits<double>::epsilon());
}
@@ -88,7 +90,8 @@
eigenvalues = eigenvalues.array().abs().matrix();
const Matrix m = RandomPSDMatrixWithEigenValues<Eigen::Dynamic>(eigenvalues);
const Matrix inverse_m = InvertPSDMatrix<Eigen::Dynamic>(kFullRank, m);
- EXPECT_NEAR((m * inverse_m - Matrix::Identity(5,5)).norm() / 5.0, 0.0,
+ EXPECT_NEAR((m * inverse_m - Matrix::Identity(5, 5)).norm() / 5.0,
+ 0.0,
10 * std::numeric_limits<double>::epsilon());
}