From 31ae83381106a7aaee5303710b818c13f42ceddc Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 18 Jun 2020 10:12:01 +0200 Subject: Ceres: Update to the latest upstream version Using latest master because of various compilation error fixes. Brings a lot of recent development. From most interesting parts: - New threading model. - Tiny solver. - Compatibility with C++17. --- CMakeLists.txt | 2 +- extern/ceres/CMakeLists.txt | 576 +++++++------- extern/ceres/ChangeLog | 839 ++++++++++----------- extern/ceres/bundle.sh | 9 +- extern/ceres/files.txt | 81 +- .../ceres/include/ceres/autodiff_cost_function.h | 89 +-- .../include/ceres/autodiff_first_order_function.h | 151 ++++ .../ceres/autodiff_local_parameterization.h | 40 +- extern/ceres/include/ceres/c_api.h | 4 +- extern/ceres/include/ceres/ceres.h | 9 +- .../include/ceres/conditioned_cost_function.h | 16 +- extern/ceres/include/ceres/context.h | 56 ++ extern/ceres/include/ceres/cost_function.h | 27 +- .../ceres/include/ceres/cost_function_to_functor.h | 612 ++------------- extern/ceres/include/ceres/covariance.h | 79 +- extern/ceres/include/ceres/crs_matrix.h | 5 +- extern/ceres/include/ceres/cubic_interpolation.h | 436 +++++++++++ .../include/ceres/dynamic_autodiff_cost_function.h | 95 ++- extern/ceres/include/ceres/dynamic_cost_function.h | 56 ++ .../ceres/dynamic_cost_function_to_functor.h | 62 +- .../ceres/dynamic_numeric_diff_cost_function.h | 125 ++- extern/ceres/include/ceres/evaluation_callback.h | 80 ++ extern/ceres/include/ceres/first_order_function.h | 54 ++ extern/ceres/include/ceres/fpclassify.h | 70 -- extern/ceres/include/ceres/gradient_checker.h | 23 +- extern/ceres/include/ceres/gradient_problem.h | 25 +- .../ceres/include/ceres/gradient_problem_solver.h | 128 ++-- .../ceres/include/ceres/internal/array_selector.h | 95 +++ extern/ceres/include/ceres/internal/autodiff.h | 291 ++++--- .../include/ceres/internal/disable_warnings.h | 2 +- extern/ceres/include/ceres/internal/eigen.h | 41 +- extern/ceres/include/ceres/internal/fixed_array.h | 573 ++++++++++---- .../include/ceres/internal/householder_vector.h | 88 +++ .../ceres/internal/integer_sequence_algorithm.h | 165 ++++ .../include/ceres/internal/line_parameterization.h | 183 +++++ extern/ceres/include/ceres/internal/macros.h | 170 ----- .../include/ceres/internal/manual_constructor.h | 208 ----- extern/ceres/include/ceres/internal/memory.h | 90 +++ extern/ceres/include/ceres/internal/numeric_diff.h | 198 +++-- .../ceres/include/ceres/internal/parameter_dims.h | 124 +++ extern/ceres/include/ceres/internal/port.h | 62 +- extern/ceres/include/ceres/internal/scoped_ptr.h | 310 -------- .../include/ceres/internal/variadic_evaluate.h | 210 ++---- extern/ceres/include/ceres/iteration_callback.h | 64 +- extern/ceres/include/ceres/jet.h | 693 ++++++++++------- .../ceres/include/ceres/local_parameterization.h | 186 +++-- extern/ceres/include/ceres/loss_function.h | 85 ++- extern/ceres/include/ceres/normal_prior.h | 12 +- .../include/ceres/numeric_diff_cost_function.h | 147 +--- extern/ceres/include/ceres/numeric_diff_options.h | 22 +- extern/ceres/include/ceres/ordered_groups.h | 47 +- extern/ceres/include/ceres/problem.h | 235 +++--- extern/ceres/include/ceres/rotation.h | 255 ++++--- extern/ceres/include/ceres/sized_cost_function.h | 51 +- extern/ceres/include/ceres/solver.h | 494 ++++++------ extern/ceres/include/ceres/tiny_solver.h | 368 +++++++++ .../include/ceres/tiny_solver_autodiff_function.h | 206 +++++ .../ceres/tiny_solver_cost_function_adapter.h | 142 ++++ extern/ceres/include/ceres/types.h | 71 +- extern/ceres/include/ceres/version.h | 6 +- extern/ceres/internal/ceres/accelerate_sparse.cc | 289 +++++++ extern/ceres/internal/ceres/accelerate_sparse.h | 147 ++++ extern/ceres/internal/ceres/array_utils.cc | 14 +- extern/ceres/internal/ceres/array_utils.h | 4 +- .../internal/ceres/block_jacobi_preconditioner.cc | 1 - .../internal/ceres/block_jacobi_preconditioner.h | 18 +- .../ceres/internal/ceres/block_jacobian_writer.cc | 3 +- .../ceres/internal/ceres/block_jacobian_writer.h | 1 + .../ceres/block_random_access_dense_matrix.cc | 1 - .../ceres/block_random_access_dense_matrix.h | 29 +- .../ceres/block_random_access_diagonal_matrix.cc | 6 +- .../ceres/block_random_access_diagonal_matrix.h | 34 +- .../internal/ceres/block_random_access_matrix.h | 17 +- .../ceres/block_random_access_sparse_matrix.cc | 53 +- .../ceres/block_random_access_sparse_matrix.h | 46 +- extern/ceres/internal/ceres/block_sparse_matrix.cc | 182 ++++- extern/ceres/internal/ceres/block_sparse_matrix.h | 102 ++- extern/ceres/internal/ceres/block_structure.h | 9 +- extern/ceres/internal/ceres/c_api.cc | 6 +- extern/ceres/internal/ceres/callbacks.cc | 24 +- extern/ceres/internal/ceres/callbacks.h | 19 +- .../internal/ceres/canonical_views_clustering.cc | 232 ++++++ .../internal/ceres/canonical_views_clustering.h | 124 +++ extern/ceres/internal/ceres/cgnr_linear_operator.h | 12 +- extern/ceres/internal/ceres/cgnr_solver.cc | 39 +- extern/ceres/internal/ceres/cgnr_solver.h | 13 +- extern/ceres/internal/ceres/collections_port.h | 196 ----- .../ceres/compressed_col_sparse_matrix_utils.cc | 6 +- .../ceres/compressed_row_jacobian_writer.cc | 6 +- .../ceres/compressed_row_jacobian_writer.h | 2 +- .../internal/ceres/compressed_row_sparse_matrix.cc | 682 ++++++++++------- .../internal/ceres/compressed_row_sparse_matrix.h | 173 +++-- extern/ceres/internal/ceres/concurrent_queue.h | 159 ++++ .../internal/ceres/conditioned_cost_function.cc | 2 +- .../internal/ceres/conjugate_gradients_solver.cc | 13 +- .../internal/ceres/conjugate_gradients_solver.h | 10 +- extern/ceres/internal/ceres/context.cc | 41 + extern/ceres/internal/ceres/context_impl.cc | 43 ++ extern/ceres/internal/ceres/context_impl.h | 67 ++ .../internal/ceres/coordinate_descent_minimizer.cc | 137 ++-- .../internal/ceres/coordinate_descent_minimizer.h | 14 +- extern/ceres/internal/ceres/corrector.cc | 4 +- extern/ceres/internal/ceres/corrector.h | 2 +- extern/ceres/internal/ceres/covariance.cc | 10 +- extern/ceres/internal/ceres/covariance_impl.cc | 257 +++---- extern/ceres/internal/ceres/covariance_impl.h | 8 +- extern/ceres/internal/ceres/cxsparse.cc | 284 +++++++ extern/ceres/internal/ceres/cxsparse.h | 59 +- .../internal/ceres/dense_normal_cholesky_solver.cc | 1 - .../internal/ceres/dense_normal_cholesky_solver.h | 6 +- extern/ceres/internal/ceres/dense_qr_solver.cc | 2 - extern/ceres/internal/ceres/dense_qr_solver.h | 6 +- extern/ceres/internal/ceres/dense_sparse_matrix.cc | 2 +- extern/ceres/internal/ceres/dense_sparse_matrix.h | 28 +- extern/ceres/internal/ceres/dogleg_strategy.cc | 12 +- extern/ceres/internal/ceres/dogleg_strategy.h | 15 +- .../dynamic_compressed_row_jacobian_writer.cc | 41 +- .../ceres/dynamic_compressed_row_sparse_matrix.h | 4 +- .../ceres/dynamic_sparse_normal_cholesky_solver.cc | 286 +++++++ .../ceres/dynamic_sparse_normal_cholesky_solver.h | 86 +++ extern/ceres/internal/ceres/eigensparse.cc | 190 +++++ extern/ceres/internal/ceres/eigensparse.h | 90 +++ extern/ceres/internal/ceres/evaluator.cc | 8 +- extern/ceres/internal/ceres/evaluator.h | 61 +- extern/ceres/internal/ceres/execution_summary.h | 38 +- extern/ceres/internal/ceres/float_cxsparse.cc | 47 ++ extern/ceres/internal/ceres/float_cxsparse.h | 58 ++ extern/ceres/internal/ceres/float_suitesparse.cc | 47 ++ extern/ceres/internal/ceres/float_suitesparse.h | 58 ++ extern/ceres/internal/ceres/function_sample.cc | 73 ++ extern/ceres/internal/ceres/function_sample.h | 94 +++ .../ceres/generate_eliminator_specialization.py | 231 ------ ...rate_partitioned_matrix_view_specializations.py | 232 ------ .../ceres/generate_template_specializations.py | 246 ++++++ .../generated/partitioned_matrix_view_2_2_2.cc | 5 +- .../generated/partitioned_matrix_view_2_2_3.cc | 5 +- .../generated/partitioned_matrix_view_2_2_4.cc | 5 +- .../generated/partitioned_matrix_view_2_2_d.cc | 5 +- .../generated/partitioned_matrix_view_2_3_3.cc | 5 +- .../generated/partitioned_matrix_view_2_3_4.cc | 5 +- .../generated/partitioned_matrix_view_2_3_6.cc | 5 +- .../generated/partitioned_matrix_view_2_3_9.cc | 5 +- .../generated/partitioned_matrix_view_2_3_d.cc | 5 +- .../generated/partitioned_matrix_view_2_4_3.cc | 5 +- .../generated/partitioned_matrix_view_2_4_4.cc | 5 +- .../generated/partitioned_matrix_view_2_4_6.cc | 58 ++ .../generated/partitioned_matrix_view_2_4_8.cc | 5 +- .../generated/partitioned_matrix_view_2_4_9.cc | 5 +- .../generated/partitioned_matrix_view_2_4_d.cc | 5 +- .../generated/partitioned_matrix_view_2_d_d.cc | 5 +- .../generated/partitioned_matrix_view_3_3_3.cc | 58 ++ .../generated/partitioned_matrix_view_4_4_2.cc | 5 +- .../generated/partitioned_matrix_view_4_4_3.cc | 5 +- .../generated/partitioned_matrix_view_4_4_4.cc | 5 +- .../generated/partitioned_matrix_view_4_4_d.cc | 5 +- .../generated/partitioned_matrix_view_d_d_d.cc | 5 +- .../ceres/generated/schur_eliminator_2_2_2.cc | 5 +- .../ceres/generated/schur_eliminator_2_2_3.cc | 5 +- .../ceres/generated/schur_eliminator_2_2_4.cc | 5 +- .../ceres/generated/schur_eliminator_2_2_d.cc | 5 +- .../ceres/generated/schur_eliminator_2_3_3.cc | 5 +- .../ceres/generated/schur_eliminator_2_3_4.cc | 5 +- .../ceres/generated/schur_eliminator_2_3_6.cc | 5 +- .../ceres/generated/schur_eliminator_2_3_9.cc | 5 +- .../ceres/generated/schur_eliminator_2_3_d.cc | 5 +- .../ceres/generated/schur_eliminator_2_4_3.cc | 5 +- .../ceres/generated/schur_eliminator_2_4_4.cc | 5 +- .../ceres/generated/schur_eliminator_2_4_6.cc | 58 ++ .../ceres/generated/schur_eliminator_2_4_8.cc | 5 +- .../ceres/generated/schur_eliminator_2_4_9.cc | 5 +- .../ceres/generated/schur_eliminator_2_4_d.cc | 5 +- .../ceres/generated/schur_eliminator_2_d_d.cc | 5 +- .../ceres/generated/schur_eliminator_3_3_3.cc | 58 ++ .../ceres/generated/schur_eliminator_4_4_2.cc | 5 +- .../ceres/generated/schur_eliminator_4_4_3.cc | 5 +- .../ceres/generated/schur_eliminator_4_4_4.cc | 5 +- .../ceres/generated/schur_eliminator_4_4_d.cc | 5 +- .../ceres/generated/schur_eliminator_d_d_d.cc | 5 +- extern/ceres/internal/ceres/gradient_checker.cc | 19 +- .../ceres/gradient_checking_cost_function.cc | 34 +- .../ceres/gradient_checking_cost_function.h | 7 +- .../internal/ceres/gradient_problem_evaluator.h | 43 +- .../internal/ceres/gradient_problem_solver.cc | 89 +-- extern/ceres/internal/ceres/graph.h | 55 +- extern/ceres/internal/ceres/graph_algorithms.h | 84 +-- extern/ceres/internal/ceres/householder_vector.h | 85 --- .../internal/ceres/implicit_schur_complement.cc | 1 - .../internal/ceres/implicit_schur_complement.h | 16 +- .../ceres/internal/ceres/inner_product_computer.cc | 330 ++++++++ .../ceres/internal/ceres/inner_product_computer.h | 157 ++++ extern/ceres/internal/ceres/integral_types.h | 91 --- extern/ceres/internal/ceres/invert_psd_matrix.h | 79 ++ extern/ceres/internal/ceres/iterative_refiner.cc | 74 ++ extern/ceres/internal/ceres/iterative_refiner.h | 93 +++ .../ceres/iterative_schur_complement_solver.cc | 108 ++- .../ceres/iterative_schur_complement_solver.h | 16 +- extern/ceres/internal/ceres/lapack.cc | 3 +- .../internal/ceres/levenberg_marquardt_strategy.cc | 12 +- .../internal/ceres/levenberg_marquardt_strategy.h | 12 +- extern/ceres/internal/ceres/line_search.cc | 219 +++--- extern/ceres/internal/ceres/line_search.h | 98 +-- .../ceres/internal/ceres/line_search_minimizer.cc | 122 +-- .../ceres/internal/ceres/line_search_minimizer.h | 6 +- .../internal/ceres/line_search_preprocessor.cc | 7 +- .../internal/ceres/line_search_preprocessor.h | 6 +- .../ceres/linear_least_squares_problems.cc | 19 +- .../internal/ceres/linear_least_squares_problems.h | 15 +- extern/ceres/internal/ceres/linear_solver.cc | 15 +- extern/ceres/internal/ceres/linear_solver.h | 122 ++- .../ceres/internal/ceres/local_parameterization.cc | 154 ++-- extern/ceres/internal/ceres/loss_function.cc | 19 +- .../internal/ceres/low_rank_inverse_hessian.cc | 10 +- .../internal/ceres/low_rank_inverse_hessian.h | 10 +- extern/ceres/internal/ceres/minimizer.h | 9 +- extern/ceres/internal/ceres/mutex.h | 329 -------- extern/ceres/internal/ceres/normal_prior.cc | 1 - extern/ceres/internal/ceres/pair_hash.h | 112 +++ extern/ceres/internal/ceres/parallel_for.h | 67 ++ extern/ceres/internal/ceres/parallel_for_cxx.cc | 247 ++++++ .../ceres/internal/ceres/parallel_for_nothreads.cc | 78 ++ extern/ceres/internal/ceres/parallel_for_openmp.cc | 88 +++ extern/ceres/internal/ceres/parallel_utils.cc | 90 +++ extern/ceres/internal/ceres/parallel_utils.h | 67 ++ extern/ceres/internal/ceres/parameter_block.h | 217 +++--- .../internal/ceres/parameter_block_ordering.cc | 35 +- .../internal/ceres/partitioned_matrix_view.cc | 224 +++--- .../ceres/internal/ceres/partitioned_matrix_view.h | 28 +- .../internal/ceres/partitioned_matrix_view_impl.h | 2 +- .../ceres/partitioned_matrix_view_template.py | 152 ++++ extern/ceres/internal/ceres/polynomial.cc | 18 +- extern/ceres/internal/ceres/polynomial.h | 24 +- extern/ceres/internal/ceres/preconditioner.cc | 3 +- extern/ceres/internal/ceres/preconditioner.h | 54 +- extern/ceres/internal/ceres/preprocessor.cc | 25 +- extern/ceres/internal/ceres/preprocessor.h | 21 +- extern/ceres/internal/ceres/problem.cc | 207 ++--- extern/ceres/internal/ceres/problem_impl.cc | 629 ++++++++------- extern/ceres/internal/ceres/problem_impl.h | 121 ++- extern/ceres/internal/ceres/program.cc | 153 ++-- extern/ceres/internal/ceres/program.h | 15 +- extern/ceres/internal/ceres/program_evaluator.h | 252 +++---- extern/ceres/internal/ceres/random.h | 6 +- extern/ceres/internal/ceres/reorder_program.cc | 87 ++- extern/ceres/internal/ceres/reorder_program.h | 17 +- extern/ceres/internal/ceres/residual_block.cc | 48 +- extern/ceres/internal/ceres/residual_block.h | 11 +- .../ceres/internal/ceres/residual_block_utils.cc | 4 +- .../internal/ceres/schur_complement_solver.cc | 442 +++-------- .../ceres/internal/ceres/schur_complement_solver.h | 102 +-- extern/ceres/internal/ceres/schur_eliminator.cc | 204 +++-- extern/ceres/internal/ceres/schur_eliminator.h | 352 ++++++++- .../ceres/internal/ceres/schur_eliminator_impl.h | 336 +++++---- .../internal/ceres/schur_eliminator_template.py | 155 ++++ .../internal/ceres/schur_jacobi_preconditioner.cc | 35 +- .../internal/ceres/schur_jacobi_preconditioner.h | 21 +- extern/ceres/internal/ceres/schur_templates.cc | 227 ++++++ extern/ceres/internal/ceres/schur_templates.h | 46 ++ extern/ceres/internal/ceres/scoped_thread_token.h | 61 ++ .../internal/ceres/scratch_evaluate_preparer.h | 4 +- .../internal/ceres/single_linkage_clustering.cc | 94 +++ .../internal/ceres/single_linkage_clustering.h | 64 ++ extern/ceres/internal/ceres/small_blas.h | 244 +++++- extern/ceres/internal/ceres/small_blas_generic.h | 315 ++++++++ extern/ceres/internal/ceres/solver.cc | 398 +++++----- extern/ceres/internal/ceres/solver_utils.cc | 6 + extern/ceres/internal/ceres/sparse_cholesky.cc | 163 ++++ extern/ceres/internal/ceres/sparse_cholesky.h | 138 ++++ extern/ceres/internal/ceres/sparse_matrix.h | 2 +- .../ceres/sparse_normal_cholesky_solver.cc | 467 ++---------- .../internal/ceres/sparse_normal_cholesky_solver.h | 83 +- extern/ceres/internal/ceres/split.cc | 2 +- extern/ceres/internal/ceres/stringprintf.cc | 22 - .../ceres/internal/ceres/subset_preconditioner.cc | 117 +++ .../ceres/internal/ceres/subset_preconditioner.h | 91 +++ extern/ceres/internal/ceres/suitesparse.cc | 430 +++++++++++ extern/ceres/internal/ceres/suitesparse.h | 44 +- extern/ceres/internal/ceres/thread_pool.cc | 116 +++ extern/ceres/internal/ceres/thread_pool.h | 120 +++ .../ceres/internal/ceres/thread_token_provider.cc | 76 ++ .../ceres/internal/ceres/thread_token_provider.h | 97 +++ .../ceres/internal/ceres/triplet_sparse_matrix.cc | 77 +- .../ceres/internal/ceres/triplet_sparse_matrix.h | 62 +- .../ceres/internal/ceres/trust_region_minimizer.cc | 73 +- .../ceres/internal/ceres/trust_region_minimizer.h | 12 +- .../internal/ceres/trust_region_preprocessor.cc | 173 +++-- .../internal/ceres/trust_region_preprocessor.h | 6 +- .../internal/ceres/trust_region_step_evaluator.cc | 10 + .../internal/ceres/trust_region_step_evaluator.h | 4 +- .../ceres/internal/ceres/trust_region_strategy.h | 54 +- extern/ceres/internal/ceres/types.cc | 51 +- extern/ceres/internal/ceres/visibility.cc | 152 ++++ extern/ceres/internal/ceres/visibility.h | 78 ++ .../ceres/visibility_based_preconditioner.cc | 585 ++++++++++++++ .../ceres/visibility_based_preconditioner.h | 82 +- extern/ceres/internal/ceres/wall_time.cc | 31 +- extern/ceres/internal/ceres/wall_time.h | 2 +- extern/ceres/patches/series | 2 + extern/ceres/patches/unused_parameter.patch | 13 + extern/ceres/patches/unused_variable.patch | 12 + intern/libmv/libmv/simple_pipeline/bundle.cc | 17 +- 300 files changed, 18002 insertions(+), 9876 deletions(-) create mode 100644 extern/ceres/include/ceres/autodiff_first_order_function.h create mode 100644 extern/ceres/include/ceres/context.h create mode 100644 extern/ceres/include/ceres/cubic_interpolation.h create mode 100644 extern/ceres/include/ceres/dynamic_cost_function.h create mode 100644 extern/ceres/include/ceres/evaluation_callback.h create mode 100644 extern/ceres/include/ceres/first_order_function.h delete mode 100644 extern/ceres/include/ceres/fpclassify.h create mode 100644 extern/ceres/include/ceres/internal/array_selector.h create mode 100644 extern/ceres/include/ceres/internal/householder_vector.h create mode 100644 extern/ceres/include/ceres/internal/integer_sequence_algorithm.h create mode 100644 extern/ceres/include/ceres/internal/line_parameterization.h delete mode 100644 extern/ceres/include/ceres/internal/macros.h delete mode 100644 extern/ceres/include/ceres/internal/manual_constructor.h create mode 100644 extern/ceres/include/ceres/internal/memory.h create mode 100644 extern/ceres/include/ceres/internal/parameter_dims.h delete mode 100644 extern/ceres/include/ceres/internal/scoped_ptr.h create mode 100644 extern/ceres/include/ceres/tiny_solver.h create mode 100644 extern/ceres/include/ceres/tiny_solver_autodiff_function.h create mode 100644 extern/ceres/include/ceres/tiny_solver_cost_function_adapter.h create mode 100644 extern/ceres/internal/ceres/accelerate_sparse.cc create mode 100644 extern/ceres/internal/ceres/accelerate_sparse.h create mode 100644 extern/ceres/internal/ceres/canonical_views_clustering.cc create mode 100644 extern/ceres/internal/ceres/canonical_views_clustering.h delete mode 100644 extern/ceres/internal/ceres/collections_port.h create mode 100644 extern/ceres/internal/ceres/concurrent_queue.h create mode 100644 extern/ceres/internal/ceres/context.cc create mode 100644 extern/ceres/internal/ceres/context_impl.cc create mode 100644 extern/ceres/internal/ceres/context_impl.h create mode 100644 extern/ceres/internal/ceres/cxsparse.cc create mode 100644 extern/ceres/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc create mode 100644 extern/ceres/internal/ceres/dynamic_sparse_normal_cholesky_solver.h create mode 100644 extern/ceres/internal/ceres/eigensparse.cc create mode 100644 extern/ceres/internal/ceres/eigensparse.h create mode 100644 extern/ceres/internal/ceres/float_cxsparse.cc create mode 100644 extern/ceres/internal/ceres/float_cxsparse.h create mode 100644 extern/ceres/internal/ceres/float_suitesparse.cc create mode 100644 extern/ceres/internal/ceres/float_suitesparse.h create mode 100644 extern/ceres/internal/ceres/function_sample.cc create mode 100644 extern/ceres/internal/ceres/function_sample.h delete mode 100644 extern/ceres/internal/ceres/generate_eliminator_specialization.py delete mode 100644 extern/ceres/internal/ceres/generate_partitioned_matrix_view_specializations.py create mode 100644 extern/ceres/internal/ceres/generate_template_specializations.py create mode 100644 extern/ceres/internal/ceres/generated/partitioned_matrix_view_2_4_6.cc create mode 100644 extern/ceres/internal/ceres/generated/partitioned_matrix_view_3_3_3.cc create mode 100644 extern/ceres/internal/ceres/generated/schur_eliminator_2_4_6.cc create mode 100644 extern/ceres/internal/ceres/generated/schur_eliminator_3_3_3.cc delete mode 100644 extern/ceres/internal/ceres/householder_vector.h create mode 100644 extern/ceres/internal/ceres/inner_product_computer.cc create mode 100644 extern/ceres/internal/ceres/inner_product_computer.h delete mode 100644 extern/ceres/internal/ceres/integral_types.h create mode 100644 extern/ceres/internal/ceres/invert_psd_matrix.h create mode 100644 extern/ceres/internal/ceres/iterative_refiner.cc create mode 100644 extern/ceres/internal/ceres/iterative_refiner.h delete mode 100644 extern/ceres/internal/ceres/mutex.h create mode 100644 extern/ceres/internal/ceres/pair_hash.h create mode 100644 extern/ceres/internal/ceres/parallel_for.h create mode 100644 extern/ceres/internal/ceres/parallel_for_cxx.cc create mode 100644 extern/ceres/internal/ceres/parallel_for_nothreads.cc create mode 100644 extern/ceres/internal/ceres/parallel_for_openmp.cc create mode 100644 extern/ceres/internal/ceres/parallel_utils.cc create mode 100644 extern/ceres/internal/ceres/parallel_utils.h create mode 100644 extern/ceres/internal/ceres/partitioned_matrix_view_template.py create mode 100644 extern/ceres/internal/ceres/schur_eliminator_template.py create mode 100644 extern/ceres/internal/ceres/schur_templates.cc create mode 100644 extern/ceres/internal/ceres/schur_templates.h create mode 100644 extern/ceres/internal/ceres/scoped_thread_token.h create mode 100644 extern/ceres/internal/ceres/single_linkage_clustering.cc create mode 100644 extern/ceres/internal/ceres/single_linkage_clustering.h create mode 100644 extern/ceres/internal/ceres/small_blas_generic.h create mode 100644 extern/ceres/internal/ceres/sparse_cholesky.cc create mode 100644 extern/ceres/internal/ceres/sparse_cholesky.h create mode 100644 extern/ceres/internal/ceres/subset_preconditioner.cc create mode 100644 extern/ceres/internal/ceres/subset_preconditioner.h create mode 100644 extern/ceres/internal/ceres/suitesparse.cc create mode 100644 extern/ceres/internal/ceres/thread_pool.cc create mode 100644 extern/ceres/internal/ceres/thread_pool.h create mode 100644 extern/ceres/internal/ceres/thread_token_provider.cc create mode 100644 extern/ceres/internal/ceres/thread_token_provider.h create mode 100644 extern/ceres/internal/ceres/visibility.cc create mode 100644 extern/ceres/internal/ceres/visibility.h create mode 100644 extern/ceres/internal/ceres/visibility_based_preconditioner.cc create mode 100644 extern/ceres/patches/unused_parameter.patch create mode 100644 extern/ceres/patches/unused_variable.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c465d37e8e..7374a54354f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1245,7 +1245,7 @@ endif() if(WITH_LIBMV) # We always have C++11 which includes unordered_map. - set(CERES_DEFINES -DCERES_STD_UNORDERED_MAP) + set(CERES_DEFINES "-DCERES_STD_UNORDERED_MAP;-DCERES_USE_CXX_THREADS") endif() #----------------------------------------------------------------------------- diff --git a/extern/ceres/CMakeLists.txt b/extern/ceres/CMakeLists.txt index 009445ea690..51cf9657319 100644 --- a/extern/ceres/CMakeLists.txt +++ b/extern/ceres/CMakeLists.txt @@ -37,223 +37,279 @@ set(INC_SYS ) set(SRC - internal/ceres/array_utils.cc - internal/ceres/blas.cc - internal/ceres/block_evaluate_preparer.cc - internal/ceres/block_jacobian_writer.cc - internal/ceres/block_jacobi_preconditioner.cc - internal/ceres/block_random_access_dense_matrix.cc - internal/ceres/block_random_access_diagonal_matrix.cc - internal/ceres/block_random_access_matrix.cc - internal/ceres/block_random_access_sparse_matrix.cc - internal/ceres/block_sparse_matrix.cc - internal/ceres/block_structure.cc - internal/ceres/callbacks.cc - internal/ceres/c_api.cc - internal/ceres/cgnr_solver.cc - internal/ceres/compressed_col_sparse_matrix_utils.cc - internal/ceres/compressed_row_jacobian_writer.cc - internal/ceres/compressed_row_sparse_matrix.cc - internal/ceres/conditioned_cost_function.cc - internal/ceres/conjugate_gradients_solver.cc - internal/ceres/coordinate_descent_minimizer.cc - internal/ceres/corrector.cc - internal/ceres/covariance.cc - internal/ceres/covariance_impl.cc - internal/ceres/dense_normal_cholesky_solver.cc - internal/ceres/dense_qr_solver.cc - internal/ceres/dense_sparse_matrix.cc - internal/ceres/detect_structure.cc - internal/ceres/dogleg_strategy.cc - internal/ceres/dynamic_compressed_row_jacobian_writer.cc - internal/ceres/dynamic_compressed_row_sparse_matrix.cc - internal/ceres/evaluator.cc - internal/ceres/file.cc - internal/ceres/generated/partitioned_matrix_view_d_d_d.cc - internal/ceres/generated/schur_eliminator_d_d_d.cc - internal/ceres/gradient_checker.cc - internal/ceres/gradient_checking_cost_function.cc - internal/ceres/gradient_problem.cc - internal/ceres/gradient_problem_solver.cc - internal/ceres/implicit_schur_complement.cc - internal/ceres/is_close.cc - internal/ceres/iterative_schur_complement_solver.cc - internal/ceres/lapack.cc - internal/ceres/levenberg_marquardt_strategy.cc - internal/ceres/linear_least_squares_problems.cc - internal/ceres/linear_operator.cc - internal/ceres/linear_solver.cc - internal/ceres/line_search.cc - internal/ceres/line_search_direction.cc - internal/ceres/line_search_minimizer.cc - internal/ceres/line_search_preprocessor.cc - internal/ceres/local_parameterization.cc - internal/ceres/loss_function.cc - internal/ceres/low_rank_inverse_hessian.cc - internal/ceres/minimizer.cc - internal/ceres/normal_prior.cc - internal/ceres/parameter_block_ordering.cc - internal/ceres/partitioned_matrix_view.cc - internal/ceres/polynomial.cc - internal/ceres/preconditioner.cc - internal/ceres/preprocessor.cc - internal/ceres/problem.cc - internal/ceres/problem_impl.cc - internal/ceres/program.cc - internal/ceres/reorder_program.cc - internal/ceres/residual_block.cc - internal/ceres/residual_block_utils.cc - internal/ceres/schur_complement_solver.cc - internal/ceres/schur_eliminator.cc - internal/ceres/schur_jacobi_preconditioner.cc - internal/ceres/scratch_evaluate_preparer.cc - internal/ceres/solver.cc - internal/ceres/solver_utils.cc - internal/ceres/sparse_matrix.cc - internal/ceres/sparse_normal_cholesky_solver.cc - internal/ceres/split.cc - internal/ceres/stringprintf.cc - internal/ceres/triplet_sparse_matrix.cc - internal/ceres/trust_region_minimizer.cc - internal/ceres/trust_region_preprocessor.cc - internal/ceres/trust_region_step_evaluator.cc - internal/ceres/trust_region_strategy.cc - internal/ceres/types.cc - internal/ceres/wall_time.cc + internal/ceres/accelerate_sparse.cc + internal/ceres/array_utils.cc + internal/ceres/blas.cc + internal/ceres/block_evaluate_preparer.cc + internal/ceres/block_jacobian_writer.cc + internal/ceres/block_jacobi_preconditioner.cc + internal/ceres/block_random_access_dense_matrix.cc + internal/ceres/block_random_access_diagonal_matrix.cc + internal/ceres/block_random_access_matrix.cc + internal/ceres/block_random_access_sparse_matrix.cc + internal/ceres/block_sparse_matrix.cc + internal/ceres/block_structure.cc + internal/ceres/callbacks.cc + internal/ceres/canonical_views_clustering.cc + internal/ceres/c_api.cc + internal/ceres/cgnr_solver.cc + internal/ceres/compressed_col_sparse_matrix_utils.cc + internal/ceres/compressed_row_jacobian_writer.cc + internal/ceres/compressed_row_sparse_matrix.cc + internal/ceres/conditioned_cost_function.cc + internal/ceres/conjugate_gradients_solver.cc + internal/ceres/context.cc + internal/ceres/context_impl.cc + internal/ceres/coordinate_descent_minimizer.cc + internal/ceres/corrector.cc + internal/ceres/covariance.cc + internal/ceres/covariance_impl.cc + internal/ceres/cxsparse.cc + internal/ceres/dense_normal_cholesky_solver.cc + internal/ceres/dense_qr_solver.cc + internal/ceres/dense_sparse_matrix.cc + internal/ceres/detect_structure.cc + internal/ceres/dogleg_strategy.cc + internal/ceres/dynamic_compressed_row_jacobian_writer.cc + internal/ceres/dynamic_compressed_row_sparse_matrix.cc + internal/ceres/dynamic_sparse_normal_cholesky_solver.cc + internal/ceres/eigensparse.cc + internal/ceres/evaluator.cc + internal/ceres/file.cc + internal/ceres/float_cxsparse.cc + internal/ceres/float_suitesparse.cc + internal/ceres/function_sample.cc + internal/ceres/generated/partitioned_matrix_view_d_d_d.cc + internal/ceres/generated/schur_eliminator_d_d_d.cc + internal/ceres/gradient_checker.cc + internal/ceres/gradient_checking_cost_function.cc + internal/ceres/gradient_problem.cc + internal/ceres/gradient_problem_solver.cc + internal/ceres/implicit_schur_complement.cc + internal/ceres/inner_product_computer.cc + internal/ceres/is_close.cc + internal/ceres/iterative_refiner.cc + internal/ceres/iterative_schur_complement_solver.cc + internal/ceres/lapack.cc + internal/ceres/levenberg_marquardt_strategy.cc + internal/ceres/linear_least_squares_problems.cc + internal/ceres/linear_operator.cc + internal/ceres/linear_solver.cc + internal/ceres/line_search.cc + internal/ceres/line_search_direction.cc + internal/ceres/line_search_minimizer.cc + internal/ceres/line_search_preprocessor.cc + internal/ceres/local_parameterization.cc + internal/ceres/loss_function.cc + internal/ceres/low_rank_inverse_hessian.cc + internal/ceres/minimizer.cc + internal/ceres/normal_prior.cc + internal/ceres/parallel_for_cxx.cc + internal/ceres/parallel_for_nothreads.cc + internal/ceres/parallel_for_openmp.cc + internal/ceres/parallel_utils.cc + internal/ceres/parameter_block_ordering.cc + internal/ceres/partitioned_matrix_view.cc + internal/ceres/polynomial.cc + internal/ceres/preconditioner.cc + internal/ceres/preprocessor.cc + internal/ceres/problem.cc + internal/ceres/problem_impl.cc + internal/ceres/program.cc + internal/ceres/reorder_program.cc + internal/ceres/residual_block.cc + internal/ceres/residual_block_utils.cc + internal/ceres/schur_complement_solver.cc + internal/ceres/schur_eliminator.cc + internal/ceres/schur_jacobi_preconditioner.cc + internal/ceres/schur_templates.cc + internal/ceres/scratch_evaluate_preparer.cc + internal/ceres/single_linkage_clustering.cc + internal/ceres/solver.cc + internal/ceres/solver_utils.cc + internal/ceres/sparse_cholesky.cc + internal/ceres/sparse_matrix.cc + internal/ceres/sparse_normal_cholesky_solver.cc + internal/ceres/split.cc + internal/ceres/stringprintf.cc + internal/ceres/subset_preconditioner.cc + internal/ceres/suitesparse.cc + internal/ceres/thread_pool.cc + internal/ceres/thread_token_provider.cc + internal/ceres/triplet_sparse_matrix.cc + internal/ceres/trust_region_minimizer.cc + internal/ceres/trust_region_preprocessor.cc + internal/ceres/trust_region_step_evaluator.cc + internal/ceres/trust_region_strategy.cc + internal/ceres/types.cc + internal/ceres/visibility_based_preconditioner.cc + internal/ceres/visibility.cc + internal/ceres/wall_time.cc - include/ceres/autodiff_cost_function.h - include/ceres/autodiff_local_parameterization.h - include/ceres/c_api.h - include/ceres/ceres.h - include/ceres/conditioned_cost_function.h - include/ceres/cost_function.h - include/ceres/cost_function_to_functor.h - include/ceres/covariance.h - include/ceres/crs_matrix.h - include/ceres/dynamic_autodiff_cost_function.h - include/ceres/dynamic_cost_function_to_functor.h - include/ceres/dynamic_numeric_diff_cost_function.h - include/ceres/fpclassify.h - include/ceres/gradient_checker.h - include/ceres/gradient_problem.h - include/ceres/gradient_problem_solver.h - include/ceres/internal/autodiff.h - include/ceres/internal/disable_warnings.h - include/ceres/internal/eigen.h - include/ceres/internal/fixed_array.h - include/ceres/internal/macros.h - include/ceres/internal/manual_constructor.h - include/ceres/internal/numeric_diff.h - include/ceres/internal/port.h - include/ceres/internal/reenable_warnings.h - include/ceres/internal/scoped_ptr.h - include/ceres/internal/variadic_evaluate.h - include/ceres/iteration_callback.h - include/ceres/jet.h - include/ceres/local_parameterization.h - include/ceres/loss_function.h - include/ceres/normal_prior.h - include/ceres/numeric_diff_cost_function.h - include/ceres/numeric_diff_options.h - include/ceres/ordered_groups.h - include/ceres/problem.h - include/ceres/rotation.h - include/ceres/sized_cost_function.h - include/ceres/solver.h - include/ceres/types.h - include/ceres/version.h - internal/ceres/array_utils.h - internal/ceres/blas.h - internal/ceres/block_evaluate_preparer.h - internal/ceres/block_jacobian_writer.h - internal/ceres/block_jacobi_preconditioner.h - internal/ceres/block_random_access_dense_matrix.h - internal/ceres/block_random_access_diagonal_matrix.h - internal/ceres/block_random_access_matrix.h - internal/ceres/block_random_access_sparse_matrix.h - internal/ceres/block_sparse_matrix.h - internal/ceres/block_structure.h - internal/ceres/callbacks.h - internal/ceres/casts.h - internal/ceres/cgnr_linear_operator.h - internal/ceres/cgnr_solver.h - internal/ceres/collections_port.h - internal/ceres/compressed_col_sparse_matrix_utils.h - internal/ceres/compressed_row_jacobian_writer.h - internal/ceres/compressed_row_sparse_matrix.h - internal/ceres/conjugate_gradients_solver.h - internal/ceres/coordinate_descent_minimizer.h - internal/ceres/corrector.h - internal/ceres/covariance_impl.h - internal/ceres/cxsparse.h - internal/ceres/dense_jacobian_writer.h - internal/ceres/dense_normal_cholesky_solver.h - internal/ceres/dense_qr_solver.h - internal/ceres/dense_sparse_matrix.h - internal/ceres/detect_structure.h - internal/ceres/dogleg_strategy.h - internal/ceres/dynamic_compressed_row_finalizer.h - internal/ceres/dynamic_compressed_row_jacobian_writer.h - internal/ceres/dynamic_compressed_row_sparse_matrix.h - internal/ceres/evaluator.h - internal/ceres/execution_summary.h - internal/ceres/file.h - internal/ceres/gradient_checking_cost_function.h - internal/ceres/gradient_problem_evaluator.h - internal/ceres/graph_algorithms.h - internal/ceres/graph.h - internal/ceres/householder_vector.h - internal/ceres/implicit_schur_complement.h - internal/ceres/integral_types.h - internal/ceres/is_close.h - internal/ceres/iterative_schur_complement_solver.h - internal/ceres/lapack.h - internal/ceres/levenberg_marquardt_strategy.h - internal/ceres/linear_least_squares_problems.h - internal/ceres/linear_operator.h - internal/ceres/linear_solver.h - internal/ceres/line_search_direction.h - internal/ceres/line_search.h - internal/ceres/line_search_minimizer.h - internal/ceres/line_search_preprocessor.h - internal/ceres/low_rank_inverse_hessian.h - internal/ceres/map_util.h - internal/ceres/minimizer.h - internal/ceres/mutex.h - internal/ceres/parameter_block.h - internal/ceres/parameter_block_ordering.h - internal/ceres/partitioned_matrix_view.h - internal/ceres/partitioned_matrix_view_impl.h - internal/ceres/polynomial.h - internal/ceres/preconditioner.h - internal/ceres/preprocessor.h - internal/ceres/problem_impl.h - internal/ceres/program_evaluator.h - internal/ceres/program.h - internal/ceres/random.h - internal/ceres/reorder_program.h - internal/ceres/residual_block.h - internal/ceres/residual_block_utils.h - internal/ceres/schur_complement_solver.h - internal/ceres/schur_eliminator.h - internal/ceres/schur_eliminator_impl.h - internal/ceres/schur_jacobi_preconditioner.h - internal/ceres/scratch_evaluate_preparer.h - internal/ceres/small_blas.h - internal/ceres/solver_utils.h - internal/ceres/sparse_matrix.h - internal/ceres/sparse_normal_cholesky_solver.h - internal/ceres/split.h - internal/ceres/stl_util.h - internal/ceres/stringprintf.h - internal/ceres/suitesparse.h - internal/ceres/triplet_sparse_matrix.h - internal/ceres/trust_region_minimizer.h - internal/ceres/trust_region_preprocessor.h - internal/ceres/trust_region_step_evaluator.h - internal/ceres/trust_region_strategy.h - internal/ceres/visibility_based_preconditioner.h - internal/ceres/wall_time.h + include/ceres/autodiff_cost_function.h + include/ceres/autodiff_first_order_function.h + include/ceres/autodiff_local_parameterization.h + include/ceres/c_api.h + include/ceres/ceres.h + include/ceres/conditioned_cost_function.h + include/ceres/context.h + include/ceres/cost_function.h + include/ceres/cost_function_to_functor.h + include/ceres/covariance.h + include/ceres/crs_matrix.h + include/ceres/cubic_interpolation.h + include/ceres/dynamic_autodiff_cost_function.h + include/ceres/dynamic_cost_function.h + include/ceres/dynamic_cost_function_to_functor.h + include/ceres/dynamic_numeric_diff_cost_function.h + include/ceres/evaluation_callback.h + include/ceres/first_order_function.h + include/ceres/gradient_checker.h + include/ceres/gradient_problem.h + include/ceres/gradient_problem_solver.h + include/ceres/internal/array_selector.h + include/ceres/internal/autodiff.h + include/ceres/internal/disable_warnings.h + include/ceres/internal/eigen.h + include/ceres/internal/fixed_array.h + include/ceres/internal/householder_vector.h + include/ceres/internal/integer_sequence_algorithm.h + include/ceres/internal/line_parameterization.h + include/ceres/internal/memory.h + include/ceres/internal/numeric_diff.h + include/ceres/internal/parameter_dims.h + include/ceres/internal/port.h + include/ceres/internal/reenable_warnings.h + include/ceres/internal/variadic_evaluate.h + include/ceres/iteration_callback.h + include/ceres/jet.h + include/ceres/local_parameterization.h + include/ceres/loss_function.h + include/ceres/normal_prior.h + include/ceres/numeric_diff_cost_function.h + include/ceres/numeric_diff_options.h + include/ceres/ordered_groups.h + include/ceres/problem.h + include/ceres/rotation.h + include/ceres/sized_cost_function.h + include/ceres/solver.h + include/ceres/tiny_solver_autodiff_function.h + include/ceres/tiny_solver_cost_function_adapter.h + include/ceres/tiny_solver.h + include/ceres/types.h + include/ceres/version.h + internal/ceres/accelerate_sparse.h + internal/ceres/array_utils.h + internal/ceres/blas.h + internal/ceres/block_evaluate_preparer.h + internal/ceres/block_jacobian_writer.h + internal/ceres/block_jacobi_preconditioner.h + internal/ceres/block_random_access_dense_matrix.h + internal/ceres/block_random_access_diagonal_matrix.h + internal/ceres/block_random_access_matrix.h + internal/ceres/block_random_access_sparse_matrix.h + internal/ceres/block_sparse_matrix.h + internal/ceres/block_structure.h + internal/ceres/callbacks.h + internal/ceres/canonical_views_clustering.h + internal/ceres/casts.h + internal/ceres/cgnr_linear_operator.h + internal/ceres/cgnr_solver.h + internal/ceres/compressed_col_sparse_matrix_utils.h + internal/ceres/compressed_row_jacobian_writer.h + internal/ceres/compressed_row_sparse_matrix.h + internal/ceres/concurrent_queue.h + internal/ceres/conjugate_gradients_solver.h + internal/ceres/context_impl.h + internal/ceres/coordinate_descent_minimizer.h + internal/ceres/corrector.h + internal/ceres/covariance_impl.h + internal/ceres/cxsparse.h + internal/ceres/dense_jacobian_writer.h + internal/ceres/dense_normal_cholesky_solver.h + internal/ceres/dense_qr_solver.h + internal/ceres/dense_sparse_matrix.h + internal/ceres/detect_structure.h + internal/ceres/dogleg_strategy.h + internal/ceres/dynamic_compressed_row_finalizer.h + internal/ceres/dynamic_compressed_row_jacobian_writer.h + internal/ceres/dynamic_compressed_row_sparse_matrix.h + internal/ceres/dynamic_sparse_normal_cholesky_solver.h + internal/ceres/eigensparse.h + internal/ceres/evaluator.h + internal/ceres/execution_summary.h + internal/ceres/file.h + internal/ceres/float_cxsparse.h + internal/ceres/float_suitesparse.h + internal/ceres/function_sample.h + internal/ceres/gradient_checking_cost_function.h + internal/ceres/gradient_problem_evaluator.h + internal/ceres/graph_algorithms.h + internal/ceres/graph.h + internal/ceres/implicit_schur_complement.h + internal/ceres/inner_product_computer.h + internal/ceres/invert_psd_matrix.h + internal/ceres/is_close.h + internal/ceres/iterative_refiner.h + internal/ceres/iterative_schur_complement_solver.h + internal/ceres/lapack.h + internal/ceres/levenberg_marquardt_strategy.h + internal/ceres/linear_least_squares_problems.h + internal/ceres/linear_operator.h + internal/ceres/linear_solver.h + internal/ceres/line_search_direction.h + internal/ceres/line_search.h + internal/ceres/line_search_minimizer.h + internal/ceres/line_search_preprocessor.h + internal/ceres/low_rank_inverse_hessian.h + internal/ceres/map_util.h + internal/ceres/minimizer.h + internal/ceres/pair_hash.h + internal/ceres/parallel_for.h + internal/ceres/parallel_utils.h + internal/ceres/parameter_block.h + internal/ceres/parameter_block_ordering.h + internal/ceres/partitioned_matrix_view.h + internal/ceres/partitioned_matrix_view_impl.h + internal/ceres/polynomial.h + internal/ceres/preconditioner.h + internal/ceres/preprocessor.h + internal/ceres/problem_impl.h + internal/ceres/program_evaluator.h + internal/ceres/program.h + internal/ceres/random.h + internal/ceres/reorder_program.h + internal/ceres/residual_block.h + internal/ceres/residual_block_utils.h + internal/ceres/schur_complement_solver.h + internal/ceres/schur_eliminator.h + internal/ceres/schur_eliminator_impl.h + internal/ceres/schur_jacobi_preconditioner.h + internal/ceres/schur_templates.h + internal/ceres/scoped_thread_token.h + internal/ceres/scratch_evaluate_preparer.h + internal/ceres/single_linkage_clustering.h + internal/ceres/small_blas_generic.h + internal/ceres/small_blas.h + internal/ceres/solver_utils.h + internal/ceres/sparse_cholesky.h + internal/ceres/sparse_matrix.h + internal/ceres/sparse_normal_cholesky_solver.h + internal/ceres/split.h + internal/ceres/stl_util.h + internal/ceres/stringprintf.h + internal/ceres/subset_preconditioner.h + internal/ceres/suitesparse.h + internal/ceres/thread_pool.h + internal/ceres/thread_token_provider.h + internal/ceres/triplet_sparse_matrix.h + internal/ceres/trust_region_minimizer.h + internal/ceres/trust_region_preprocessor.h + internal/ceres/trust_region_step_evaluator.h + internal/ceres/trust_region_strategy.h + internal/ceres/visibility_based_preconditioner.h + internal/ceres/visibility.h + internal/ceres/wall_time.h ) set(LIB @@ -263,44 +319,48 @@ set(LIB if(WITH_LIBMV_SCHUR_SPECIALIZATIONS) list(APPEND SRC - internal/ceres/generated/partitioned_matrix_view_2_2_2.cc - internal/ceres/generated/partitioned_matrix_view_2_2_3.cc - internal/ceres/generated/partitioned_matrix_view_2_2_4.cc - internal/ceres/generated/partitioned_matrix_view_2_2_d.cc - internal/ceres/generated/partitioned_matrix_view_2_3_3.cc - internal/ceres/generated/partitioned_matrix_view_2_3_4.cc - internal/ceres/generated/partitioned_matrix_view_2_3_6.cc - internal/ceres/generated/partitioned_matrix_view_2_3_9.cc - internal/ceres/generated/partitioned_matrix_view_2_3_d.cc - internal/ceres/generated/partitioned_matrix_view_2_4_3.cc - internal/ceres/generated/partitioned_matrix_view_2_4_4.cc - internal/ceres/generated/partitioned_matrix_view_2_4_8.cc - internal/ceres/generated/partitioned_matrix_view_2_4_9.cc - internal/ceres/generated/partitioned_matrix_view_2_4_d.cc - internal/ceres/generated/partitioned_matrix_view_2_d_d.cc - internal/ceres/generated/partitioned_matrix_view_4_4_2.cc - internal/ceres/generated/partitioned_matrix_view_4_4_3.cc - internal/ceres/generated/partitioned_matrix_view_4_4_4.cc - internal/ceres/generated/partitioned_matrix_view_4_4_d.cc - internal/ceres/generated/schur_eliminator_2_2_2.cc - internal/ceres/generated/schur_eliminator_2_2_3.cc - internal/ceres/generated/schur_eliminator_2_2_4.cc - internal/ceres/generated/schur_eliminator_2_2_d.cc - internal/ceres/generated/schur_eliminator_2_3_3.cc - internal/ceres/generated/schur_eliminator_2_3_4.cc - internal/ceres/generated/schur_eliminator_2_3_6.cc - internal/ceres/generated/schur_eliminator_2_3_9.cc - internal/ceres/generated/schur_eliminator_2_3_d.cc - internal/ceres/generated/schur_eliminator_2_4_3.cc - internal/ceres/generated/schur_eliminator_2_4_4.cc - internal/ceres/generated/schur_eliminator_2_4_8.cc - internal/ceres/generated/schur_eliminator_2_4_9.cc - internal/ceres/generated/schur_eliminator_2_4_d.cc - internal/ceres/generated/schur_eliminator_2_d_d.cc - internal/ceres/generated/schur_eliminator_4_4_2.cc - internal/ceres/generated/schur_eliminator_4_4_3.cc - internal/ceres/generated/schur_eliminator_4_4_4.cc - internal/ceres/generated/schur_eliminator_4_4_d.cc + internal/ceres/generated/partitioned_matrix_view_2_2_2.cc + internal/ceres/generated/partitioned_matrix_view_2_2_3.cc + internal/ceres/generated/partitioned_matrix_view_2_2_4.cc + internal/ceres/generated/partitioned_matrix_view_2_2_d.cc + internal/ceres/generated/partitioned_matrix_view_2_3_3.cc + internal/ceres/generated/partitioned_matrix_view_2_3_4.cc + internal/ceres/generated/partitioned_matrix_view_2_3_6.cc + internal/ceres/generated/partitioned_matrix_view_2_3_9.cc + internal/ceres/generated/partitioned_matrix_view_2_3_d.cc + internal/ceres/generated/partitioned_matrix_view_2_4_3.cc + internal/ceres/generated/partitioned_matrix_view_2_4_4.cc + internal/ceres/generated/partitioned_matrix_view_2_4_6.cc + internal/ceres/generated/partitioned_matrix_view_2_4_8.cc + internal/ceres/generated/partitioned_matrix_view_2_4_9.cc + internal/ceres/generated/partitioned_matrix_view_2_4_d.cc + internal/ceres/generated/partitioned_matrix_view_2_d_d.cc + internal/ceres/generated/partitioned_matrix_view_3_3_3.cc + internal/ceres/generated/partitioned_matrix_view_4_4_2.cc + internal/ceres/generated/partitioned_matrix_view_4_4_3.cc + internal/ceres/generated/partitioned_matrix_view_4_4_4.cc + internal/ceres/generated/partitioned_matrix_view_4_4_d.cc + internal/ceres/generated/schur_eliminator_2_2_2.cc + internal/ceres/generated/schur_eliminator_2_2_3.cc + internal/ceres/generated/schur_eliminator_2_2_4.cc + internal/ceres/generated/schur_eliminator_2_2_d.cc + internal/ceres/generated/schur_eliminator_2_3_3.cc + internal/ceres/generated/schur_eliminator_2_3_4.cc + internal/ceres/generated/schur_eliminator_2_3_6.cc + internal/ceres/generated/schur_eliminator_2_3_9.cc + internal/ceres/generated/schur_eliminator_2_3_d.cc + internal/ceres/generated/schur_eliminator_2_4_3.cc + internal/ceres/generated/schur_eliminator_2_4_4.cc + internal/ceres/generated/schur_eliminator_2_4_6.cc + internal/ceres/generated/schur_eliminator_2_4_8.cc + internal/ceres/generated/schur_eliminator_2_4_9.cc + internal/ceres/generated/schur_eliminator_2_4_d.cc + internal/ceres/generated/schur_eliminator_2_d_d.cc + internal/ceres/generated/schur_eliminator_3_3_3.cc + internal/ceres/generated/schur_eliminator_4_4_2.cc + internal/ceres/generated/schur_eliminator_4_4_3.cc + internal/ceres/generated/schur_eliminator_4_4_4.cc + internal/ceres/generated/schur_eliminator_4_4_d.cc ) else() add_definitions(-DCERES_RESTRICT_SCHUR_SPECIALIZATION) @@ -315,13 +375,9 @@ add_definitions( -DCERES_NO_SUITESPARSE -DCERES_NO_CXSPARSE -DCERES_NO_LAPACK + -DCERES_NO_ACCELERATE_SPARSE -DCERES_HAVE_RWLOCK + -DCERES_USE_CXX_THREADS ) -if(WITH_OPENMP) - add_definitions( - -DCERES_USE_OPENMP - ) -endif() - blender_add_lib(extern_ceres "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/extern/ceres/ChangeLog b/extern/ceres/ChangeLog index ae8d42a7c95..64c75e572f4 100644 --- a/extern/ceres/ChangeLog +++ b/extern/ceres/ChangeLog @@ -1,588 +1,587 @@ -commit 8590e6e8e057adba4ec0083446d00268565bb444 -Author: Sameer Agarwal -Date: Thu Oct 27 12:29:37 2016 -0700 +commit e39d9ed1d60dfeb58dd2a0df4622c683f87b28e3 +Author: Carl Dehlin +Date: Tue Jun 16 09:02:05 2020 +0200 - Remove two checks from rotation.h - - This allows rotation.h to remove its dependency on glog. + Add a missing term and remove a superfluous word - Change-Id: Ia6aede93ee51a4bd4039570dc8edd100a7045329 + Change-Id: I25f40f0bf241302b975e6fc14690aa863c0728b0 -commit e892499e8d8977b9178a760348bdd201ec5f3489 -Author: Je Hyeong Hong -Date: Tue Oct 18 22:49:11 2016 +0100 +commit 27cab77b699a1a2b5354820c57a91c92eaeb21e3 +Author: Carl Dehlin +Date: Mon Jun 15 20:01:18 2020 +0200 - Relax the tolerance in QuaternionParameterizationTestHelper. - - This commit relaxes the tolerance value for comparing between the actual - local matrix and the expected local matrix. Without this fix, - EigenQuaternionParameterization.ZeroTest could fail as the difference - exactly matches the value of std::numeric_limits::epsilon(). + Reformulate some sentences - Change-Id: Ic4d3f26c0acdf5f16fead80dfdc53df9e7dabbf9 + Change-Id: I4841aa8e8522008dd816261d9ad98e5fb8ad1758 -commit 7ed9e2fb7f1dff264c5e4fbaa89ee1c4c99df269 -Author: Sameer Agarwal -Date: Wed Oct 19 04:45:23 2016 -0700 +commit 8ac6655ce85a4462f2882fcb9e9118a7057ebe09 +Author: Carl Dehlin +Date: Mon Jun 15 19:10:12 2020 +0200 - Occured -> Occurred. - - Thanks to Phillip Huebner for reporting this. + Fix documentation formatting issues - Change-Id: I9cddfbb373aeb496961d08e434fe661bff4abd29 + Change-Id: Iea3a6e75dc3a7376eda866ab24e535a6df84f8ea -commit b82f97279682962d8c8ae1b6d9e801ba072a0ab1 -Author: Je Hyeong Hong -Date: Tue Oct 18 21:18:32 2016 +0100 +commit 7ef83e07592ead74eeacc227b642df1959d2a246 +Author: Alex Stewart +Date: Sat May 30 11:30:01 2020 +0100 - Fix a test error in autodiff_test.cc. + Update minimum required C++ version for Ceres to C++14 - Previously, the test for the projective camera model would fail as no - tolerance is set in line 144. To resolve this, this commit changes - assert_equal to assert_near. + - Removes all workarounds for pre-C++14 versions + - Removes '11' qualifier from C++ threading option and associated + defines. + - Fix missing inclusion of 'Multithreading' in reported Ceres components + when C++ threading model is enabled. + - Update Sphinx documentation to specify C++14 as minimum requirement. - Change-Id: I6cd3379083b1a10c7cd0a9cc83fd6962bb993cc9 + Change-Id: I706c8b367b3221e3c4d1a0aaf669a8f9c911e438 -commit 5690b447de5beed6bdda99b7f30f372283c2fb1a +commit 1d75e7568172dc5a4dc97937dcf66e0f5d28272c Author: Sameer Agarwal -Date: Thu Oct 13 09:52:02 2016 -0700 +Date: Mon May 25 18:09:50 2020 -0700 - Fix documentation source for templated functions in rotation.h + Improve documentation for LocalParameterization - Change-Id: Ic1b2e6f0e6eb9914f419fd0bb5af77b66252e57c + Change-Id: I63fa81206e67bfac56cc42bf2bb4915a3a11332b -commit 2f8f98f7e8940e465de126fb51282396f42bea20 +commit 763398ca4ed56952f48c48df6a98e277e3e05381 Author: Sameer Agarwal -Date: Thu Oct 13 09:35:18 2016 -0700 +Date: Mon May 25 12:12:03 2020 -0700 - Prepare for 1.12.0RC1 + Update the section on Preconditioners - Change-Id: I23eaf0b46117a01440143001b74dacfa5e57cbf0 - -commit 55c12d2e9569fe4aeac3ba688ac36810935a37ba -Author: Damon Kohler -Date: Wed Oct 5 16:30:31 2016 +0200 - - Adds package.xml to support Catkin. + Re-organize the section, add some more references and details for + existing preconditioners and add documentation for the SUBSET + precondition. - Change-Id: I8ad4d36a8b036417604a54644e0bb70dd1615feb - -commit 0bcce6565202f5476e40f12afc0a99eb44bd9dfb -Author: Sameer Agarwal -Date: Mon Oct 10 23:30:42 2016 -0700 - - Fix tabs in Android.mk + https://github.com/ceres-solver/ceres-solver/issues/490 - Change-Id: Ie5ab9a8ba2b727721565e1ded242609b6df5f8f5 + Change-Id: I93d0af819c160f5e4ce48b18202f629ddb92ca7b -commit e6ffe2667170d2fc435443685c0163396fc52d7b +commit a614f788a34ea86dd9f679b779ffbf920db45aa6 Author: Sameer Agarwal -Date: Mon Oct 10 22:47:08 2016 -0700 +Date: Fri May 22 13:52:53 2020 -0700 - Update the version history. + Call EvaluationCallback before evaluating the fixed cost. - Change-Id: I9a57b0541d6cebcb695ecb364a1d4ca04ea4e06c - -commit 0a4ccb7ee939ab35b22e26758401e039b033b176 -Author: David Gossow -Date: Wed Sep 7 21:38:12 2016 +0200 - - Relaxing Jacobian matching in Gradient Checker test. + Fixe a subtle bug in Program::RemoveFixedBlocks, where we call + ResidualBlock::Evaluate on residual blocks with all constant parameter + blocks without paying attention to the presence of an + EvaluationCallback. + + In the process also run clang-format on some of the files touched by + this change. - Any result of an arithmetic operation on floating-point matrices - should never be checked for strict equality with some expected - value, due to limited floating point precision on different machines. - This fixes some occurences of exact checks in the gradient checker - unit test that were causing problems on some platforms. + https://github.com/ceres-solver/ceres-solver/issues/482 - Change-Id: I48e804c9c705dc485ce74ddfe51037d4957c8fcb + Change-Id: I342b66f6f975fdee2eef139a31f24d4a3e568e84 -commit ee44fc91b59584921c1d1c8db153fda6d633b092 -Author: Je Hyeong Hong -Date: Mon Oct 3 12:19:30 2016 +0100 +commit 70308f7bb9cac560db250262079c0f8b030b9d6b +Author: Sameer Agarwal +Date: Tue May 26 06:12:13 2020 -0700 - Fix an Intel compiler error in covariance_impl.cc. + Simplify documentation generation. - Intel C compiler strictly asks for parallel loops with collapse to be - perfectly nested. Otherwise, compiling Ceres with ICC will throw an - error at line 348 of covariance_impl.cc. + 1. The MathJax font configuration is moved into conf.py and removed + from make_docs.py along with better font sizing. + 2. Remove the bread crumb replacement as it is not working anymore. + 3. Fix a parsing error in nnls_modeling.rst which the new version of + sphinx barfed on. - Change-Id: I1ecb68e89b7faf79e4153dfe6675c390d1780db4 + Change-Id: Ia3c2e732323a8b5cabafe851ac5ca0f0c82da071 -commit 9026d69d1ce1e0bcd21debd54a38246d85c7c6e4 -Author: Sameer Agarwal -Date: Thu Sep 22 17:20:14 2016 -0700 - - Allow SubsetParameterization to hold all parameters constant - - 1. SubsetParameterization can now be constructed such that all - parameters are constant. This is required for it be used as part - of a ProductParameterization to hold a part of parameter block - constant. For example, a parameter block consisting of a rotation - as a quaternion and a translation vector can now have a local - parameterization where the translation part is constant and the - quaternion part has a QuaternionParameterization associated with it. - - 2. The check for the tangent space of a parameterization being - positive dimensional. We were not doing this check up till now - and the user could accidentally create parameterizations like this - and create a problem for themselves. This will ensure that even - though one can construct a SubsetParameterization where all - parameters are constant, you cannot actually use it as a local - parameterization for an entire parameter block. Which is how - it was before, but the check was inside the SubsetParameterization - constructor. - - 3. Added more tests and refactored existing tests to be more - granular. - - Change-Id: Ic0184a1f30e3bd8a416b02341781a9d98e855ff7 - -commit a36693f83da7a3fd19dce473d060231d4cc97499 +commit e886d7e65368e73e9d35c2ead895d81ced677977 Author: Sameer Agarwal -Date: Sat Sep 17 16:31:41 2016 -0700 +Date: Mon May 25 13:09:39 2020 -0700 - Update version history + Reduce the number of minimizer iterations in evaluation_callback_test.cc - Change-Id: Ib2f0138ed7a1879ca3b2173e54092f7ae8dd5c9d + This should reduce the probability of the test heuristic failing due + to floating point issues. + + https://github.com/ceres-solver/ceres-solver/issues/562 + https://github.com/ceres-solver/ceres-solver/issues/392 + + Change-Id: I8ccf4164a8d595f5930d378f464313d4a2cae419 -commit 01e23e3d33178fdd050973666505c1080cfe04c3 -Author: David Gossow -Date: Thu Sep 8 12:22:28 2016 +0200 +commit 9483e6f2f57bf51bad7cefd155cd5b48ca672c63 +Author: Sameer Agarwal +Date: Tue May 12 05:16:32 2020 -0700 - Removing duplicate include directive. + Simplify DynamicCompressedRowJacobianWriter::Write - Change-Id: I729ae6501497746d1bb615cb893ad592e16ddf3f + Change-Id: I67aa2959bd479909b5cada79359c5cfdb8a37ef7 -commit 99b8210cee92cb972267537fb44bebf56f812d52 +commit 323cc55bb92a513924e566f487b54556052a716f Author: Sameer Agarwal -Date: Wed Sep 7 15:31:30 2016 -0700 +Date: Mon May 25 10:38:35 2020 -0700 - Update Android.mk to include new files. + Update the version in package.xml to 2.0.0. - Change-Id: Id543ee7d2a65b65c868554a17f593c0a4958e873 + Change-Id: Ibac053916520e8c597c875a8c7f5668bb35b6ba1 -commit 195d8d13a6a3962ac39ef7fcdcc6add0216eb8bc -Author: Sameer Agarwal -Date: Tue Sep 6 07:12:23 2016 -0700 +commit 303b078b50bd3311a9c86fc256be3e9f2f334411 +Author: Bayes Nie +Date: Sun May 24 16:08:52 2020 +0800 - Remove two DCHECKs from CubicHermiteSpline. + Fix few typos and alter a NULL to nullptr. - They were present as debugging checks but were causing problems - with the build on 32bit i386 due to numerical cancellation issues, - where x ~ -epsilon. + Fix typos in docs/source/features.rst and examples/helloworld.cc. Alter a NULL to nullptr in include/ceres/autodiff_cost_function.h - Removing these checks only changes the behaviour in Debug mode. - We are already handling such small negative numbers in production - if they occur. All that this change does is to remove the crash. + Change-Id: Ibcf00b6ef665ad6be9af14b3add2dd4f3852e7e6 + +commit cca93fed63dd4117f3d6dd5339131fc7674e6e0a +Author: Alex Stewart +Date: Sun May 24 18:05:05 2020 +0100 + + Bypass Ceres' FindGlog.cmake in CeresConfig.cmake if possible - https://github.com/ceres-solver/ceres-solver/issues/212 + - If the version of glog detected and used to build Ceres was built with + CMake (i.e. Config mode) then we now use Config mode directly in + CeresConfig.cmake and do not install Ceres' FindGlog.cmake module. + - This has the benefit of removing any hard-coded paths from + CeresConfig.cmake provided that all dependencies were also built with + CMake. - Thanks to @NeroBurner and @debalance for reporting this. + Change-Id: I85af8a953fd6d300e8bc0cdeb0b3636fec182f68 + +commit 77fc1d0fc4159ebb3a0a84a16651564eb2ce3c9d +Author: Alex Stewart +Date: Sun May 24 19:07:26 2020 +0100 + + Use build_depend for private dependencies in Catkin package.xml - Change-Id: I66480e86d4fa0a4b621204f2ff44cc3ff8d01c04 + Change-Id: If0c0569e7ebbf37c0d8e8daaf7765e20a6282531 -commit 83041ac84f2d67c28559c67515e0e596a3f3aa20 -Author: Sameer Agarwal -Date: Fri Sep 2 19:10:35 2016 -0700 +commit a09682f00d8e50ada3c7ed16f8c48fa71a423f60 +Author: Alex Stewart +Date: Sun May 24 16:49:28 2020 +0100 - Fix some compiler warnings. + Fix MSVC version check to support use of clang-cl front-end - Reported by Richard Trieu. + - Raised as issue: #521 - Change-Id: I202b7a7df09cc19c92582d276ccf171edf88a9fb + Change-Id: Iaea6b43484b90ec8789bda0447c8a90759974ec1 -commit 8c4623c63a2676e79e7917bb0561f903760f19b9 -Author: Sameer Agarwal -Date: Thu Sep 1 00:05:09 2016 -0700 +commit b70687fcc86624c7d5520d25734938fa95d2af73 +Author: Alex Stewart +Date: Sun May 24 20:28:12 2020 +0100 - Update ExpectArraysClose to use ExpectClose instead of EXPECT_NEAR + Add namespace qualified Ceres::ceres CMake target - The documentation for ExpectArraysClose and its implementation - did not match. + - This reflects modern CMake style, and also provides a measure of + protection against missing find_package() imports in downstream + clients resulting in linker errors when 'ceres' matches the compiled + library and not the imported target. + - The original 'ceres' target remains, as a local imported interface + target created by CeresConfig for backwards compatibility. - This change makes the polynomial_test not fail on 64bit AMD builds. + Change-Id: Ie9ed8de9b7059bc0cae1ae5002bb94d8fe617188 + +commit 99efa54bdb4e14c3f4382a166baf6772113f74a8 +Author: Alex Stewart +Date: Sun May 24 19:18:38 2020 +0100 + + Replace type aliases deprecated/removed in C++17/C++20 from FixedArray - Thanks to Phillip Huebner for reporting this. + - Raised as issue #551 + - Also adds C++20 to the set of ALLOWED_CXX_STANDARDS, although this + will require a version of CMake >= 3.12. - Change-Id: I503f2d3317a28d5885a34f8bdbccd49d20ae9ba2 + Change-Id: I0f13c72e93a35391fd2d18590b4243a329a2322c -commit 2fd39fcecb47eebce727081c9ffb8edf86c33669 +commit adb973e4a337c372aa81ca1a4f3bb704068c08b7 Author: Sameer Agarwal -Date: Thu Sep 1 16:05:06 2016 -0700 +Date: Thu May 21 14:45:28 2020 -0700 - FindWithDefault returns by value rather than reference. - - Returning by reference leads to lifetime issues with the default - value which may go out of scope by the time it is used. - - Thanks to @Ardavel for reporting this, as this causes graph_test - to fail on VS2015x64. - - https://github.com/ceres-solver/ceres-solver/issues/216 + NULL -> nullptr - Change-Id: I596481219cfbf7622d49a6511ea29193b82c8ba3 + Change-Id: Iaeea2ef7912d328653a76b65976adc8025a5be35 -commit 716f049a7b91a8f3a4632c367d9534d1d9190a81 -Author: Mike Vitus -Date: Wed Aug 31 13:38:30 2016 -0700 +commit 27b717951b58c134b3a5a9f664a66c7480364d6c +Author: Alastair Harrison +Date: Fri May 15 10:10:12 2020 +0100 - Convert pose graph 2D example to glog and gflags. + Respect FIND_QUIETLY flag in cmake config file - Change-Id: I0ed75a60718ef95199bb36f33d9eb99157d11d40 + Ensure that Ceres does not print any log messages when somebody has + used 'find_package(Ceres QUIET)' in their CMake project. + + Change-Id: Id6b68859cc8a5857f3fa78f29736cb82fd5a0943 -commit 46c5ce89dda308088a5fdc238d0c126fdd2c2b58 -Author: David Gossow -Date: Wed Aug 31 18:40:57 2016 +0200 +commit 646959ef118a1f10bf93741d97cf64265d42f8c6 +Author: huangqinjin +Date: Sat Apr 25 02:03:11 2020 +0800 - Fix compiler errors on some systems + Do not export class template LineParameterization - This fixes some signed-unsigned comparisons and a missing header - include. + For MSVC, instantiating a dllimport class template will cause error C2491: + definition of dllimport function not allowed. - Change-Id: Ieb2bf6e905faa74851bc4ac4658d2f1da24b6ecc + Change-Id: Icc7f7ea84598df0a5436f48ffc2bab5cfab93921 -commit b102d53e1dd7dab132e58411183b6fffc2090590 -Author: David Gossow -Date: Wed Aug 31 10:21:20 2016 +0200 +commit 1f128d070a24224d12eb901bc74ba393ccdbd0c3 +Author: huangqinjin +Date: Mon Mar 4 13:14:43 2019 +0800 - Gradient checker multithreading bugfix. + Change the type of parameter index/offset to match their getter/setter - This is a follow-up on c/7470. GradientCheckingCostFunction calls - callback_->SetGradientErrorDetected() in its Evaluate method, - which will run in multiple threads simultaneously when enabling - this option in the solver. Thus, the string append operation - inside that method has to be protected by a mutex. + Change-Id: If28b795e792f39db9775ada105e9038570195329 + +commit 072c8f070e16cb32f211473c40196c6b5618d5a9 +Author: huangqinjin +Date: Sat Apr 25 00:04:58 2020 +0800 + + Initialize integer variables with integer instead of double - Change-Id: I314ef1df2be52595370d9af05851bf6da39bb45e + Change-Id: I652aca4ceb3129706a5d5e38afe9f16b61200a5b -commit 79a28d1e49af53f67af7f3387d07e7c9b7339433 -Author: Sameer Agarwal -Date: Wed Aug 31 06:47:45 2016 -0700 +commit 8c36bcc81fbd4f78a2faa2c914ef40af264f4c31 +Author: Alex Stewart +Date: Mon Apr 27 18:33:25 2020 +0100 - Rename a confusingly named member of Solver::Options + Use inline & -inlinehint-threshold in auto-diff benchmarks - Solver::Options::numeric_derivative_relative_step_size to - Solver::Options::gradient_check_numeric_derivative_relative_step_size + - This results in the same performance as the original solution of + increasing -inline-threshold, but this approach is more viable to + incorporate in a large code base as its effects are more targeted. - Change-Id: Ib89ae3f87e588d4aba2a75361770d2cec26f07aa + Change-Id: Id798dbca7d3050de0ea847a5ecc69484ac78a2cf -commit 358ae741c8c4545b03d95c91fa546d9a36683677 +commit 57cf20aa5d3c1b2f25d255814f4fff5260db81c6 Author: Sameer Agarwal -Date: Wed Aug 31 06:58:41 2016 -0700 +Date: Tue Apr 21 10:10:01 2020 -0700 - Note that Problem::Evaluate cannot be called from an IterationCallback + static const -> static constexpr where we can. - Change-Id: Ieabdc2d40715e6b547ab22156ba32e9c8444b7ed + Change-Id: I8a6d26a89c4377dd440fa6dcf23513b7556533fc -commit 44044e25b14d7e623baae4505a17c913bdde59f8 +commit 40b27482a202c8b0a5f9e8f2b4be0192d34195f5 Author: Sameer Agarwal -Date: Wed Aug 31 05:50:58 2016 -0700 +Date: Tue Apr 21 09:35:30 2020 -0700 - Update the NumTraits for Jets + Add std::numeric_limit specialization for Jets - 1. Use AVX if EIGEN_VECTORIZE_AVX is defined. - 2. Make the cost of division same as the cost of multiplication. + This allows users to use std::numeric_limits on templated functors. - These are updates to the original numtraits update needed for eigen 3.3 - that Shaheen Gandhi sent out. - - Change-Id: Ic1e3ed7d05a659c7badc79a894679b2dd61c51b9 + Change-Id: I403cec5c9826033ce7dfd6047deb64f66c35f806 -commit 4b6ad5d88e45ce8638c882d3e8f08161089b6dba -Author: Sameer Agarwal -Date: Sat Aug 27 23:21:55 2016 -0700 +commit e751d6e4f0daa9f691c5ed25ca8dc564875d8bef +Author: Darius Rueckert +Date: Wed Apr 8 10:43:53 2020 +0200 - Use ProductParameterization in bundle_adjuster.cc - - Previously, when using a quaternion to parameterize the camera - orientation, the camera parameter block was split into two - parameter blocks. One for the rotation and another for the - translation and intrinsics. This was to enable the use of the - Quaternion parameterization. + Remove AutodiffCodegen - Now that we have a ProductParameterization which allows us - to compose multiple parameterizations, this is no longer needed - and we use a size 10 parameter block instead. + - Remove Codegen files + - Revert Jet and Rotation - This leads to a more than 2x improvements in the linear solver time. - - Change-Id: I78b8f06696f81fee54cfe1a4ae193ee8a5f8e920 + Change-Id: I005c5f98f2b6dfa5c7fd88d998b6aa83e47dab60 -commit bfc916cf1cf753b85c1e2ac037e2019ee891f6f9 -Author: Shaheen Gandhi -Date: Thu Aug 4 12:10:14 2016 -0700 +commit e9eb76f8ef9835940659cfb3a312ed6822c48152 +Author: Darius Rueckert +Date: Mon Apr 6 11:11:43 2020 +0200 - Allow ceres to be used with the latest version of Eigen + Remove AutodiffCodegen CMake integration - Change-Id: Ief3b0f6b405484ec04ecd9ab6a1e1e5409a594c2 + Change-Id: I403597540df8429378336626b8f748b7821fe6f5 -commit edbd48ab502aa418ad9700ee5c3ada5f9268b90a -Author: Alex Stewart -Date: Sun Jul 10 14:13:51 2016 +0100 +commit 9435e08a7a7c903897e18e1dc24d801caf4f62a4 +Author: Sameer Agarwal +Date: Fri Apr 3 11:50:09 2020 -0700 - Enable support for OpenMP in Clang if detected. - - - Previously we disabled OpenMP if Clang was detected, as it did not - support it. However as of Clang 3.8 (and potentially Xcode 8) OpenMP - is supported. + More clang-tidy and wjr@ comment fixes - Change-Id: Ia39dac9fe746f1fc6310e08553f85f3c37349707 + Change-Id: I5736ae482f736fc56c00d21c659b1f8d41da68e9 -commit f6df6c05dd83b19fa90044106ebaca40957998ae -Author: Mike Vitus -Date: Thu Aug 18 19:27:43 2016 -0700 +commit d93fac4b7ab670a936ce821284a0b9d099b4688c +Author: Darius Rueckert +Date: Fri Apr 3 09:33:17 2020 +0200 - Add an example for modeling and solving a 3D pose graph SLAM problem. + Remove AutodiffCodegen Tests - Change-Id: I750ca5f20c495edfee5f60ffedccc5bd8ba2bb37 + Change-Id: Icd194db7b22add518844f1b507d0fdd3e0fe17fe -commit ac3b8e82175122e38bafaaa9cd419ba3cee11087 -Author: David Gossow -Date: Fri Apr 29 16:07:11 2016 +0200 +commit 2281c6ed24d2c12f133fa6039f224b3da18cebe3 +Author: Sameer Agarwal +Date: Thu Apr 2 16:43:42 2020 -0700 - Gradient checking cleanup and local parameterization bugfix - - Change the Ceres gradient checking API to make is useful for - unit testing, clean up code duplication and fix interaction between - gradient checking and local parameterizations. - - There were two gradient checking implementations, one being used - when using the check_gradients flag in the Solver, the other - being a standalone class. The standalone version was restricted - to cost functions with fixed parameter sizes at compile time, which - is being lifted here. This enables it to be used inside the - GradientCheckingCostFunction as well. + Fixes for comments from William Rucklidge - In addition, this installs new hooks in the Solver to ensure - that Solve will fail if any incorrect gradients are detected. This - way, you can set the check_gradient flags to true and detect - errors in an automated way, instead of just printing error information - to the log. The error log is now also returned in the Solver summary - instead of being printed directly. The user can then decide what to - do with it. The existing hooks for user callbacks are used for - this purpose to keep the internal API changes minimal and non-invasive. - - The last and biggest change is the way the the interaction between - local parameterizations and the gradient checker works. Before, - local parameterizations would be ignored by the checker. However, - if a cost function does not compute its Jacobian along the null - space of the local parameterization, this wil not have any effect - on the solver, but would result in a gradient checker error. - With this change, the Jacobians are multiplied by the Jacobians - of the respective local parameterization and thus being compared - in the tangent space only. - - The typical use case for this are quaternion parameters, where - a cost function will typically assume that the quaternion is - always normalized, skipping the correct computation of the Jacobian - along the normal to save computation cost. - - Change-Id: I5e1bb97b8a899436cea25101efe5011b0bb13282 + Change-Id: I64fcc25532cc66dc4cb7e2ea7ccfb220b0cb7e1f -commit d4264ec10d9a270b53b5db86c0245ae8cbd2cf18 -Author: Mike Vitus -Date: Wed Aug 17 13:39:05 2016 -0700 +commit d797a87a4091af6ae0063e3c8291429c15318bdc +Author: Sameer Agarwal +Date: Thu Apr 2 13:57:56 2020 -0700 - Add a quaternion local parameterization for Eigen's quaternion element convention. + Use Ridders' method in GradientChecker. - Change-Id: I7046e8b24805313c5fb6a767de581d0054fcdb83 - -commit fd7cab65ef30fbc33612220abed52dd5073413c4 -Author: Mike Vitus -Date: Wed Aug 10 09:29:12 2016 -0700 - - Fix typos in the pose graph 2D example. + Using Ridders' method gives orders of magnitude more accuracy compared + to central differences. This will make things slower, but this is + primarily a testing/debugging feature and the speed hit is not a + concern. This should also reduce the false positive rates when users + enable check_gradients. This is reflected the increased sensitivity of + the tests for GradientChecker. + + https://github.com/ceres-solver/ceres-solver/issues/554 - Change-Id: Ie024ff6b6cab9f2e8011d21121a91931bd987bd1 + Change-Id: I6b871c72df55be1c31175ba062cf3c1e94e4b662 -commit 375dc348745081f89693607142d8b6744a7fb6b4 -Author: Mike Vitus -Date: Wed Aug 3 18:51:16 2016 -0700 +commit 41675682dc9df836bf15845064cfe1087619c79d +Author: Sameer Agarwal +Date: Thu Apr 2 07:28:38 2020 -0700 - Remove duplicate entry for the NIST example in the docs. + Fix a MSVC type deduction bug in ComputeHouseholderVector - Change-Id: Ic4e8f9b68b77b5235b5c96fe588cc56866dab759 + A recent change made this function templated and MSVC 16 has trouble + doing automatic argument deduction, so the type of the template is + simplified and all callsites are explicitly annotated with the type + of the arguments. + + Change-Id: I83cd0269e6e82c4a8f4e391f5fc03b92c942f74d -commit f554681bf22d769abc12dd6d346ef65f9bb22431 -Author: Mike Vitus -Date: Mon Jul 25 18:30:48 2016 -0700 +commit 947ec0c1fa0f67c89e21daaf8d1648822ae5293a +Author: Darius Rueckert +Date: Thu Apr 2 09:52:53 2020 +0200 - Add an example for modeling and solving a 2D pose graph SLAM problem. + Remove AutodiffCodegen autodiff benchmarks - Change-Id: Ia89b12af7afa33e7b1b9a68d69cf2a0b53416737 + Change-Id: If1eaad31710cc91d40323ea6cae7cabe6fa64b1f -commit e1bcc6e0f51512f43aa7bfb7b0d62f7ac1d0cd4b +commit 27183d661ecae246dbce6d03cacf84f39fba1f1e Author: Sameer Agarwal -Date: Wed May 18 07:52:48 2016 -0700 +Date: Thu Jul 11 16:30:59 2019 +0200 - Add additional logging for analyzing orderings + Allow LocalParameterizations to have zero local size. + + Local parameterizations with zero tangent/local size will cause the + corresponding parameter block to be treated as constant. - Change-Id: Ic68d2959db35254e2895f11294fb25de4d4b8a81 + https://github.com/ceres-solver/ceres-solver/issues/347 + + Change-Id: I554a2acc420f5dd9d0cc7f97b691877eb057b2c0 -commit 16980b4fec846f86910c18772b8145bcb55f4728 -Author: Mike Vitus -Date: Fri Jul 15 13:37:49 2016 -0700 +commit 7ac7d79dca2ac6b482da50fd9ad0227ba8d6c632 +Author: Darius Rueckert +Date: Wed Apr 1 14:51:12 2020 +0200 - Delete the remove_definitons command from sampled_functions - CMakeLists.txt because it will be inherited from the top level examples - CMakeLists.txt. + Remove HelloWorldCodegen example - Change-Id: I25593587df0ae84fd8ddddc589bc2a13f3777427 + Change-Id: I2584f41d591a5d648b4832385c2a779bb25fc04d -commit a04490be97800e78e59db5eb67fa46226738ffba -Author: Mike Vitus -Date: Thu Jul 14 10:10:13 2016 -0700 +commit 8c8738bf832f0fc27f0d4a9585fc59b2eaa6a828 +Author: Nikolaus Demmel +Date: Sun Mar 29 13:29:02 2020 +0200 - Add readme for the sampled_function example. + Add photometric and relative-pose residuals to autodiff benchmarks - Change-Id: I9468b6a7b9f2ffdd2bf9f0dd1f4e1d5f894e540c + Change-Id: Id100ff2656ab63bb4fd19a51b95e78281cfd8b4a -commit ff11d0e63d4678188e8cabd40a532ba06912fe5a -Author: Alex Stewart -Date: Wed Jun 29 09:31:45 2016 +0100 +commit 9f7fb66d62014ed62ba6aa617364e8591211c797 +Author: Darius Rueckert +Date: Wed Mar 25 11:41:39 2020 +0100 - Use _j[0,1,n]() Bessel functions on MSVC to avoid deprecation errors. + Add a constant cost function to the autodiff benchmarks + + The constant cost function is run with a variable number of + parameters to test at which point, different compilers fail + to optimize the autodiff code. - - Microsoft deprecated the POSIX Bessel functions: j[0,1,n]() in favour - of _j[0,1,n](), it appears since at least MSVC 2005: - https://msdn.microsoft.com/en-us/library/ms235384(v=vs.100).aspx. - - As this occurs in jet.h (templated public header), although Ceres - suppresses the warning when it itself is built (to suppress a warning - about the insecurity of using std::copy), it will crop up again in - client code (without this fix) unless it is explicitly suppressed - there also. - - Raised as Issue #190: - https://github.com/ceres-solver/ceres-solver/issues/190. + Clang achieves expected performance which fails at >50 parameters. + G++ fails already at 20 parameters - Change-Id: If7ac5dbb856748f9900be93ec0452a40c0b00524 + Change-Id: I75d8c683ef0011d813ec6d966d7ad58f86530f44 -commit 8ea86e1614cf77644ce782e43cde6565a54444f5 -Author: Nicolai Wojke -Date: Mon Apr 25 14:24:41 2016 +0200 +commit ab0d373e465f46ce483db640d0fb2f244f48702d +Author: Sameer Agarwal +Date: Tue Mar 24 12:30:46 2020 -0700 - Fix: Copy minimizer option 'is_silent' to LinSearchDirection::Options + Fix a comment in autodiff.h - Change-Id: I23b4c3383cad30033c539ac93883d77c8dd4ba1a + Change-Id: I613e537c834e3f29cd92808c65ddb74f112974cc -commit 080ca4c5f2ac42620971a07f06d2d13deb7befa8 -Author: Sameer Agarwal -Date: Sun Apr 24 22:46:54 2016 -0700 +commit 27bb997144d00dd4494d440627f1e782bf4adf43 +Author: Johannes Beck +Date: Tue Mar 24 08:05:43 2020 +0100 - Fix typos in users.rst + Change SVD algorithm in covariance computation. - Change-Id: Ifdc67638a39403354bc9589f42a1b42cb9984dd2 + Switch from JacobiSVD to BDCSVD in + ComputeCovarianceValuesUsingDenseSVD. This should increase + the performance for larger covariance matrices. See + https://eigen.tuxfamily.org/dox/classEigen_1_1BDCSVD.html + + Change-Id: Icde4dec89f506b638b0f9f1aee3b7cfc9e4d72fc -commit 21ab397dc55335c147fdd795899b1f8981037b09 -Author: Sameer Agarwal -Date: Sun Apr 24 21:13:00 2016 -0700 +commit 84fdac38e033c8f9a63c6e6fca7b44219110f7df +Author: Johannes Beck +Date: Tue Mar 24 08:02:21 2020 +0100 - Make some Jet comparisons exact. + Add const to GetCovarianceMatrix* + + This CL adds const to the functions GetCovarianceMatrix and + GetCovarianceMatrixInTangentSpace. - Change-Id: Ia08c72f3b8779df96f5c0d5a954b2c0a1dd3a061 + Change-Id: Ibe2cafebede47977a9aabcac8d245f30af184fd1 -commit ee40f954cf464087eb8943abf4d9db8917a33fbe -Author: Sameer Agarwal -Date: Sun Apr 24 07:49:55 2016 -0700 +commit 6bde61d6be9d81a2cd759a6bbb4a8cd3c24a529c +Author: Johannes Beck +Date: Sat Dec 28 13:29:19 2019 +0100 - Add colmap to users.rst + Add line local parameterization. + + This CL adds a local parameterization for a n-dimensional + line, which is represented as an origin point and a direction. + The line direction is updated in the same way as a + homogeneous vector and the origin point is updated + perpendicular to the line direction. - Change-Id: I452a8c1dc6a3bc55734b2fc3a4002ff7939ba863 + Change-Id: I733f395e5cc4250abf9778c26fe0a5ae1de6b624 -commit 9665e099022bd06e53b0779550e9aebded7f274d +commit 2c1c0932e9d3f91691e5c5fce46b4440e181a8bc Author: Sameer Agarwal -Date: Mon Apr 18 06:00:58 2016 -0700 +Date: Mon Mar 23 11:15:32 2020 -0700 - Fix step norm evaluation in LineSearchMinimizer + Update documentation in autodiff.h - TrustRegionMinimizer evaluates the size of the step - taken in the ambient space, where as the LineSearchMinimizer - was using the norm in the tangent space. This change fixes - this discrepancy. - - Change-Id: I9fef64cbb5622c9769c0413003cfb1dc6e89cfa3 + Change-Id: Icc2753b4f5be95022ffd92e479cdd3d9d7959d4c -commit 620ca9d0668cd4a00402264fddca3cf6bd2e7265 -Author: Alex Stewart -Date: Mon Apr 18 15:14:11 2016 +0100 +commit 8904fa4887ed7b3e6d110ad5a98efbc2df48595e +Author: Darius Rueckert +Date: Mon Mar 23 14:59:26 2020 +0100 - Remove use of -Werror when compiling Ceres. + Inline Jet initialization in Autodiff + + Inlining the Jet initialzation is mandatory for good performance + in autodiff, because all the constants in the dual part can be + propagated into the cost functor. - - As noted in Issue #193 (in that case for GCC 6), Ceres' use of -Werror - when compiling on *nix can prevent compilation on new compilers that - add new warnings and there is an inevitable delay between new compiler - versions and Ceres versions. - - Removing the explicit use of -Werror, and relying on indirect - verification by maintainers should fix build issues for Ceres releases - on newer compilers. + This patch unrolls the initialization loop with templates and adds + EIGEN_ALWAYS_INLINE to the constructors. - Change-Id: I38e9ade28d4a90e53dcd918a7d470f1a1debd7b4 + Change-Id: Ic89d645984f3e1df6c63948236da823ba60d9620 -commit 0c63bd3efbf1d41151c9fab41d4b77dc64c572c8 -Author: Mike Vitus -Date: Thu Apr 14 10:25:52 2016 -0700 +commit 18a464d4e566e17930005876af19e32cc8796fa3 +Author: Sameer Agarwal +Date: Mon Mar 23 07:12:12 2020 -0700 - Add floor and ceil functions to the Jet implementation. + Remove an errant CR from local_parameterization.cc - Change-Id: I72ebfb0e9ade2964dbf3a014225ead345d5ae352 + Change-Id: Iff98a96f06de5755062a1c79523604dca78b298e -commit 9843f3280356c158d23c06a16085c6c5ba35e053 -Author: Alex Stewart -Date: Mon Mar 7 21:24:32 2016 +0000 +commit 5c85f21799804d39cbfd20ec451aa219511e4212 +Author: Darius Rueckert +Date: Mon Mar 23 10:12:00 2020 +0100 - Report Ceres compile options as components in find_package(). + Use ArraySelector in Autodiff - - Users can now specify particular components from Ceres, such as - SuiteSparse support) that must be present in a detected version of - Ceres in order for it to be reported as found by find_package(). - - This allows users to specify for example that they require a version - of Ceres with SuiteSparse support at configure time, rather than - finding out only at run time that Ceres was not compiled with the - options they require. - - The list of available components are built directly from the Ceres - compile options. - - The meta-module SparseLinearAlgebraLibrary is present if at least - one sparse linear algebra backend is available. + The class ArraySelector is now used in autodiff to store the + parameters and residuals. This reduces overhead of FixedArray + for fixed-sized residuals and allows more optimizations due + to inlining and unrolling. - Change-Id: I65f1ddfd7697e6dd25bb4ac7e54f5097d3ca6266 + Change-Id: Ibadc5644e64d672f7a555e250fb1f8da262f9d4f -commit e4d4d88bbe51b9cc0f7450171511abbea0779790 -Author: Timer -Date: Fri Apr 8 15:42:18 2016 +0800 +commit 80477ff073ab7af03cfb248cab4ef41a87f913d0 +Author: Darius Rueckert +Date: Fri Mar 20 16:26:55 2020 +0100 - Fix a spelling error in nnls_modeling.rst + Add class ArraySelector - Change-Id: I341d901d3df993bc5397ed15e6cb330b0c38fd72 + The ArraySelector selects the best array implementation based on + template arguments. + + Change-Id: I93c6db1a638e924b85292e63bca9525610ec2e2f -commit 5512f58536e1be0d92010d8325b606e7b4733a08 -Author: Keir Mierle -Date: Thu Apr 7 12:03:16 2016 -0700 +commit e7a30359ee754057f9bd7b349c98c291138d91f4 +Author: Darius Rueckert +Date: Fri Mar 20 15:50:37 2020 +0100 - Only use collapse() directive with OpenMP 3.0 or higher + Pass kNumResiduals to Autodiff + + The compile-time constant kNumResiduals is now passed to the + autodiff functions as a template parameter. This will be used + by future patches to optimize autodiff performance. - Change-Id: Icba544c0494763c57eb6dc61e98379312ca15972 + Change-Id: Ia2b2cc99b88752e8f12f4ce2542b1963bda552f5 -commit d61e94da5225217cab7b4f93b72f97055094681f -Author: Thomas Schneider -Date: Wed Apr 6 10:40:29 2016 +0200 +commit f339d71dd64e4d871cc883f278a153f212f0d1f0 +Author: Sameer Agarwal +Date: Thu Mar 19 12:08:28 2020 -0700 + + Refactor the automatic differentiation benchmarks. + + 1. Merge them into a single binary. + 2. All benchmarks now do the Residual and the Residual + Jacobian + evaluation. + 3. Re-organize and simplify the CMake file in this directory. + 4. Fix a bug in the file where the Clang compiler was not being matched. + + autodiff_benchmarks + --------------------------------------------------------------------------- + Benchmark Time CPU Iterations + --------------------------------------------------------------------------- + BM_Linear1CodeGen/0 3.02 ns 3.01 ns 233870456 + BM_Linear1CodeGen/1 3.02 ns 3.01 ns 233059100 + BM_Linear1AutoDiff/0 3.78 ns 3.77 ns 185791712 + BM_Linear1AutoDiff/1 14.0 ns 13.8 ns 53927875 + BM_Linear10CodeGen/0 5.10 ns 5.10 ns 126745007 + BM_Linear10CodeGen/1 29.1 ns 29.1 ns 23949310 + BM_Linear10AutoDiff/0 6.50 ns 6.49 ns 107516972 + BM_Linear10AutoDiff/1 169 ns 169 ns 4153218 + BM_Rat43AutoDiff/0 52.7 ns 51.2 ns 16444586 + BM_Rat43AutoDiff/1 91.8 ns 91.5 ns 7302316 + BM_SnavelyReprojectionCodeGen/0 38.0 ns 36.2 ns 21131501 + BM_SnavelyReprojectionCodeGen/1 113 ns 112 ns 5627779 + BM_SnavelyReprojectionAutoDiff/0 34.4 ns 34.3 ns 20476937 + BM_SnavelyReprojectionAutoDiff/1 242 ns 240 ns 2930611 + BM_BrdfCodeGen/0 53.9 ns 53.7 ns 11950083 + BM_BrdfCodeGen/1 507 ns 505 ns 1396732 + BM_BrdfAutoDiff/0 58.3 ns 57.8 ns 12220670 + BM_BrdfAutoDiff/1 2034 ns 1999 ns 257003 + + autodiff_benchmarks_fast_math + --------------------------------------------------------------------------- + Benchmark Time CPU Iterations + --------------------------------------------------------------------------- + BM_Linear1CodeGen/0 3.19 ns 3.16 ns 215313065 + BM_Linear1CodeGen/1 2.78 ns 2.76 ns 201497994 + BM_Linear1AutoDiff/0 3.27 ns 3.26 ns 206154598 + BM_Linear1AutoDiff/1 13.2 ns 13.1 ns 57257840 + BM_Linear10CodeGen/0 5.70 ns 5.51 ns 121849325 + BM_Linear10CodeGen/1 33.9 ns 33.3 ns 21829295 + BM_Linear10AutoDiff/0 6.85 ns 6.78 ns 106813153 + BM_Linear10AutoDiff/1 173 ns 171 ns 3849877 + BM_Rat43AutoDiff/0 44.8 ns 44.2 ns 15577017 + BM_Rat43AutoDiff/1 96.2 ns 94.6 ns 7374864 + BM_SnavelyReprojectionCodeGen/0 33.9 ns 33.5 ns 20508373 + BM_SnavelyReprojectionCodeGen/1 89.7 ns 88.4 ns 7620624 + BM_SnavelyReprojectionAutoDiff/0 36.5 ns 35.8 ns 20546176 + BM_SnavelyReprojectionAutoDiff/1 257 ns 252 ns 3044325 + BM_BrdfCodeGen/0 61.1 ns 58.5 ns 11334013 + BM_BrdfCodeGen/1 265 ns 265 ns 2625459 + BM_BrdfAutoDiff/0 52.5 ns 52.5 ns 12938763 + BM_BrdfAutoDiff/1 1560 ns 1560 ns 440909 + + Change-Id: I2d1a4293d3245a50f73af6cf5e5138084321ae6f + +commit d37b4cb150c4af65268f9ce5739d1c67e73cb358 +Author: Sameer Agarwal +Date: Thu Mar 19 07:36:58 2020 -0700 - Add IsParameterBlockConstant to the ceres::Problem class. + Fix some include headers in codegen/test_utils.cc/h - Change-Id: I7d0e828e81324443209c17fa54dd1d37605e5bfe + Change-Id: I769029ce2797eba0de6c7baeb76dc3f2782b6305 -commit 77d94b34741574e958a417561702d6093fba87fb -Author: Alex Stewart -Date: Sun Feb 14 16:54:03 2016 +0000 +commit 550766e6da49dca895a6e2056b0872c557157c5b +Author: Darius Rueckert +Date: Wed Mar 18 20:09:20 2020 +0100 - Fix install path for CeresConfig.cmake to be architecture-aware. + Add Autodiff Brdf Benchmark - - Previously we were auto-detecting a "64" suffix for the install path - for the Ceres library on non-Debian/Arch Linux distributions, but - we were installing CeresConfig.cmake to an architecture independent - location. - - We now install CeresConfig.cmake to lib${LIB_SUFFIX}/cmake/Ceres. - - Also make LIB_SUFFIX visible to the user in the CMake GUI s/t they can - easily override the auto-detected value if desired. - - Reported by jpgr87@gmail.com as Issue #194. + The disney brdf is a good benchmark cost functor, because it has + - 28 parameters in 7 blocks + - 3 residuals + - Lots of low-level arithmetic - Change-Id: If126260d7af685779487c01220ae178ac31f7aea + Change-Id: I62c8a717d0aecb64639158f971bdccf6afdfae36 diff --git a/extern/ceres/bundle.sh b/extern/ceres/bundle.sh index 02af59faf28..573db5a0a2f 100755 --- a/extern/ceres/bundle.sh +++ b/extern/ceres/bundle.sh @@ -9,7 +9,6 @@ fi repo="https://ceres-solver.googlesource.com/ceres-solver" branch="master" -#tag="1.4.0" tag="" tmp=`mktemp -d` checkout="$tmp/ceres" @@ -157,14 +156,10 @@ add_definitions( -DCERES_NO_SUITESPARSE -DCERES_NO_CXSPARSE -DCERES_NO_LAPACK + -DCERES_NO_ACCELERATE_SPARSE -DCERES_HAVE_RWLOCK + -DCERES_USE_CXX_THREADS ) -if(WITH_OPENMP) - add_definitions( - -DCERES_USE_OPENMP - ) -endif() - blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}" "\${LIB}") EOF diff --git a/extern/ceres/files.txt b/extern/ceres/files.txt index 4d973bbcdc2..bfbd57090c9 100644 --- a/extern/ceres/files.txt +++ b/extern/ceres/files.txt @@ -1,29 +1,37 @@ include/ceres/autodiff_cost_function.h +include/ceres/autodiff_first_order_function.h include/ceres/autodiff_local_parameterization.h include/ceres/c_api.h include/ceres/ceres.h include/ceres/conditioned_cost_function.h +include/ceres/context.h include/ceres/cost_function.h include/ceres/cost_function_to_functor.h include/ceres/covariance.h include/ceres/crs_matrix.h +include/ceres/cubic_interpolation.h include/ceres/dynamic_autodiff_cost_function.h +include/ceres/dynamic_cost_function.h include/ceres/dynamic_cost_function_to_functor.h include/ceres/dynamic_numeric_diff_cost_function.h -include/ceres/fpclassify.h +include/ceres/evaluation_callback.h +include/ceres/first_order_function.h include/ceres/gradient_checker.h include/ceres/gradient_problem.h include/ceres/gradient_problem_solver.h +include/ceres/internal/array_selector.h include/ceres/internal/autodiff.h include/ceres/internal/disable_warnings.h include/ceres/internal/eigen.h include/ceres/internal/fixed_array.h -include/ceres/internal/macros.h -include/ceres/internal/manual_constructor.h +include/ceres/internal/householder_vector.h +include/ceres/internal/integer_sequence_algorithm.h +include/ceres/internal/line_parameterization.h +include/ceres/internal/memory.h include/ceres/internal/numeric_diff.h +include/ceres/internal/parameter_dims.h include/ceres/internal/port.h include/ceres/internal/reenable_warnings.h -include/ceres/internal/scoped_ptr.h include/ceres/internal/variadic_evaluate.h include/ceres/iteration_callback.h include/ceres/jet.h @@ -37,8 +45,13 @@ include/ceres/problem.h include/ceres/rotation.h include/ceres/sized_cost_function.h include/ceres/solver.h +include/ceres/tiny_solver_autodiff_function.h +include/ceres/tiny_solver_cost_function_adapter.h +include/ceres/tiny_solver.h include/ceres/types.h include/ceres/version.h +internal/ceres/accelerate_sparse.cc +internal/ceres/accelerate_sparse.h internal/ceres/array_utils.cc internal/ceres/array_utils.h internal/ceres/blas.cc @@ -63,21 +76,26 @@ internal/ceres/block_structure.cc internal/ceres/block_structure.h internal/ceres/callbacks.cc internal/ceres/callbacks.h +internal/ceres/canonical_views_clustering.cc +internal/ceres/canonical_views_clustering.h internal/ceres/c_api.cc internal/ceres/casts.h internal/ceres/cgnr_linear_operator.h internal/ceres/cgnr_solver.cc internal/ceres/cgnr_solver.h -internal/ceres/collections_port.h internal/ceres/compressed_col_sparse_matrix_utils.cc internal/ceres/compressed_col_sparse_matrix_utils.h internal/ceres/compressed_row_jacobian_writer.cc internal/ceres/compressed_row_jacobian_writer.h internal/ceres/compressed_row_sparse_matrix.cc internal/ceres/compressed_row_sparse_matrix.h +internal/ceres/concurrent_queue.h internal/ceres/conditioned_cost_function.cc internal/ceres/conjugate_gradients_solver.cc internal/ceres/conjugate_gradients_solver.h +internal/ceres/context.cc +internal/ceres/context_impl.cc +internal/ceres/context_impl.h internal/ceres/coordinate_descent_minimizer.cc internal/ceres/coordinate_descent_minimizer.h internal/ceres/corrector.cc @@ -85,6 +103,7 @@ internal/ceres/corrector.h internal/ceres/covariance.cc internal/ceres/covariance_impl.cc internal/ceres/covariance_impl.h +internal/ceres/cxsparse.cc internal/ceres/cxsparse.h internal/ceres/dense_jacobian_writer.h internal/ceres/dense_normal_cholesky_solver.cc @@ -102,11 +121,21 @@ internal/ceres/dynamic_compressed_row_jacobian_writer.cc internal/ceres/dynamic_compressed_row_jacobian_writer.h internal/ceres/dynamic_compressed_row_sparse_matrix.cc internal/ceres/dynamic_compressed_row_sparse_matrix.h +internal/ceres/dynamic_sparse_normal_cholesky_solver.cc +internal/ceres/dynamic_sparse_normal_cholesky_solver.h +internal/ceres/eigensparse.cc +internal/ceres/eigensparse.h internal/ceres/evaluator.cc internal/ceres/evaluator.h internal/ceres/execution_summary.h internal/ceres/file.cc internal/ceres/file.h +internal/ceres/float_cxsparse.cc +internal/ceres/float_cxsparse.h +internal/ceres/float_suitesparse.cc +internal/ceres/float_suitesparse.h +internal/ceres/function_sample.cc +internal/ceres/function_sample.h internal/ceres/generated/partitioned_matrix_view_2_2_2.cc internal/ceres/generated/partitioned_matrix_view_2_2_3.cc internal/ceres/generated/partitioned_matrix_view_2_2_4.cc @@ -118,10 +147,12 @@ internal/ceres/generated/partitioned_matrix_view_2_3_9.cc internal/ceres/generated/partitioned_matrix_view_2_3_d.cc internal/ceres/generated/partitioned_matrix_view_2_4_3.cc internal/ceres/generated/partitioned_matrix_view_2_4_4.cc +internal/ceres/generated/partitioned_matrix_view_2_4_6.cc internal/ceres/generated/partitioned_matrix_view_2_4_8.cc internal/ceres/generated/partitioned_matrix_view_2_4_9.cc internal/ceres/generated/partitioned_matrix_view_2_4_d.cc internal/ceres/generated/partitioned_matrix_view_2_d_d.cc +internal/ceres/generated/partitioned_matrix_view_3_3_3.cc internal/ceres/generated/partitioned_matrix_view_4_4_2.cc internal/ceres/generated/partitioned_matrix_view_4_4_3.cc internal/ceres/generated/partitioned_matrix_view_4_4_4.cc @@ -138,17 +169,18 @@ internal/ceres/generated/schur_eliminator_2_3_9.cc internal/ceres/generated/schur_eliminator_2_3_d.cc internal/ceres/generated/schur_eliminator_2_4_3.cc internal/ceres/generated/schur_eliminator_2_4_4.cc +internal/ceres/generated/schur_eliminator_2_4_6.cc internal/ceres/generated/schur_eliminator_2_4_8.cc internal/ceres/generated/schur_eliminator_2_4_9.cc internal/ceres/generated/schur_eliminator_2_4_d.cc internal/ceres/generated/schur_eliminator_2_d_d.cc +internal/ceres/generated/schur_eliminator_3_3_3.cc internal/ceres/generated/schur_eliminator_4_4_2.cc internal/ceres/generated/schur_eliminator_4_4_3.cc internal/ceres/generated/schur_eliminator_4_4_4.cc internal/ceres/generated/schur_eliminator_4_4_d.cc internal/ceres/generated/schur_eliminator_d_d_d.cc -internal/ceres/generate_eliminator_specialization.py -internal/ceres/generate_partitioned_matrix_view_specializations.py +internal/ceres/generate_template_specializations.py internal/ceres/gradient_checker.cc internal/ceres/gradient_checking_cost_function.cc internal/ceres/gradient_checking_cost_function.h @@ -157,12 +189,15 @@ internal/ceres/gradient_problem_evaluator.h internal/ceres/gradient_problem_solver.cc internal/ceres/graph_algorithms.h internal/ceres/graph.h -internal/ceres/householder_vector.h internal/ceres/implicit_schur_complement.cc internal/ceres/implicit_schur_complement.h -internal/ceres/integral_types.h +internal/ceres/inner_product_computer.cc +internal/ceres/inner_product_computer.h +internal/ceres/invert_psd_matrix.h internal/ceres/is_close.cc internal/ceres/is_close.h +internal/ceres/iterative_refiner.cc +internal/ceres/iterative_refiner.h internal/ceres/iterative_schur_complement_solver.cc internal/ceres/iterative_schur_complement_solver.h internal/ceres/lapack.cc @@ -190,14 +225,21 @@ internal/ceres/low_rank_inverse_hessian.h internal/ceres/map_util.h internal/ceres/minimizer.cc internal/ceres/minimizer.h -internal/ceres/mutex.h internal/ceres/normal_prior.cc +internal/ceres/pair_hash.h +internal/ceres/parallel_for_cxx.cc +internal/ceres/parallel_for.h +internal/ceres/parallel_for_nothreads.cc +internal/ceres/parallel_for_openmp.cc +internal/ceres/parallel_utils.cc +internal/ceres/parallel_utils.h internal/ceres/parameter_block.h internal/ceres/parameter_block_ordering.cc internal/ceres/parameter_block_ordering.h internal/ceres/partitioned_matrix_view.cc internal/ceres/partitioned_matrix_view.h internal/ceres/partitioned_matrix_view_impl.h +internal/ceres/partitioned_matrix_view_template.py internal/ceres/polynomial.cc internal/ceres/polynomial.h internal/ceres/preconditioner.cc @@ -222,14 +264,23 @@ internal/ceres/schur_complement_solver.h internal/ceres/schur_eliminator.cc internal/ceres/schur_eliminator.h internal/ceres/schur_eliminator_impl.h +internal/ceres/schur_eliminator_template.py internal/ceres/schur_jacobi_preconditioner.cc internal/ceres/schur_jacobi_preconditioner.h +internal/ceres/schur_templates.cc +internal/ceres/schur_templates.h +internal/ceres/scoped_thread_token.h internal/ceres/scratch_evaluate_preparer.cc internal/ceres/scratch_evaluate_preparer.h +internal/ceres/single_linkage_clustering.cc +internal/ceres/single_linkage_clustering.h +internal/ceres/small_blas_generic.h internal/ceres/small_blas.h internal/ceres/solver.cc internal/ceres/solver_utils.cc internal/ceres/solver_utils.h +internal/ceres/sparse_cholesky.cc +internal/ceres/sparse_cholesky.h internal/ceres/sparse_matrix.cc internal/ceres/sparse_matrix.h internal/ceres/sparse_normal_cholesky_solver.cc @@ -239,7 +290,14 @@ internal/ceres/split.h internal/ceres/stl_util.h internal/ceres/stringprintf.cc internal/ceres/stringprintf.h +internal/ceres/subset_preconditioner.cc +internal/ceres/subset_preconditioner.h +internal/ceres/suitesparse.cc internal/ceres/suitesparse.h +internal/ceres/thread_pool.cc +internal/ceres/thread_pool.h +internal/ceres/thread_token_provider.cc +internal/ceres/thread_token_provider.h internal/ceres/triplet_sparse_matrix.cc internal/ceres/triplet_sparse_matrix.h internal/ceres/trust_region_minimizer.cc @@ -251,7 +309,10 @@ internal/ceres/trust_region_step_evaluator.h internal/ceres/trust_region_strategy.cc internal/ceres/trust_region_strategy.h internal/ceres/types.cc +internal/ceres/visibility_based_preconditioner.cc internal/ceres/visibility_based_preconditioner.h +internal/ceres/visibility.cc +internal/ceres/visibility.h internal/ceres/wall_time.cc internal/ceres/wall_time.h config/ceres/internal/config.h diff --git a/extern/ceres/include/ceres/autodiff_cost_function.h b/extern/ceres/include/ceres/autodiff_cost_function.h index e7893e4828e..5e6e9c55db5 100644 --- a/extern/ceres/include/ceres/autodiff_cost_function.h +++ b/extern/ceres/include/ceres/autodiff_cost_function.h @@ -1,5 +1,5 @@ // Ceres Solver - A fast non-linear least squares minimizer -// Copyright 2015 Google Inc. All rights reserved. +// Copyright 2019 Google Inc. All rights reserved. // http://ceres-solver.org/ // // Redistribution and use in source and binary forms, with or without @@ -30,7 +30,7 @@ // // Create CostFunctions as needed by the least squares framework, with // Jacobians computed via automatic differentiation. For more -// information on automatic differentation, see the wikipedia article +// information on automatic differentiation, see the wikipedia article // at http://en.wikipedia.org/wiki/Automatic_differentiation // // To get an auto differentiated cost function, you must define a class with a @@ -54,7 +54,7 @@ // for a series of measurements, where there is an instance of the cost function // for each measurement k. // -// The actual cost added to the total problem is e^2, or (k - x'k)^2; however, +// The actual cost added to the total problem is e^2, or (k - x'y)^2; however, // the squaring is implicitly done by the optimization framework. // // To write an auto-differentiable cost function for the above model, first @@ -90,7 +90,7 @@ // Dimension of x ---------------+ | // Dimension of y ------------------+ // -// In this example, there is usually an instance for each measumerent of k. +// In this example, there is usually an instance for each measurement of k. // // In the instantiation above, the template parameters following // "MyScalarCostFunctor", "1, 2, 2", describe the functor as computing a @@ -110,12 +110,8 @@ // Dimension of x ------------------------------------+ | // Dimension of y ---------------------------------------+ // -// The framework can currently accommodate cost functions of up to 10 -// independent variables, and there is no limit on the dimensionality -// of each of them. -// // WARNING #1: Since the functor will get instantiated with different types for -// T, you must to convert from other numeric types to T before mixing +// T, you must convert from other numeric types to T before mixing // computations with other variables of type T. In the example above, this is // seen where instead of using k_ directly, k_ is wrapped with T(k_). // @@ -129,8 +125,9 @@ #ifndef CERES_PUBLIC_AUTODIFF_COST_FUNCTION_H_ #define CERES_PUBLIC_AUTODIFF_COST_FUNCTION_H_ +#include + #include "ceres/internal/autodiff.h" -#include "ceres/internal/scoped_ptr.h" #include "ceres/sized_cost_function.h" #include "ceres/types.h" #include "glog/logging.h" @@ -138,7 +135,7 @@ namespace ceres { // A cost function which computes the derivative of the cost with respect to -// the parameters (a.k.a. the jacobian) using an autodifferentiation framework. +// the parameters (a.k.a. the jacobian) using an auto differentiation framework. // The first template argument is the functor object, described in the header // comment. The second argument is the dimension of the residual (or // ceres::DYNAMIC to indicate it will be set at runtime), and subsequent @@ -153,27 +150,15 @@ namespace ceres { // of residuals for a single autodiff cost function at runtime. template // Number of parameters in block 9. -class AutoDiffCostFunction : public SizedCostFunction { + int... Ns> // Number of parameters in each parameter block. +class AutoDiffCostFunction : public SizedCostFunction { public: // Takes ownership of functor. Uses the template-provided value for the // number of residuals ("kNumResiduals"). - explicit AutoDiffCostFunction(CostFunctor* functor) - : functor_(functor) { - CHECK_NE(kNumResiduals, DYNAMIC) - << "Can't run the fixed-size constructor if the " - << "number of residuals is set to ceres::DYNAMIC."; + explicit AutoDiffCostFunction(CostFunctor* functor) : functor_(functor) { + static_assert(kNumResiduals != DYNAMIC, + "Can't run the fixed-size constructor if the number of " + "residuals is set to ceres::DYNAMIC."); } // Takes ownership of functor. Ignores the template-provided @@ -183,13 +168,10 @@ class AutoDiffCostFunction : public SizedCostFunction - ::set_num_residuals(num_residuals); + static_assert(kNumResiduals == DYNAMIC, + "Can't run the dynamic-size constructor if the number of " + "residuals is not ceres::DYNAMIC."); + SizedCostFunction::set_num_residuals(num_residuals); } virtual ~AutoDiffCostFunction() {} @@ -197,29 +179,28 @@ class AutoDiffCostFunction : public SizedCostFunction