Optimize  the BlockCRSJacobiPreconditioner

Instead of iterating row-wise, use the row block structure
to update the preconditioner one row block at a time.

While benchmarking, I also found an opportunity to speed up
BlockSparseJacobiPreconditiner.

Before
-----------------------------------------------------------------------------------------
Benchmark                                               Time             CPU   Iterations
-----------------------------------------------------------------------------------------
BM_BlockSparseJacobiPreconditioner              132122392 ns    132103000 ns            5
BM_BlockCRSJacobiPreconditionerBA                73365217 ns     73335800 ns           10
BM_BlockSparseJacobiPreconditionerUnstructured   92407762 ns     92407714 ns            7
BM_BlockCRSJacobiPreconditionerUnstructured      72256367 ns     72256400 ns           10

After

-----------------------------------------------------------------------------------------
Benchmark                                               Time             CPU   Iterations
-----------------------------------------------------------------------------------------
BM_BlockSparseJacobiPreconditionerBA             39723456 ns     39722222 ns           18
BM_BlockCRSJacobiPreconditionerBA                46561625 ns     46561667 ns           15
BM_BlockSparseJacobiPreconditionerUnstructured   52676208 ns     52676167 ns           12
BM_BlockCRSJacobiPreconditionerUnstructured      54430564 ns     54421462 ns           13

Change-Id: I6da8e044b26f0c24481deee5722322a606e9e5ca
1 file changed
tree: b6f2a61436a50f117f0e0faee9127fce86e4e662
  1. .github/
  2. bazel/
  3. cmake/
  4. config/
  5. data/
  6. docs/
  7. examples/
  8. include/
  9. internal/
  10. scripts/
  11. .clang-format
  12. .gitignore
  13. BUILD
  14. CITATION.cff
  15. CMakeLists.txt
  16. CONTRIBUTING.md
  17. LICENSE
  18. package.xml
  19. README.md
  20. WORKSPACE
README.md

Android Linux macOS Windows

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.