Commit Graph

17 Commits

Author SHA1 Message Date
Sameer Agarwal 0141ca090c Deprecate LocalParameterizations
Add [[deprecate]] notices to everything LocalParameterization
related.

Make sure that Ceres can be compiled without triggering
deprecation warnings.

Update the documentation:

a. Add deprecation notices.
b. Document interaction between LocalParameterization and Manifold
   coexisting in the Problem.
c. Add documentation for Manifold(s)

Change-Id: Ie4ad48963c83fded86e533c8c60561af402fbaff
2022-02-10 06:36:47 -08:00
Sameer Agarwal e6e6ae0878 Unbreak the bazel build
Change-Id: I456f6441ede61d111550a7cc29663091d743d371
2022-01-24 13:16:00 -08:00
Sameer Agarwal bf47e1a368 Fix the Bazel build.
1. Fix the path to eigen, now that it uses gitlab instead of bitbucket.
2. Remove an unrecognized compiler option.
3. Remove an obsolete benchmark.

This CL only unbreaks the build, it is likely that it is still not
at par with the cmake build.

https://github.com/ceres-solver/ceres-solver/issues/628

Change-Id: I470209cbb48b6a4f499564a86b52436e0c8d98ef
2020-10-13 10:01:57 -07:00
Sameer Agarwal 86814ab193 Add Iterative Refinement
Add a class IterativeRefiner which implements iterative refinement
for SPD linear systems.

Change-Id: I705d4e96cb7de9226ee35e2a9c11d98ffc0ee239
2018-04-06 16:51:14 -07:00
Keir Mierle 7bdceb46cf Evaluation callback API
This adds a callback mechanism to for users to get notified just
before jacobian and residual evaluations. This will enable
aggressive caching and sharing of compute between cost functions.

Change-Id: I67993726920218edf71ab9ae70c34c204756c71a
2018-03-07 12:41:22 -08:00
William Rucklidge 21f519d009 Improve threading in covariance.
Covariance computation wants to do a triangular iteration but as a
single loop. Right now it iterates over a square and does nothing half
the time, which is inefficient and has bad worst-case threading
performance. This adds a utility that allows waste-free linear iteration
over a triangle.

Change-Id: I881d5683c65882f87dc2b5f8449a855d22ace755
2018-03-02 13:33:19 -08:00
Keir Mierle 22fa21c6f8 Build benchmarks with Bazel
Change-Id: I559cc1aa17d5be01dcff931e05b22e0dd9e248b6
2018-02-25 15:18:26 -08:00
Keir Mierle a3b1e19c2c Add examples to the Bazel build
Also moves the gflags namespace define
into the ceres_library() target.

Change-Id: Ibb8f3fdd9a8c371fe96b475f752f8320ffe63cdc
2018-02-25 14:55:27 -08:00
Mike Vitus 126e0ef0fe Adds missing source and tests to bazel build.
Change 12060 added parallel_for_tbb.cc and parallel_for_test.cc but did not add
it to the bazel build rule.

Tested by running bazel tests.

Change-Id: I286cf0e191e0353f2c0266911a79e01f09e47343
2018-02-22 11:08:50 -08:00
Mike Vitus 27789c0d96 Adds a ThreadPool and a thread-safe ConcurrentQueue.
This is in preparation for adding support for a C++11 based parallel
for implementation. The code is behind CERES_USE_CXX11_THREADS which
is not exposed to the user yet.

Tested by building with and without CERES_USE_CXX11_THREADS defined
and the tests pass.

Change-Id: I60f5730fa055feeb0ee0fa6c980633aebd8d87b4
2018-02-21 15:40:06 -08:00
Sameer Agarwal 9d02b76dce An implementation of SubsetPreconditioner.
The key idea being, use some subset of the rows of the Jacobian
as the preconditioner.

This CL only implements the preconditioner assuming that the row
selection has already been done. How the rows are selected will be
left to the user based on their knowledge of the problem.

A follow up CL will hook this preconditioner into the rest of the
solver.

