Previously these classes in analogy with ceres::Problem's interface
had interfaces to allow bare pointers as well as unique_ptrs. This
CL changes the API to always use unique_ptr, this is less error prone
and makes the default ownership semantics clearer.
Change-Id: I7577a90761f341c7e009c248c820f0fec2e6f32d
Starting with SuiteSparse version 7.4.0 CHOLMOD has support for single
precision matrices. This allows us to have single precision and mixed
precision solves when using the SUITE_SPARSE backend.
This CL also fixes sparse_cholesky_test which was completely broken for
single precision testing.
Sample performance on my Mac.
/usr/bin/time -l ./bin/bundle_adjuster --input=../../Downloads/problem-3068-310854-pre.txt
<SNIP>
Cost:
Initial 9.099334e+07
Final 4.161838e+06
Change 8.683150e+07
Minimizer iterations 6
Successful steps 4
Unsuccessful steps 2
Time (in seconds):
Preprocessor 2.528222
Residual only evaluation 0.142804 (5)
Jacobian & residual evaluation 0.424014 (4)
Linear solver 54.083396 (5)
Minimizer 54.895752
Postprocessor 0.024564
Total 57.448539
Termination: NO_CONVERGENCE (Maximum number of iterations reached. Number of iterations: 5.)
59.04 real 341.24 user 5.49 sys
5776375808 maximum resident set size
<SNIP>
616329634071 instructions retired
929475980510 cycles elapsed
5375034560 peak memory footprint
/usr/bin/time -l ./bin/bundle_adjuster --input=../../Downloads/problem-3068-310854-pre.txt -mixed_precision_solves
<SNIP>
Cost:
Initial 9.099334e+07
Final 4.148930e+06
Change 8.684441e+07
Minimizer iterations 6
Successful steps 4
Unsuccessful steps 2
Time (in seconds):
Preprocessor 2.580217
Residual only evaluation 0.144098 (5)
Jacobian & residual evaluation 0.396723 (4)
Linear solver 23.636074 (5)
Minimizer 24.427163
Postprocessor 0.023790
Total 27.031170
Termination: NO_CONVERGENCE (Maximum number of iterations reached. Number of iterations: 5.)
28.58 real 128.53 user 2.37 sys
4818386944 maximum resident set size
<SNIP>
395186936091 instructions retired
368802808856 cycles elapsed
4327029824 peak memory footprint
Change-Id: I1f137b0dd12da8da7f9ced338dd8f20f4bbdf99d
If the user has checked out the submodules in third_party, they will be
used, otherwise we will try and find the system installed versions of
these dependencies and use them if they are modern enough.
Change-Id: I52164bc48a6ea804b85cdda05fee9cb94632f6c0
Generator expressions were introduced in CMake version 3.24. Without
them including absl::log_flags as an internal dependency causes
linking problems on some platforms. So for platforms with an older
CMake version we make absl::log_flags a public dependency.
Change-Id: I686f41e76b0ac17a03f1cd1d614372a7f130dfd9
Previously this header was included in absl/log/log.h
but going forward this header will not be included.
Change-Id: Ie663b221d90e32a852fb00dfe20f731dcd1dcf6b
Replace WallTimeInSeconds with absl::Now and use
absl::Time and absl::Duration objects instead of doubles.
wall_time.h/cc -> event_logger.h/cc
Change-Id: I41279961368840fbdf6bb3456ffdbdf2f9bfb85b
Replace ceres::String* with their more modern and performant
absl strings library equivalent and delete our string
manipulation library.
Change-Id: Iecbdba9864e0abf329778f81fdc0708f78f7594f
Ceres Solver was using an old forked version of FixedArray,
now that we are using absl, we can use the official version
that ships with it.
Change-Id: Ic88d7f6e8a49b928d611f7cbb04172452b322b01
1. Add abseil-cpp as a submodule. We are tracking the latest LTS
release, which is lts_2024_01_16.
2. Replace glog/gflags with absl::log and absl::flags.
3. Remove miniglog
4. Also take a whack at making the bazel build work with
abseil-cpp and gtest.
There are a number of TODOs in this CL that still need to be resolved.
Change-Id: I39355ed7d61375be4ebcbc8596d9cc70acc1c678
cuDSS could be used as an alternative for SuiteSparse and EigenSparse
in case if CUDA capable GPU is available.
Change-Id: I7a567093ce91363478118153e181134ed5804573
We now use googletest as a git submodule instead
of the old way of converting it into a single header
and including it in the source.
This removes the dependence on googleflags for tests
to be enabled.
Change-Id: If25ea3ba7a39c2b8ba9c6effbed3e7173361b6b1
The CellInfo struct contains a mutex, which interacts poorly
with some standard library containers which may move things around.
As a result we were using std::unique_ptr<CellInfo> in these
containers, but this change gets rid of that level of indirection
as std::unordered_map can construct CellInfo in place and we can
replace the use of std::vector with an array we know will not be
resized.
This improves the performance of the schur eliminator a bit but
also the performance of the block diagonal preconditioners.
Change-Id: If3ccd1273a754d9c5112e6e611ce31066b6b27b5
This avoids warnings such as
D:\a\ceres-solver\ceres-solver\internal\ceres\cuda_kernels_bsm_to_crs.cu.cc(143): warning #550-D: variable "row_nnz_e" was set but never used [D:\a\ceres-solver\ceres-solver\build_Release\internal\ceres\ceres_cuda_kernels.vcxproj]
int row_nnz_e = 0;
^
detected during instantiation of "void ceres::internal::RowBlockIdAndNNZ(int, int, int, const int *, const ceres::internal::Cell *, const ceres::internal::Block *, const ceres::internal::Block *, int *, int *, int *) [with partitioned=false]" at line 240
Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"
that is caused by compile-time conditional use of the variable.
Change-Id: I041b076a5208eeb662b8c7500d7b238965be833c
std::copy_n is defined in <algorithm>, which is not explicitly included
and therefore causes compilation errors with the recent GCC 14.1 and/or
CUDA 12.4.1.
Change-Id: I9fcab48770ccfc5ec195dca5a190ceaad9debe81
Fixes the following two warnings:
preconditioner.h:64:11: warning: field 'f_block_size' will be initialized after field 'elimination_groups' [-Wreorder-ctor]
block_sparse_matrix.cc:70:19: warning: unused parameter 'values' [-Wunused-parameter]
Change-Id: I5cc55ca387b3f12259096c1531c263279650bd49
This reverts commit 4027f69975.
Reason for revert: This breaks the build because this constructor syntax is only present in the unstable/development version of eigen. So the macro check is incorrect.
Change-Id: I1e664208c7c50041e295aeb7c4b65259f9f2fc8f
This function is not used and is not written correctly to
deal with the case wherre Schur specialization is disabled.
Change-Id: I48509317e6df5f9cdc37c81e879fad425bb2d037
If arguments are passed to a cost function that can be used to construct
the functor, the latter will be instantiated by the cost function using
std::make_unique to ensure exception safety. This not only avoids static
analysis warnings caused by calling new but also spelling the cost
functor type name multiple times.
Also expand deduction guides for instantiating
Dynamic(Auto|Numeric)DiffCostFunction from std::unique_ptr enabled
constructor overloads.
Finally, make CostFunction default move constructible and assignable but
only through derived classes. This in turn allows derived classes to be
movable without relying on custom implementations of corresponding
operators.
Change-Id: Idee8b9871d862bc9f9f8b5a8d0bedc52863e93c0
Move Bessel functions availability checks from configuration time to
inclusion time to be more robust and allow the use of ABI compatible
compilers (e.g., Ceres is compiled using Clang but is used in a project
compiled using GCC.)
Since libc++ does not yet implement special math functions, we fallback
to their POSIX implementation if available. However, then only the
deprecated BesselJ{0,1,n} are provided.
Fixes#814
Change-Id: Ic3e62452b36e90cb22644cc8e553e3dd1881193f