covariance.h was using SUITE_SPARSE even when SUITESPARSE
was disabled because it did not have config.h included in it
so it did not see that CERES_NO_SUITESPARSE was defined.
Add more config.h includes to files that are using these
configuration macros.
Change-Id: I6b1d2c2bd9e559de40a6332cd6be85ad4da3377b
Also refactor the logic for generating ba tests a bit
breaking it into dense, sparse and iterative tests.
Change-Id: I6b33e3b047ef900b12907bd150febe4744779b7a
- update file generator scripts / templates so generated files adhere
to clang-format
- A few exceptions are not fixed, where the file generation results in
lines of different width. To properly fix this would make the code
more complicated and it's not that important for generated files
anyway.
- note that generated files are excluded in ./scripts/format_all.sh
Change-Id: I4f42c83d1fec01242eada5e7ce6c1a5192234d37
CLUSTER_JACOBI and CLUSTER_TRIDIAGONAL preconditioners require a sparse
Cholesky factorization library. Previously this code was hard coded to
use SuiteSparse. Once SparseCholesky abstraction was introduced, it
became possible to use it with Eigen or CXSParse.
Unfortunately the old code path that was enforcing the requirement
of SuiteSparse was not removed.
This change does the following:
1. Remove the SUITE_SPARSE restriction on CLUSTER_TRIDIAGONAL and
CLUSTER_JACOBI
2. Redo the checking code to be ifdef free and more general.
3. Add bundle adjustment tests to test these configurations.
Thanks to Bjorn Piltz for catching and reporting this bug.
Change-Id: I637791f6f8149694b6aa75f6a4b6417398cb9590
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
This converts the bundle_adjustment_test to the parallel
version with multiple binaries, as is already in place for
the Bazel build. Additionally, since there is no longer a
need for it, this deletes bundle_adjustment_test.cc.
The test suite now runs on my 6 year old desktop in ~60 seconds!
Change-Id: Ib4a59f8749e823f697e6da5d303977d284303ae3
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