Commit Graph

1621 Commits

Author SHA1 Message Date
Nikolaus Demmel 82275d8a4e some fixes for Linux and macOS install docs
Linux:
- Remove workaround for Ubuntu 14.04, which is EOL. libsuitesparse-dev
  seems to come with a shared library on 16.04 and later, so linking
  to a shared build of ceres doesn't seem to be an issue any more.
- Add missing libgflags-dev.

macOS:
- OS X is now called macOS.
- Update homebrew link.
- Mac homebrew the preferred method of installation.
- Fix OpenMP instructions.
- Remove reference to homebrew/science. Everything is in core.
- Add missing gflags.

Change-Id: I633b3c7ea84a87886bfd823f8187fdd0a84737c9
2020-09-08 02:12:08 +00:00
Nikolaus Demmel 9d762d74f0 fix formatting for public header files
- ensure all public headers files adhere to clang-format
- preserve one-per-line for enums by adding trailing comma
- preserve include order for en/disable_warning.h

Change-Id: I78dbd0527a294ab2ec5f074fb426e48b20c393e6
2020-09-07 23:14:51 +02:00
Nikolaus Demmel c76478c489 gitignore *.pyc
Change-Id: Ic6238a617a3c7ce92df7dcefcc44bae20c32b30b
2020-09-07 00:17:50 +02:00
Alex Stewart 4e69a475cd Fix potential for mismatched release/debug TBB libraries
- Protect against the case when the user has multiple installs of TBB
  in their search paths and the first install does not contain debug
  libraries.  In this case it is possible to get mismatched versions
  of TBB inserted into TBB_LIBRARIES.
- Also suppresses warning about use of TBB_ROOT on modern versions of
  CMake due to CMP0074.

Change-Id: I2eaafdde4a028cbf6c500c63771973d85bc4723d
2020-09-03 19:55:58 +01:00
Sameer Agarwal 8e1d8e32ad A number of small changes.
1. Add a move constructor to NumericDiffCostFunction, DynamicAutoDiffCostfunction
   and DynamicNumericDiffCostFunction.
2. Add optional ownership of the underlying functor.
3. Update docs to reflect this as well as the variadic templates that allow an
   arbitrary number of parameter blocks.

Change-Id: I57bbb51fb9e75f36ec2a661b603beda270f30a19
2020-09-03 10:57:50 -07:00
Julian Kent 368a738e52 AutoDiffCostFunction: optional ownership
Add Ownership semantics to the AutoDiffCostFunction

This allows several benefits, such as pointer ordering always being the
same for numerical repeatability (due to blocks being ordered by
pointer address), memory adjacency for better cache performance, and
reduced allocator pressure / overhead.

This is then made use of in libmv by preallocating the errors and
cost functions into vectors

Change-Id: Ia5b97e7249b55a463264b6e26f7a02291927c9f2
2020-09-03 19:19:53 +02:00
Morten Hannemose 8cbd721c19 Add erf and erfc to jet.h, including tests in jet_test.cc
erf is necessary for evaluating Gaussian functions.
erfc was added because it is so similar to erf.

Change-Id: I5e470dbe013cc938fabb87cde3b0ebf26a90fff4
2020-09-03 17:54:20 +02:00
Sameer Agarwal 31366cff29 Benchmarks for dynamic autodiff.
This patch is from Clement Courbet. courbet@google.com

Change-Id: I886390663644733bfa5b7b52b0c883079e793726
2020-09-01 09:25:02 -07:00
Alex Stewart 29fb08aeae Use CMAKE_PREFIX_PATH to pass Homebrew install location
- Passing HINTS disables the MODULE mode of find_package() which
  precludes users from creating their own find modules to provide
  Ceres' dependencies.

