- Remove TERNARY (replaced by function call)
- Combine PARAMETER and RUNTIME_CONSTANT into INPUT_ASSIGNMENT
Change-Id: Id35fb45da08a9f80c1ac0dab7008deb0b3922835
- Add missing copy constructor
- Add make functions for input/output expressions
- Add missing ExpressionRef overload for MakeRuntimeConstant
- Add ExpressionRef overloads for common functions (cos,exp,...)
- Make ExpressionRef constructor from double implicit
- Add simple test for using ExpressionRef in Jets.
- Rename expression test macro
Change-Id: I071dc6717e4034a281662021998a91e80636da27
- Fix Homebrew Ruby errors by forcing brew update before install.
- Remove use of custom Eigen 3.3.4 on Linux in favour of default Bionic
3.3.4 package.
- Update Android NDK version to R20b and build for arm64-v8.
- Fix erroneous string -> STRING in iOS toolchain file.
Change-Id: I041c2a08b92b8307c12bd8967159beb6984e3c65
- As detailed in a previous CL, Xcode 11.0-1 exhibited a -fstack-check
bug on 10.15 Catalina that broke alignment for at least AVX
instructions causing segfaults from within Eigen.
- As Xcode 11.2 fixes this issue, and is probably a more reliable fix
than -fno-stack-check, we now require the user update in this case.
Change-Id: I482748fe5f40f82e7daf4da133cdfabbd95ffc89
- Expression types for if/else blocks
- CERES_IF/ELSE macros
- Multiple assignment to the same variable
Change-Id: If529516f243f31823d1ef7b8827bb6f2390e418d
- On macOS 10.15 and Xcode 11 -fstack-check is enabled by default. This
breaks SIMD alignment (and other alignment) as detailed here:
https://forums.developer.apple.com/thread/121887 resulting in random
segfaults from within Eigen.
- The underlying problem also exists with earlier OS versions running
Xcode 11 if -fstack-check is explicitly enabled.
- This CL explicitly disables -fstack-check on affected versions of
macOS 10.15 and Xcode 11.
Change-Id: I74d964281c360710d5fb722ac59e6930b0fdcc41
In the docs, `Solver::Options::gradient_check_relative_precision` is
documented to have a default precision of 1e08. That is incorrect, it
should be 1e-8.
Change-Id: Ib6b29e356738de4b555c77f7ffd1224d0cae4b6a
This patch adds the 'Expression' class, which is a fundamental
building block of automatic code generation. The expressions can
be used as scalar types for cost functors as well as Jets.
Dynamic branching is not yet supported.
Change-Id: I8c61bee5c307e0eec20fd39382683ea90f720dff
A number of algorithms like the SchurEliminator do not need
access to the full BlockSparseMatrix interface. They only
need read only access to the values array and the block structure.
This change introduces, BlockSparseDataMatrix a struct that carries
these two bits of information and modifies the Schur type algorithms
to use it.
What this change will allow us to do, in a subsequent CL is to
take the values array of a BlockSparseMatrix and pair it with
a different blocks structure for subset preconditioning.
Change-Id: I1808f12531b586c9ff4d6a70b3d390c7b0d9f441
The CHECK was to see if SuiteSparseQR returns a non-null QR
factorization. However this can cause problems in production, so its
better to return false and let the user deal with the failure in
factorization.
Change-Id: I4e67f343e30547f4257d0315d507df9864c06dcc
1. Mismatched variable names in local_parameterization.h/cc
2. Add missing final directives in iterative_refiner_test.cc
Change-Id: I954ef00d74c3b5d99f3659cc5c6ee2293fa9ff92
Also run clang-format on schur_complement_solver.cc.
A more elaborate integration is not done, because it will cause
binary bloat.
Change-Id: Idf4e9e1794f7401a39f05fb145ec06459209a1e1
If Ceres is compiled without a LAPACK implementation, there is
no need to declare these function signatures.
Thanks to David Sinuela for reporting this.
Change-Id: I048d1f9d38cef55368d33e74d363cd39f425dbf4
Now that we are using c++11, it is safer to use override in subclasses
instead of virtual.
This CL does it for the interface, a follow up CL will do it for
other parts of the code base.
Change-Id: Ice8d0f4355cb700019d7a9c1566fbff0099e97d6
- Maintain scratch workspaces for solving/refactoring instead of
forcing Sparse[Refactor/Solve]() to reallocate space on each call.
Change-Id: Idb9eda9c9c6cc7570cfdf851e59e5bf6b39521ce
https://github.com/ceres-solver/ceres-solver/issues/270
Detailed list of changes:
1. Add SUBSET to the PreconditionerType enum.
2. Add Solver::Options::residual_blocks_for_subset_preconditioner
3. Integrate SubsetPreconditioner into the CGNR solver.
4. Add the reordering logic needed for this to TrustRegionPreprocessor.
5. Expect CreateJacobianBlockTranspose to take the starting row block
so that we can work with subparts of the Jacobian matrix.
6. Extend the denoising example to use this preconditioner.
As an illustration of its performance, we consider the performance of
denoising -input ../data/ceres_noisy.pgm --foe_file ../data/5x5.foe
tl;dr
For the same cost,
SPARSE_NORMAL_CHOLESKY - 81s
CGNR + JACOBI - 718s
CGNR + SUBSET - 57s
SPARSE_NORMAL_CHOLESKY
======================
Cost:
Initial 2.317806e+05
Final 2.232323e+04
Change 2.094574e+05
Minimizer iterations 10
Successful steps 10
Unsuccessful steps 0
Time (in seconds):
Preprocessor 2.999746
Residual only evaluation 2.306811 (10)
Jacobian & residual evaluation 7.421727 (10)
Linear solver 65.517273 (10)
Minimizer 78.731011
Postprocessor 0.026079
Total 81.756836
Termination: CONVERGENCE (Function tolerance reached. |cost_change|/cost: 8.573046e-04 <= 1.000000e-03)
CGNR + JACOBI
=============
Cost:
Initial 2.317806e+05
Final 2.232344e+04
Change 2.094572e+05
Minimizer iterations 10
Successful steps 10
Unsuccessful steps 0
Time (in seconds):
Preprocessor 0.648814
Residual only evaluation 2.297607 (10)
Jacobian & residual evaluation 7.327886 (10)
Linear solver 699.601248 (10)
Minimizer 712.419493
Postprocessor 0.024014
Total 713.092321
Termination: CONVERGENCE (Function tolerance reached. |cost_change|/cost: 8.528538e-04 <= 1.000000e-03)
CGNR + SUBSET (random 20% residuals used for the preconditioner)
===============================================================
Cost:
Initial 2.317806e+05
Final 2.232327e+04
Change 2.094574e+05
Minimizer iterations 10
Successful steps 10
Unsuccessful steps 0
Time (in seconds):
Preprocessor 1.472743
Residual only evaluation 2.428315 (10)
Jacobian & residual evaluation 7.367796 (10)
Linear solver 42.585999 (10)
Minimizer 55.664459
Postprocessor 0.024098
Total 57.161301
Termination: CONVERGENCE (Function tolerance reached. |cost_change|/cost: 8.538277e-04 <= 1.000000e-03)
Change-Id: Ifb011408bd53edbb9439b0b7345649a38f999e18
As a pure CMake package, ceres-solver doesn't need catkin to be built.
This change makes the package buildable using colcon as well.
Change-Id: I3c21f201f947a0e4e87da2708ab9e799816ba97a
- Accelerate currently does not support dynamic sparsity, whereas the
other sparse linear algebra libraries do (outstanding issue to update)
- Previously we preferred Accelerate to all but SuiteSparse if it was
available, which breaks the dynamic_sparsity_test if SuiteSparse is
*not* available (even if others are) as Accelerate does not support
dynamic sparsity.
Change-Id: Ibc2dd2f14f83cffbecca38097d02bb2188aaaa05
Some methods in Problem do not modify the parameter block
and those methods now allow the user to call them with const double*.
The methods are
RemoveParameterBlock
SetParameterBlockConstant
IsParameterBlockConstant
GetParameterization
GetParameterLowerBound
GetParameterUpperBound
https://github.com/ceres-solver/ceres-solver/issues/479
Change-Id: I59dcb77134f59576dd498bd732e29aae9abd28b1
The implicitly-declared copy constructor and copy assignment operator
of ProductParameterization are not deleted since the corresponding
functions of the member vector are defined, though ill-formed if they
are instantiated.
With dllexport, the compiler must generate all of the member functions
of the class, including those are implicitly-declared, so we need
explicitly delete the ill-formed ones.
Change-Id: Iaa763dfaefdc74a9840f244ba05c6bfd0bd99492
This change only affects the TRUST_REGION minimizer and has no effect
on the LINE_SEARCH minimizer.
This options controls the number of iterations that the line search
algorithm performs. The line search algorithm is as the name implies,
used in the LINE_SEARCH minimizer. It is also used by the TRUST_REGION
minimizer when solving bounds constrained optimization problems.
In some bounds constrained problems, it is enough to project each step
onto the bounds constraints and not perform the line search. This can
have a significant impact on runtime. Setting
Solver::Options::max_num_line_search_step_size_iterations = 0 enables
this functionality.
Changchang Wu (ccwu@google.com) came up with the idea for this
implementation.
https://github.com/ceres-solver/ceres-solver/issues/477
Change-Id: Ifbe0bc5c48eedb2c1231d43cd98e4be7316c0682
When reasoning about the function_tolerance based convergence,
LineSearchMinimizer assumed that the objective function is
positive. This used to be the case when LineSearchMinimizer was used
for minimizing non-linear least squares problems. However, with
GradientProblemSolver, the objective function can be negative (for
example when maximizing a function).
This change the minimizer to use the absolute value of the change
from one iteration to another.
https://github.com/ceres-solver/ceres-solver/issues/478
Change-Id: I831e2db96b092374e167c582ab1480b1831d5650
1. ProblemEvaluateResidualTest was leaking the loss_function in cases
where it was not being used.
2. Fix a grammo in rotation.h
Change-Id: If94ae1624033c8f6d1934dc2f40fa0dfe4e025c3
This method gives the user the ability to evaluate a given residual
block.
A couple of minor cleanups.
Problem::problem_impl_ -> Problem::impl_
NULL -> nullptr
https://github.com/ceres-solver/ceres-solver/issues/417
Change-Id: I6dd94762c475fa264c387b8c93d516f6e06fe832
This commit includes the following:
- Changes to CMake to make it safer to see which compiler flags are supported,
so this way we do not need to worry about version checks in CMake.
- Unix platforms (which includes both Linux and Apple as far as i can tell)
will now enable -Wmissing-declarations warning for the whole Ceres.
- Changes in all sources to solve missing declaration warning. In most cases
it was either matter of using static qualifier or moving functions to an
anonymous namespace.
In one case the function got removed, since it seems to be unused.
Additionally, in slam examples there was a non-inlined function implementation
in a header, which is a direct way to cause linking errors if other .cc file
will include that helper header.
- All third party sources (which is currently only gmock) has this extra
paranoid warning disabled.
This warning is important in the following cases:
- Detect helper functions which are not needed anymore.
- Avoid unnoticed pollution of namespace.
- Avoid bad level calls.
- Avoid missing updates in header files after changes in implementation file.
- Helps integrating Ceres into software where paranoid warnings are important.
Change-Id: I9b1044aced3910d8c6b2356cfe2bf57f3c8c58db
This CL modernizes ProductParameterization in the following ways:
- It uses std::unique_ptr for memory handling instead of using raw
pointers and handmade memory management.
- Replaces the constructors with a variadic template.
Change-Id: I5c9fe42ac935b6c26e867dbd3369a4c766623047
Some rotation functions like UnitQuaternionRotatePoint,
QuaternionRotatePoint, etc. will calculate bad results if the input
point and output point points to the same memory (inplace operation).
This CL adds checks in debug mode to guard against it.
Change-Id: Id0a30e9a0286b340757f0790d417d9f9a3409810
The latest Bazel releases have deprecated Bazel-native
"http_archive()" directive in favor of a Skylark version.
This updates the WORKSPACE to use the new format, as well
as removing the Eigen BUILD in favor of a string in the
WORKSPACE.
Fixes: https://github.com/ceres-solver/ceres-solver/issues/463
Change-Id: I2f7051316dbe0c1f283423c56b7672ab83a30860
For proper alignment on the heap Eigen needs to have a custom
allocator. There are two forms, new and in-place new. To make sure
that memory is aligned using new, one needs to overload new by
adding EIGEN_MAKE_ALIGNED_OPERATOR_NEW to any struct which contains a
fixed size Eigen type either through inheritance or as a direct or
indirect member. For the in-place new one need to use the
Eigen::aligned_allocator (e.g. for std::vector, std::list,
FixedArray, etc.). For more details see:
https://eigen.tuxfamily.org/dox/group__DenseMatrixManipulation__Alignement.html
This CL adds EIGEN_MAKE_ALIGNED_OPERATOR_NEW to all structs, which
contain fixed-size Eigen types and uses the Eigen::aligned_allocator
for containers which stores structs of fixed-size Eigen types.
Change-Id: I06c6c4fc74a6835918d5d1c571b7814a14c029d8
This PR changes the implementation of the current fixed array to the
abseil one, which has proper allocator support.
Some minor changes are made to make the fixed array implementation
self-contained (no dependent to abseil):
- No address sanitizer support (red zones, etc.)
- Remove of noexecpt specified for copy and move constructor.
- Remove of 'at' function as Ceres does not use exceptions.
- Use std::tuple instead of absl::CompressedTuple as it uses the abseil
utility header which includes a whole bunch of other headers.
Change-Id: I43445b42c37f944509b5353a587d0efce74cbccf