Adds a ParallelFor wrapper for no threads and OpenMP.

With the addition of C++11 support we can simplify the parallel for code by
removing the ifdef branching.  Converts coordinate_descent_minimizer.cc to use
the thread_id ParallelFor API.

Tested by building with OpenMP, C++11 threads, TBB, and no threads.  All tests
pass.

Also compared timing via the bundle adjuster.

./bin/bundle_adjuster --input=../problem-744-543562-pre.txt

With OpenMP num_threads=8

Head:
Time (in seconds):
  Residual only evaluation           0.807753 (5)
  Jacobian & residual evaluation     4.489404 (6)
  Linear solver                     41.826481 (5)
Minimizer                           50.745857
Total                               73.294424

CL:
Time (in seconds):
  Residual only evaluation           0.970483 (5)
  Jacobian & residual evaluation     4.647438 (6)
  Linear solver                     41.781892 (5)
Minimizer                           50.848904
Total                               73.089983

With OpenMP num_threads=1

HEAD:
Time (in seconds):
  Residual only evaluation           2.990246 (5)
  Jacobian & residual evaluation    14.132090 (6)
  Linear solver                     79.631951 (5)
Minimizer                          100.281847
Total                              122.946267

CL:
Time (in seconds):
  Residual only evaluation           3.075178 (5)
  Jacobian & residual evaluation    13.966451 (6)
  Linear solver                     77.005441 (5)
Minimizer                           97.568712
Total                              120.410454

Change-Id: I1857d7943073be7465b6c6476bf46ab11c5475a3
9 files changed
tree: 4bd48ad6864f19b75ca91a2f3a30fb31fccfa696
  1. bazel/
  2. cmake/
  3. config/
  4. data/
  5. docs/
  6. examples/
  7. include/
  8. internal/
  9. jni/
  10. scripts/
  11. .gitignore
  12. BUILD
  13. CMakeLists.txt
  14. LICENSE
  15. package.xml
  16. README.md
  17. WORKSPACE
README.md

Ceres Solver

Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.

  1. Non-linear Least Squares problems with bounds constraints.
  2. General unconstrained optimization problems.

Please see ceres-solver.org for more information.

WARNING - Do not make GitHub pull requests!

Ceres development happens on Gerrit, including both repository hosting and code reviews. The GitHub Repository is a continuously updated mirror which is primarily meant for issue tracking. Please see our Contributing to Ceres Guide for more details.

The upstream Gerrit repository is

https://ceres-solver.googlesource.com/ceres-solver