Change-Id: I6f2edf429331d13fe67bf61ac4b79d17579d9a57
2020-09-01 10:23:31 +01:00
Sameer Agarwal 242c703b50 Minor fixes to the documentation
Change-Id: I65e6f648d963b8aa640078684ce02dcde6acb87d
2020-08-04 21:02:11 -07:00
Sameer Agarwal 79bbf95103 Add changelog for 2.0.0
Change-Id: I8acad62bfe629454ae5032732693e43fe37b97ff
2.0.0rc1
2020-08-04 18:26:02 -07:00
Sameer Agarwal 41d05f13d0 Fix lint errors in evaluation_callback_test.cc
Change-Id: I63eb069544ad0d8f495490fe4caa07b9f04f7ec2
2020-08-04 14:56:33 -07:00
Sameer Agarwal 4b67903c1f Remove unused variables from problem_test.cc
Change-Id: Ia1a13cfc6e462f6d249dcbf169ad34831dd93ec2
2020-08-04 14:40:50 -07:00
Sameer Agarwal 10449fc366 Add Apache license to the LICENSE file for FixedArray
FixedArray implementation comes from ABSL which is Apache
licensed.

Change-Id: I566dbe9d236814c95945732c6347d3bf7b508283
2020-08-04 14:30:25 -07:00
Sameer Agarwal 8c3ecec6db Fix some minor errors in IterationCallback docs
Change-Id: Id3d7f21a523ff8466868cdec542921c566bbbfa9
2020-08-04 14:21:23 -07:00
Alex Stewart 7d3ffcb423 Remove forced CONFIG from find_package(Eigen3)
- Ceres will fail to configure if Eigen3::Eigen target is not found, and
  the minimum required Eigen version specified (3.3) exports Eigen as
  a CMake package and this is reflected in the default Ubuntu 18.04
  packages.
- This permits users to specify their own Eigen3 detection should they
  choose to do so, but they must do so via an imported target.

Change-Id: I5edff117c8001770004f49012ac1ae63b66ec9c1
2020-08-04 21:16:25 +00:00
Alex Stewart a029fc0f93 Use latest FindTBB.cmake from VTK project
- Retrieved from [1], SHA: 0d9bbf9beb97f8f696c43a9edf1e52c082b3639b on
  2020-07-26
- [1]: https://gitlab.kitware.com/vtk/vtk/blob/master/CMake/FindTBB.cmake

Change-Id: I953a8c87802a974d30ccc7c80f5229683826efbd
2020-08-04 21:16:07 +00:00
Alex Stewart aa1abbc578 Replace use of GFLAGS_LIBRARIES with export gflags target
- As our minimum required version of gflags (2.2) exports itself as
  a CMake package and this is the case for the default 18.04 package
  we can use the gflags target directly.
- Replaces forced use of CONFIG in find_package(gflags) with a check
  that the gflags imported target exists to avoid ambiguity with
  libgflags if installed in a default location.  This permits users to
  override the gflags detection should they so choose, provided that
  they do so via an imported target.
- Also removes some previously removed legacy GLAGS_ vars from the
  installation docs.

Change-Id: I015f5a751e5b22f956bbf9df692e63a6825c9f0d
2020-08-04 21:15:51 +00:00
Sameer Agarwal db2af1be87 Add Problem::EvaluateResidualBlockAssumingParametersUnchanged
Simplify the semantics for Problem::EvaluateResidualBlock to
not ignore the presence of EvaluationCallback and add another method
EvaluateResidualBlockAssumingParametersUnchanged to handle the case
where the user has an EvaluationCallback but knows that the parameter
blocks do not change between calls.

Updated the documentation for the methods and EvaluationCallback to
reflect these semantics.

Also added tests for Evaluation related methods calling i
EvaluationCallback when its present.

https://github.com/ceres-solver/ceres-solver/issues/483

Change-Id: If0a0c95c2f1f92e9183a90df240104a69a71c46d
2020-08-04 13:59:42 -07:00
Sameer Agarwal ab4ed32cda Replace NULL with nullptr in the documentation.
Change-Id: I995f68770e2a4b6027c0a1d3edf5eb5132b081d7
2020-08-03 04:18:05 -07:00
Sameer Agarwal ee280e27a6 Allow SubsetParameterization to accept an empty vector of constant parameters.
Thanks to Frédéric Devernay for reporting this and providing an initial fix.