Change-Id: I3e18dc57811116534e9ddf35d7b154bcce496d3b
2018-02-21 13:58:45 -08:00
Keir Mierle 8549c88d7c Split bundle adjustment tests into individual binaries
The bundle adjustment test is extremely slow to
run (especially in debug or fastbuild), and since
it is in one binary, there is no way to get CMake
or Bazel to parallelize the test execution.

This change divides the test into a single binary
for each configuration, making parallelized
execution possible.

In this patch, only the Bazel build is updated to
use the new test. The old test still exists to
retain parity with the CMake build. A followup
change will complete the process of adding
equivalent test execution to the CMake build.

Example build output:

% bazel test -c opt :all
INFO: Analysed 123 targets (15 packages loaded).
INFO: Found 2 targets and 121 test targets...
INFO: From Compiling external/com_github_google_glog/src/logging.cc:
external/com_github_google_glog/src/logging.cc: In static member function 'static void google::LogMessage::Fail()':
external/com_github_google_glog/src/logging.cc:1518:1: warning: 'noreturn' function does return
 }
 ^
INFO: Elapsed time: 98.056s, Critical Path: 23.80s
INFO: Build completed successfully, 976 total actions
//:array_utils_test                                                      PASSED in 0.1s
//:autodiff_cost_function_test                                           PASSED in 0.2s
//:autodiff_local_parameterization_test                                  PASSED in 0.2s
//:autodiff_test                                                         PASSED in 0.1s
//:ba_denseschur_auto_test                                               PASSED in 5.3s
//:ba_denseschur_auto_threads_test                                       PASSED in 0.1s
//:ba_denseschur_user_test                                               PASSED in 5.3s
//:ba_denseschur_user_threads_test                                       PASSED in 0.1s
//:ba_iterschur_jacobi_auto_test                                         PASSED in 6.2s
//:ba_iterschur_jacobi_auto_threads_test                                 PASSED in 0.1s
//:ba_iterschur_jacobi_user_test                                         PASSED in 6.0s
//:ba_iterschur_jacobi_user_threads_test                                 PASSED in 0.2s
//:ba_iterschur_schurjacobi_auto_test                                    PASSED in 6.1s
//:ba_iterschur_schurjacobi_auto_threads_test                            PASSED in 0.2s
//:ba_iterschur_schurjacobi_user_test                                    PASSED in 5.7s
//:ba_iterschur_schurjacobi_user_threads_test                            PASSED in 0.1s
//:ba_iterschur_suitesparse_clustjacobi_auto_test                        PASSED in 0.1s
//:ba_iterschur_suitesparse_clustjacobi_auto_threads_test                PASSED in 0.1s
//:ba_iterschur_suitesparse_clustjacobi_user_test                        PASSED in 0.1s
//:ba_iterschur_suitesparse_clustjacobi_user_threads_test                PASSED in 0.1s
//:ba_iterschur_suitesparse_clusttri_auto_test                           PASSED in 0.1s
//:ba_iterschur_suitesparse_clusttri_auto_threads_test                   PASSED in 0.1s
//:ba_iterschur_suitesparse_clusttri_user_test                           PASSED in 0.1s
//:ba_iterschur_suitesparse_clusttri_user_threads_test                   PASSED in 0.1s
//:ba_sparsecholesky_cxsparse_auto_test                                  PASSED in 0.2s
//:ba_sparsecholesky_cxsparse_auto_threads_test                          PASSED in 0.2s
//:ba_sparsecholesky_cxsparse_user_test                                  PASSED in 0.1s
//:ba_sparsecholesky_cxsparse_user_threads_test                          PASSED in 0.1s
//:ba_sparsecholesky_eigensparse_auto_test                               PASSED in 0.1s
//:ba_sparsecholesky_eigensparse_auto_threads_test                       PASSED in 0.1s
//:ba_sparsecholesky_eigensparse_user_test                               PASSED in 0.2s
//:ba_sparsecholesky_eigensparse_user_threads_test                       PASSED in 0.1s
//:ba_sparsecholesky_suitesparse_auto_test                               PASSED in 0.1s
//:ba_sparsecholesky_suitesparse_auto_threads_test                       PASSED in 0.3s
//:ba_sparsecholesky_suitesparse_user_test                               PASSED in 0.1s
//:ba_sparsecholesky_suitesparse_user_threads_test                       PASSED in 0.2s
//:ba_sparseschur_cxsparse_auto_test                                     PASSED in 0.1s
//:ba_sparseschur_cxsparse_auto_threads_test                             PASSED in 0.2s
//:ba_sparseschur_cxsparse_user_test                                     PASSED in 0.1s
//:ba_sparseschur_cxsparse_user_threads_test                             PASSED in 0.2s
//:ba_sparseschur_eigensparse_auto_test                                  PASSED in 0.2s
//:ba_sparseschur_eigensparse_auto_threads_test                          PASSED in 0.2s
//:ba_sparseschur_eigensparse_user_test                                  PASSED in 0.1s
//:ba_sparseschur_eigensparse_user_threads_test                          PASSED in 0.2s
//:ba_sparseschur_suitesparse_auto_test                                  PASSED in 0.3s
//:ba_sparseschur_suitesparse_auto_threads_test                          PASSED in 0.2s
//:ba_sparseschur_suitesparse_user_test                                  PASSED in 0.2s
//:ba_sparseschur_suitesparse_user_threads_test                          PASSED in 0.2s
//:block_jacobi_preconditioner_test                                      PASSED in 0.1s
//:block_random_access_dense_matrix_test                                 PASSED in 0.2s
//:block_random_access_diagonal_matrix_test                              PASSED in 0.4s
//:block_random_access_sparse_matrix_test                                PASSED in 0.2s
//:block_sparse_matrix_test                                              PASSED in 0.2s
//:c_api_test                                                            PASSED in 0.2s
//:canonical_views_clustering_test                                       PASSED in 0.4s
//:compressed_col_sparse_matrix_utils_test                               PASSED in 0.3s
//:compressed_row_sparse_matrix_test                                     PASSED in 0.3s
//:conditioned_cost_function_test                                        PASSED in 0.2s
//:conjugate_gradients_solver_test                                       PASSED in 0.2s
//:corrector_test                                                        PASSED in 0.2s
//:cost_function_to_functor_test                                         PASSED in 0.1s
//:covariance_test                                                       PASSED in 0.1s
//:cubic_interpolation_test                                              PASSED in 0.2s
//:dense_linear_solver_test                                              PASSED in 0.1s
//:dense_sparse_matrix_test                                              PASSED in 0.4s
//:detect_structure_test                                                 PASSED in 0.3s
//:dogleg_strategy_test                                                  PASSED in 0.4s
//:dynamic_autodiff_cost_function_test                                   PASSED in 0.2s
//:dynamic_compressed_row_sparse_matrix_test                             PASSED in 0.2s
//:dynamic_numeric_diff_cost_function_test                               PASSED in 0.1s
//:dynamic_sparse_normal_cholesky_solver_test                            PASSED in 0.4s
//:dynamic_sparsity_test                                                 PASSED in 0.3s
//:evaluator_test                                                        PASSED in 0.2s
//:gradient_checker_test                                                 PASSED in 0.2s
//:gradient_checking_cost_function_test                                  PASSED in 0.2s
//:gradient_problem_solver_test                                          PASSED in 0.2s
//:gradient_problem_test                                                 PASSED in 0.4s
//:graph_algorithms_test                                                 PASSED in 0.4s
//:graph_test                                                            PASSED in 0.2s
//:householder_vector_test                                               PASSED in 0.2s
//:implicit_schur_complement_test                                        PASSED in 0.2s
//:inner_product_computer_test                                           PASSED in 0.3s
//:invert_psd_matrix_test                                                PASSED in 0.1s
//:is_close_test                                                         PASSED in 0.4s
//:iterative_schur_complement_solver_test                                PASSED in 0.3s
//:jet_test                                                              PASSED in 0.3s
//:levenberg_marquardt_strategy_test                                     PASSED in 0.2s
//:line_search_minimizer_test                                            PASSED in 0.2s
//:line_search_preprocessor_test                                         PASSED in 0.1s
//:local_parameterization_test                                           PASSED in 0.1s
//:loss_function_test                                                    PASSED in 0.1s
//:minimizer_test                                                        PASSED in 0.2s
//:normal_prior_test                                                     PASSED in 0.3s
//:numeric_diff_cost_function_test                                       PASSED in 0.2s
//:ordered_groups_test                                                   PASSED in 0.2s
//:parameter_block_ordering_test                                         PASSED in 0.2s
//:parameter_block_test                                                  PASSED in 0.1s
//:partitioned_matrix_view_test                                          PASSED in 0.1s
//:polynomial_test                                                       PASSED in 0.1s
//:problem_test                                                          PASSED in 0.1s
//:program_test                                                          PASSED in 0.2s
//:reorder_program_test                                                  PASSED in 0.2s
//:residual_block_test                                                   PASSED in 0.2s
//:residual_block_utils_test                                             PASSED in 0.2s
//:rotation_test                                                         PASSED in 7.1s
//:schur_complement_solver_test                                          PASSED in 0.2s
//:schur_eliminator_test                                                 PASSED in 0.2s
//:single_linkage_clustering_test                                        PASSED in 0.2s
//:small_blas_test                                                       PASSED in 0.2s
//:solver_test                                                           PASSED in 0.2s
//:sparse_cholesky_test                                                  PASSED in 0.2s
//:sparse_normal_cholesky_solver_test                                    PASSED in 0.2s
//:system_test                                                           PASSED in 0.1s
//:tiny_solver_autodiff_function_test                                    PASSED in 0.2s
//:tiny_solver_cost_function_adapter_test                                PASSED in 0.1s
//:tiny_solver_test                                                      PASSED in 0.1s
//:triplet_sparse_matrix_test                                            PASSED in 0.2s
//:trust_region_minimizer_test                                           PASSED in 0.2s
//:trust_region_preprocessor_test                                        PASSED in 0.2s
//:visibility_based_preconditioner_test                                  PASSED in 0.1s
//:visibility_test                                                       PASSED in 0.2s

