When Solver::Options::check_gradients is true, Ceres internally
creates a new ProblemImpl object which wraps each CostFunction
in the user's problem with a GradientCheckingCostFunction.
Doing this also requires creating new ParameterBlock objects,
and when support for upper and lower bounds was added to Ceres,
CreateGradientCheckingProblemImpl should also have been updated
to create a problem with the same parameter bounds. As a result,
if check_gradients is enabled for a bounded problem, it constructs
an unconstrained problem and solves it.
This CL fixes this, by introducing Problem::GetParameterLowerBound,
and Problem::GetParameterUpperBound and using them to create a bounded
problem when checking gradients.
Thanks to @pbeeson for not only reporting this problem, but also
providing a small standalone reproduction which made debugging this
possible.
https://github.com/ceres-solver/ceres-solver/issues/379
Change-Id: Id18eb858a7009bf4fa452a21b925922d13f3249f
CMake support in Android is now standard and the CMake file
has fuller richer functionality than the Android.mk file ever did.
https://github.com/ceres-solver/ceres-solver/issues/364
Change-Id: Ib79bcc19dd47495a81a5d07fafdf06eb8005984e
- In light of the C++11 threads threading option this is no longer
necessary for cross-platform threading support and did not offer a
noticeable performance gain over either the C++11 threads
implementation or OpenMP.
Change-Id: Icb588d520888c19a1775171795b55bcaffb3d256
- Now that we require CMake >= 3.x, we can roll the definition of the
include directories for clients linking against Ceres into the
exported Ceres CMake target via target_include_directories().
- This removes the requirement for CERES_INCLUDE_DIRS.
Change-Id: Ibe3bbf796339871d66138fc9520053d1766f09a8
- Previously we had separate variables for each of the threading
backends, each of which were made mutually exclusive via
cmake_dependent_option(). This has unfortunate side-effects when
trying to disable options if they are not currently enabled, in which
case they are not defined.
- As all the threading options are mutually exclusive, this replaces
all threading option variables with a single variable: CERES_THREADS,
which is constrained to take the value of only the available threading
backends.
Change-Id: I0822eefbac9a30772907b7732add365b37cc8ca0
- As raised in issue #377, GCC_VERSION is not always defined, in which
case we were not enabling compiler optimisations.
- CMAKE_CXX_COMPILER_VERSION is the more modern, uniform method to
verify the compiler version.
- Also removes legacy Apple-GCC (i.e. Apple's fork of GCC prior to their
switch to Clang) logic, and Xcode 4.x logic (in June 2018, Xcode 9.x
is the current version).
- Also removes addition of -march=native on Linux (was not added for
OS X). If users wish to append -march=native (which will affect the
portability of the resulting output) they can do so manually as now
explained in the docs.
- Fixes check for Clang on OS X. As per CMP0025 (CMake 3.0+)
CMAKE_CXX_COMPILER_ID reports AppleClang on OS X, not Clang. Thus
using: if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") would fail for
AppleClang. Instead, MATCHES should be used instead of STREQUAL to
support both Clang & AppleClang.
Change-Id: I9647030b76f4b85a9ef2deea82d80ed79812ae33
Also removed Solver::Summary::num_linear_solver_threads_given
and Solver::Summary::num_linear_solver_threads_used.
Change-Id: I559145ae2e7af597ea06ec03d386645a3a892e9f
- Removes CXX11 option, and all associate paraphernalia. Ceres now
requires a compiler with full >= C++11 support. In MSVC terms this
means >= 2013 Release 4.
- This deprecates the use of CERES_STD_UNORDERED_MAP and CERES_USE_CXX11
as they will now always be defined. They will be removed from the
source in a future CL.
- For clients with CMake >= 3.8 we propagate via the exported/installed
Ceres target the CXX version that was specified when Ceres was built.
For versions < 3.8 (but >= 3.5) we specify the CXX features currently
used in the Ceres public API.
Change-Id: I535b545b10156e4426659c270a4a0649e071df0e
- Use cmake_dependent_option() for all threading models and encode their
respective mutual exclusivity in the dependent-option s/t the job of
ensuring mutual exclusivity is performed by CMake.
- Use of cmake_dependent_option() has the downside that options are
removed from the GUI if their requirements for availability are not
met. So if CXX11 is OFF, then neither TBB nor CXX11_THREADS will
even appear as options (they will be undefined, assumed OFF).
- Perform checks for availability of C++11 if CXX11 is enabled prior to
testing other options to handle dependence of TBB & CXX11_THREADS on
CXX11 actually being present.
- Add check for availability of C++11-specific math functions used in
jet.h before reporting C++11 as found.
- Add check for <atomic> before allowing TBB or CXX11_THREADS, as both
options require it and it may not always be available even if the
other required C++11 components are.
Change-Id: Ife8cd182aeb1978539ce2c9966910ae59ebd9177
This adds a callback mechanism to for users to get notified just
before jacobian and residual evaluations. This will enable
aggressive caching and sharing of compute between cost functions.
Change-Id: I67993726920218edf71ab9ae70c34c204756c71a
This change is provided on behalf of Steve Hsu.
Tested by compiling and inspecting the documentation.
Change-Id: Ib892bcc3ad76cba1bad133a1fd1d26468d0e6437
1. Solver::Options::num_threads now controls parallelism in Ceres
Solver. The user specified value of
Solver::Options::num_linear_solver_threads is ignored.
2. If the user specifies Solver::Options::num_linear_solver_threads
and it is different from Solver::Options::num_threads,
a warning is printed.
3. Solver::Summary:num_linear_solver_threads_given and
Solver::Summary::num_linear_solver_threads_used are also
deprecated and are always set to Solver::Summary::num_threads_given
and Solver::Summary::num_threads_used.
Change-Id: I20b9336d9336e400e6f0a15b63857c0c43eb271c
1. Replace two maps by 1.
2. Update number of calls and the time for the call at the cost
of a single map lookup.
3. Add Solver::Summary::num_linear_solves.
Fixes https://github.com/ceres-solver/ceres-solver/issues/340
Change-Id: I71eb9be7fb363a8cb066591c4c1761f256c81677
1. Fix a typo in auto_diff_cost_function.h
2. Fix and update Solver::Summary::FullReport() text labels.
3. Add logging of the number of residual and jacobian evaluations
to the full report. The GradientProblemSolver already does this.
Change-Id: I41059af5f0ebe0417accbbc30b0808a4b04b9edb
The non-linear least squares solver had the ability to update the
user's parameters every iteration. Now GradientProblemSolver can
do the same.
Also a few minor Sphinx markup related cleanup to the documentation
which were found in the process of updating Sphinx on my machine
and adding the docs for this feature.
This fixes https://github.com/ceres-solver/ceres-solver/issues/246
Change-Id: Ib6b90ac22be8bfb60b14f25ad52082ba371af164
- Update FindSuiteSparse to use FindTBB.cmake to find TBB.
- Fix logic handling of TBB=ON if TBB is not found to continue with
build after disabling TBB rather than throwing a fatal error.
- Use TBB_LIBRARIES instead of TBB_tbb_LIBRARY as a Ceres dependency,
the former also includes the TBB malloc library.
- Add warning message about GPL licensing if TBB version < 2017.
- Add ‘TBB’ & ‘Mulithreading’ component options to find_package(Ceres),
where ‘Mulithreading’ is equivalent to ‘TBB’ || ‘OpenMP’.
Change-Id: Ifc7f1d01b050ba6e2097ad1913b178805df4769a
- Also enable EIGENSPARSE option by default as LGPL licensing
implications are less severe that SuiteSparse’s GPL implications which
is enabled by default.
Change-Id: Ic7e4fef5cef614d5ce719eeefcc35bf4b63b8dac
There are platforms where OpenMP is not available. This
patch adds support for Intel Threading Building Blocks (TBB)
as an alternative threading backend.
Change-Id: I94497d7cba0c3cfaccfc992169236f17fe948ae9
- Previously the LAPACK option meant would Ceres link against LAPACK,
whether directly or indirectly via SuiteSparse (if SUITESPARSE=ON),
as such if LAPACK=OFF, the use of SuiteSparse was disabled, even if
it was found.
- To support the use-case of using a limited LAPACK implementation that
satisfies SuiteSparse’s requirements, but potentially not Ceres’ we
now adopt the more conventional terminology whereby the LAPACK option
refers only to whether Ceres itself will directly call LAPACK
routines, not whether it or any of its dependencies will.
- This means that the LAPACK and SUITESPARSE options are now
independent.
- Also unnecessary calls to find_package(BLAS), as find_package(LAPACK)
already searches for BLAS, and appends the resulting libraries to
LAPACK_LIBRARIES if they are found.
Change-Id: I9cf5fa5e4cb621812f6f0526db8d16a7a39c9c8f
Skip the test in dynamic_sparsity_test when there are no sparse
linear algebra libraries available.
Also fix a minor typo in version_history.rst
Change-Id: Ie7cc14e655c58b6bd9625ce9f9025f94d0624d2d
Update the version history in preparation for 1.13.0RC1 and
also reformat older parts of the version history file.
Change-Id: I133e5966629e8277631ec5d407165ad188efa1e1
1. Fix a bug which was causing the cost and gradient evaluation
time to not be reported.
2. Add the number of times cost and gradients are evaluated to
the Summary object and to the output of FullReport.
Change-Id: Id0703cd2dafbf437f3e537fbdc30ae81d5f4f540
THIS IS AN API BREAKING CHANGE.
Decouple the algorithm from the sparse linear algebra
library being used to perform the computation.
Before this change
Covariance::AlgorithmType had values
DENSE_SVD
EIGEN_SPARSE_QR
SUITE_SPARSE_QR
This has been replaced by two enums now.
Covariance::Options::sparse_linear_algebra_library_type
which can take values EIGEN_SPARSE, SUITE_SPARSE or CX_SPARSE.
The last one is currently not supported.
And Covariance::Options::algorithm_type takes values
DENSE_SVD
SPARSE_QR
This sets the stage for future extensions of the covariance
computation algorithm.
Also as part of this change, the covariance computation chapter
has been made a top level chapter on its own instead of being
buried deep inside the Solving Non-linear Least Squares problem.
Change-Id: Ibfbf60902d8d17694d9ff585047a5a57d329ab22
- Using Ceres_[SOURCE/BINARY]_DIR (which are defined by CMake when
project(Ceres) is called, in favour of CMAKE_[SOURCE/BINARY]_DIR
enables Ceres to be nested within (and built by) a larger CMake
project (which also contains other projects).
- CMAKE_[SOURCE/BINARY]_DIR always refers to the top-level source
and binary directories (i.e. the first encountered), as a result if
Ceres is a nested project within a larger project, these would not
correctly identify the source/binary directories for Ceres (as they
would refer to the root project in which Ceres is nested).
- Using Ceres_[SOURCE/BINARY]_DIR should ensure that Ceres always uses
the correct source/binary directories, irrespective of whether Ceres
is nested or not.
Change-Id: I62226ea3f6552b1d7e2bdac1aef02f1f489ae55e
Doing this also necessitated some re-organization of the derivatives
article into chapters and some minor edits.
Change-Id: Ic08e83af138817173caa80a52a9e72707cd57512
Remove the "Guide" and expose the modeling and solving non-linear
least squares in the left hand side navigation bar.
Change-Id: Ibbb4f0f580a5981165a0945570fc0f4c4ea559e9
1. Refactor the python code that generates the template specializations
to remove code duplication.
2. Improved the logic for template specialization selection where
Eigen::Dynamic now serves as a wildcard.
3. Added schur_templates.h/cc which allows querying the set of available
template specializations without instantiating a linear solver.
4. Added Solver::Summary::schur_structre_given and
Solver::Summary::schur_structure_used and expose them in
Solver::Summary::FullReport for better performance debugging.
5. Updated the templates with newer dates and some minor comments cleanup
which lead to the the template specializations to be re-generated.
Change-Id: Iaf3c6f714353597899916c300465da01f151c3de