Change-Id: Id86a2051ab7841ecafdcfb00f4634b353a7ef3b4
2020-07-31 16:48:06 -07:00
Sameer Agarwal 4b8c731d8a Fix a bug in DynamicAutoDiffCostFunction
DynamicAutoDiffCostFunction::Evaluate when provided with a jacobians
array that was non-empty but all its entries are nullptr, would
compute num_active_parameters = 0, and then skip over all the loops
that evaluated the CostFunctor.

The fix is to check if num_active_parameters == 0, and then treat
it as the case where jacobians array is null.

Thanks to Ky Waegel for reporting and providing a reproduction for this.

Change-Id: Ib86930c2c3f722724d249f662bf88238679bbf98
2020-07-31 10:05:52 -07:00
Alex Stewart 5cb5b35a93 Fixed incorrect argument name in RotationMatrixToQuaternion()
- Raised as: https://github.com/ceres-solver/ceres-solver/pull/607 by
  Frank Dellaert

Change-Id: Id3e9f190e814cf18206e2f8c3b1b67b995c21dd5
2020-07-26 20:42:12 +01:00
Carl Dehlin e39d9ed1d6 Add a missing term and remove a superfluous word
Change-Id: I25f40f0bf241302b975e6fc14690aa863c0728b0
2020-06-16 09:02:05 +02:00
Carl Dehlin 27cab77b69 Reformulate some sentences
Change-Id: I4841aa8e8522008dd816261d9ad98e5fb8ad1758
2020-06-15 20:01:18 +02:00
Carl Dehlin 8ac6655ce8 Fix documentation formatting issues
Change-Id: Iea3a6e75dc3a7376eda866ab24e535a6df84f8ea
2020-06-15 19:10:12 +02:00
Alex Stewart 7ef83e0759 Update minimum required C++ version for Ceres to C++14
- 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: I706c8b367b3221e3c4d1a0aaf669a8f9c911e438
2020-05-30 19:15:03 +01:00
Sameer Agarwal 1d75e75681 Improve documentation for LocalParameterization
Change-Id: I63fa81206e67bfac56cc42bf2bb4915a3a11332b
2020-05-27 22:34:48 -07:00
Sameer Agarwal 763398ca4e Update the section on Preconditioners
Re-organize the section, add some more references and details for
existing preconditioners and add documentation for the SUBSET
precondition.

https://github.com/ceres-solver/ceres-solver/issues/490

Change-Id: I93d0af819c160f5e4ce48b18202f629ddb92ca7b
2020-05-28 05:25:41 +00:00
Sameer Agarwal a614f788a3 Call EvaluationCallback before evaluating the fixed cost.
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.

https://github.com/ceres-solver/ceres-solver/issues/482

Change-Id: I342b66f6f975fdee2eef139a31f24d4a3e568e84
2020-05-27 22:19:16 -07:00
Sameer Agarwal 70308f7bb9 Simplify documentation generation.
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: Ia3c2e732323a8b5cabafe851ac5ca0f0c82da071
2020-05-27 19:24:46 +00:00
Sameer Agarwal e886d7e653 Reduce the number of minimizer iterations in evaluation_callback_test.cc
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
2020-05-27 19:18:45 +00:00
Sameer Agarwal 9483e6f2f5 Simplify DynamicCompressedRowJacobianWriter::Write
Change-Id: I67aa2959bd479909b5cada79359c5cfdb8a37ef7
2020-05-25 13:07:04 -07:00
Sameer Agarwal 323cc55bb9 Update the version in package.xml to 2.0.0.
Change-Id: Ibac053916520e8c597c875a8c7f5668bb35b6ba1
2020-05-25 10:38:58 -07:00
Bayes Nie 303b078b50 Fix few typos and alter a NULL to nullptr.
Fix typos in docs/source/features.rst and examples/helloworld.cc. Alter a NULL to nullptr in include/ceres/autodiff_cost_function.h

