Commit Graph

14 Commits

Author SHA1 Message Date
Sameer Agarwal 3c4f012606 ClangTidy fixes #2
Change-Id: Ib3baa62248342276d63b900b45561323fd81402d
2024-07-21 20:31:32 -07:00
Sameer Agarwal 0a53aa9054 Take abseil as a dependency
1. Add abseil-cpp as a submodule. We are tracking the latest LTS
release, which is lts_2024_01_16.
2. Replace glog/gflags with absl::log and absl::flags.
3. Remove miniglog
4. Also take a whack at making the bazel build work with
   abseil-cpp and gtest.

There are a number of TODOs in this CL that still need to be resolved.

Change-Id: I39355ed7d61375be4ebcbc8596d9cc70acc1c678
2024-07-18 00:24:49 -07:00
Sameer Agarwal 5a30cae583 Preparing for 2.2.0rc1
1. Add a version history
2. Update copyright years across the code base
3. Run format_all.sh
4. Update version strings from 2.1.0 to 2.2.0 in the docs and
   elsewhere.

Change-Id: I46d8d479d54bd6002d532785e67342106e73c9ac
2023-09-21 11:23:38 -07:00
Sameer Agarwal 9602ed7b76 ClangFormat changes
Change-Id: I88c9e38b0450aed26c60e1dd54964ab6571e3eef
2023-01-14 05:54:24 -08:00
Alexander Ivanov 53df5ddcfd Removing using std::...
Change-Id: I584402e2a34869183c1d59071a15d97b216c52fb
2023-01-11 16:51:38 +00:00
Dmitriy Korchemkin fef6d5875b Parallel left products for PartitionedMatrixView
Parallel left products for PartitionedMatrixView using parallel for
loops with fair partitioning.
Updates for evaluation benchmark including replacing program with a
preprocessed one

Change-Id: Ia1cc3293f106cec6b7d933675cea4e7c5a6b71e4
2022-11-14 18:37:46 +03:00
Alex Stewart 89b3e1f88f Remove unused includes of gflags and gtest
Change-Id: Ie299a043c1095db4f85bd434f4bd9517e7641e06
2022-10-31 19:30:48 +00:00
Dmitriy Korchemkin b7116824b7 Evaluation benchmark
Benchmark for evaluation of residuals and evaluation of both residuals
and jacobian.

For each input file (in BAL format) specified on the command line two
sets of benchmarks are created for different number of threads.

BAL data is preloaded before starting benchmark.

Usage:
./bin/evaluation_benchmark [flags] input_1.txt ... input_N.txt

Change-Id: I543df65f483e3b186f52785b68bd5e2b3e3552a3
2022-09-21 13:40:03 +03:00
Sergiu Deitsch c8658c8992 Modernize more
Apply clang-tidy Google and modernize fixes without trailing return type
using:

$ clang-tidy -p <build-dir> \
  -checks='-*,google-*,modernize-*,-modernize-use-trailing-return-type' {} -fix

Change-Id: I7450cc58ea9abf928f73a467e87876083217fa26
2022-02-26 22:16:56 +00:00
Sergiu Deitsch f90833f5fa Simplify symbol export
Currently, the logic for exporting symbols is rather complicated: when
tests are enabled internal symbols are exported in addition to the
public symbols. Such logic causes several problems. (1) Test binaries
link against a Ceres build that is different from the final release
since fewer optimizations are applied if more symbols are exported. (2)
Also, some toolchains hide symbols by default breaking the existing
logic eventually causing linker errors.

Since internal symbols are not intended to be used outside of the
project, we can compile them into object files and use exactly the same
binary code both for the final build and the tests without relying on
conditionals.

By default, all symbols are now hidden unless annotated as public.
Internal symbols are explicitly marked as not being exported in case
users chose not to hide symbols by default.

Change-Id: I589dd10be2f6f438508783cf99d141af0120057b
2022-02-14 20:19:08 +01:00
Sameer Agarwal ae65219e04 ClangTidy cleanups
1. NULL -> nullptr
2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>()
3. Missing std library includes & prefixes

Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
2022-02-09 10:06:49 -08:00
Nikolaus Demmel 7b8f675bfd fix formatting for (non-generated) internal source files
- Change formatting standard to Cpp11. Main difference is not having
  the space between two closing >> for nested templates. We don't
  choose c++14, because older versions of clang-format (version 9
  and earlier) don't know this value yet, and it doesn't make a
  difference in the formatting.
- Apply clang-format to all (non generated) internal source files.
- Manually fix some code sections (clang-format on/off) and c-strings
- Exclude some embedded external files with very different formatting
  (gtest/gmock)
- Add script to format all source files

Change-Id: Ic6cea41575ad6e37c9e136dbce176b0d505dc44d
2020-09-21 02:52:07 +02:00
Kuang Fangjun 86b27228bf close the file on return.
See https://github.com/ceres-solver/ceres-solver/issues/425

Change-Id: I7d02a07d36608c25db191de31f47f19b33962040
2018-09-23 03:01:49 +00: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