Replace ceres::String* with their more modern and performant
absl strings library equivalent and delete our string
manipulation library.
Change-Id: Iecbdba9864e0abf329778f81fdc0708f78f7594f
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
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
This patch adds end-to-end tests for the autodiff codegen system.
First, code is generated for various functors. This code is then
executed with different arguments and the result is compared
to traditional autodiff.
Change-Id: Icba9996ece26384a795d5b50480ec8194cab572f
The way the SystemTest fixture works is that it takes
a "FooProblem" object as a type, which contains a ceres::Problem
and a ceres::Solver::Options object.
The Options object also contains a linear_solver_ordering which
contains double* which refer to memory that is allocated when
a problem object is created.
So it is important that the lifetime of the ceres::Problem object
and the ceres::Solver::Options object be tied together. But we were
violating this by creating a FooProblem object on the stack, grabbing
its Options struct and passing it to the SystemTest fixture, which
would then create another instance of FooProblem, grab its Problem
object and copy the modified options struct into it.
In the case where a user provided ordering was being used,
this ordering would now be referring to memory allocated by the first
FooProblem object, which would cause Ceres's internal ApplyOrdering
function to fail.
The fix is ofcourse to Problem and Options object that are born
together.
Change-Id: I07c377a9d5fcabbb6c7ca8aa3460206ce045ffa9
1. Remove SolverConfig, this was a wrapper
around Solver::Options. As we experiment
with more Solver::Options, it became a hurdle.
2. Updated generate_bundle_adjustment_tests.py to use
Solver::Options directly.
3. Update system_test to use Solver::Options.
NOTE: generate_bundle_adjustment_tests.py changes are a bit
gunky, but I tried to minimize the changes in this CL
as I am going to introduce new test cases and that
is going to significantly change this file.
Change-Id: I34a2f51824b04ef368a5bbe54fbd7b281381909e
1. Solver::Options::num_threads now controls parallelism in Ceres
Solver. The user specified value of
Solver::Options::num_linear_solver_threads is ignored.
2. If the user specifies Solver::Options::num_linear_solver_threads
and it is different from Solver::Options::num_threads,
a warning is printed.
3. Solver::Summary:num_linear_solver_threads_given and
Solver::Summary::num_linear_solver_threads_used are also
deprecated and are always set to Solver::Summary::num_threads_given
and Solver::Summary::num_threads_used.
Change-Id: I20b9336d9336e400e6f0a15b63857c0c43eb271c
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
1. Move common test infrastructure into test_util.
2. system_test now only contains powells function.
3. Add bundle_adjustment_test.
Instead of a single function which computes everything,
there is now a test for each solver configuration which
uses the reference solution computed by the fixture.
Change-Id: I16a9a9a83a845a7aaf28762bcecf1a8ff5aee805
Since Ceres is moving to using GitHub for issues, and the Google
Code URL in the current copyright header will soon become invalid,
update all the headers.
Change-Id: I1fce70375d1bcf098591f07b4d8f01a5c1e0789c