Change-Id: Ibcf00b6ef665ad6be9af14b3add2dd4f3852e7e6
2020-05-25 17:22:40 +00:00
Alex Stewart cca93fed63 Bypass Ceres' FindGlog.cmake in CeresConfig.cmake if possible
- 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.

Change-Id: I85af8a953fd6d300e8bc0cdeb0b3636fec182f68
2020-05-25 17:20:12 +00:00
Alex Stewart 77fc1d0fc4 Use build_depend for private dependencies in Catkin package.xml
Change-Id: If0c0569e7ebbf37c0d8e8daaf7765e20a6282531
2020-05-25 17:18:25 +00:00
Alex Stewart a09682f00d Fix MSVC version check to support use of clang-cl front-end
- Raised as issue: #521

Change-Id: Iaea6b43484b90ec8789bda0447c8a90759974ec1
2020-05-25 17:17:42 +00:00
Alex Stewart b70687fcc8 Add namespace qualified Ceres::ceres CMake target
- 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.

Change-Id: Ie9ed8de9b7059bc0cae1ae5002bb94d8fe617188
2020-05-25 17:16:27 +00:00
Alex Stewart 99efa54bdb Replace type aliases deprecated/removed in C++17/C++20 from FixedArray
- 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: I0f13c72e93a35391fd2d18590b4243a329a2322c
2020-05-24 19:18:38 +01:00
Sameer Agarwal adb973e4a3 NULL -> nullptr
Change-Id: Iaeea2ef7912d328653a76b65976adc8025a5be35
2020-05-21 14:48:46 -07:00
Alastair Harrison 27b717951b Respect FIND_QUIETLY flag in cmake config file
Ensure that Ceres does not print any log messages when somebody has
used 'find_package(Ceres QUIET)' in their CMake project.

Change-Id: Id6b68859cc8a5857f3fa78f29736cb82fd5a0943
2020-05-15 10:10:12 +01:00
huangqinjin 646959ef11 Do not export class template LineParameterization
For MSVC, instantiating a dllimport class template will cause error C2491:
definition of dllimport function not allowed.

Change-Id: Icc7f7ea84598df0a5436f48ffc2bab5cfab93921
2020-05-07 11:22:20 +00:00
huangqinjin 1f128d070a Change the type of parameter index/offset to match their getter/setter
Change-Id: If28b795e792f39db9775ada105e9038570195329
2020-05-07 11:21:47 +00:00
huangqinjin 072c8f070e Initialize integer variables with integer instead of double
Change-Id: I652aca4ceb3129706a5d5e38afe9f16b61200a5b
2020-05-07 11:19:55 +00:00
Alex Stewart 8c36bcc81f Use inline & -inlinehint-threshold in auto-diff benchmarks
- 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: Id798dbca7d3050de0ea847a5ecc69484ac78a2cf
2020-04-27 18:47:22 +01:00
Sameer Agarwal 57cf20aa5d static const -> static constexpr where we can.
Change-Id: I8a6d26a89c4377dd440fa6dcf23513b7556533fc
2020-04-21 10:13:27 -07:00
Sameer Agarwal 40b27482a2 Add std::numeric_limit specialization for Jets
This allows users to use std::numeric_limits on templated functors.

Change-Id: I403cec5c9826033ce7dfd6047deb64f66c35f806
2020-04-21 09:35:30 -07:00
Darius Rueckert e751d6e4f0 Remove AutodiffCodegen
- Remove Codegen files
- Revert Jet and Rotation

Change-Id: I005c5f98f2b6dfa5c7fd88d998b6aa83e47dab60
2020-04-08 10:43:53 +02:00
Darius Rueckert e9eb76f8ef Remove AutodiffCodegen CMake integration
Change-Id: I403597540df8429378336626b8f748b7821fe6f5
2020-04-06 11:11:43 +02:00