Executed 121 out of 121 tests: 121 tests pass.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.

Change-Id: I32825f1e6278ba69dc296bb2dc05fb8ebda26592
2018-02-20 14:46:10 -08:00
Keir Mierle 1af2747421 Support disabling Schur specializations in Bazel build
Change-Id: If72bcd9f19ba4b44482b267e45fb2355b1a93ff0
2018-02-08 13:38:00 -08:00
Rodrigo Queiro c1075cd313 Create ceres_library() and use to provide :ceres
This doesn't add any configurability to ceres_library() yet, but it
does correctly determine the include path for use with -I, allowing
this to be used as a dependency from other workspaces.

Change-Id: I223b6e63c2ea82ab7f552337f78fffd54f20b0e0
2018-01-15 15:28:13 +01:00
Rodrigo Queiro ac22a97492 Run buildifier on BUILD/WORKSPACE
Change-Id: I80bf7025811128c0795bff3e3f5b61a355d848ba
2018-01-15 15:26:19 +01:00
Keir Mierle 3f826ef30e Switch Eigen Bazel to a separate file
Change-Id: I547037460e8ec1fa14438d655c10b261daa39d96
2018-01-12 14:09:02 -08:00
Keir Mierle 07f1405300 Add initial Bazel build, including tests.
This allows building and running the Ceres tests, without
needing any external dependencies; they are downloaded and
compiled automatically thanks to the magic of Bazel.

It also opens the door for other projects that use Ceres
easily thanks to Bazel's external dependency support.

Remaining work:
- Skylark macros to allow different Ceres configurations
- Checking to make sure external projects can use this
- Parallelizing bundle_adjustment_test execution

Sample output:

  INFO: Analysed target //:ceres (6 packages loaded).
  INFO: Found 1 target...
  Target //:ceres up-to-date:
    bazel-bin/libceres.a
    bazel-bin/libceres.so
  INFO: Elapsed time: 103.756s, Critical Path: 13.97s
  INFO: Build completed successfully, 131 total actions

Change-Id: I400d3ce43f35b7e7a770da346337e3ffdb500dc2
2018-01-12 21:36:14 +00:00