Commit Graph

225 Commits

Author SHA1 Message Date
Sameer Agarwal e6ffe26671 Update the version history.
Change-Id: I9a57b0541d6cebcb695ecb364a1d4ca04ea4e06c
2016-10-10 22:47:08 -07:00
Sameer Agarwal a36693f83d Update version history
Change-Id: Ib2f0138ed7a1879ca3b2173e54092f7ae8dd5c9d
2016-09-17 16:31:41 -07:00
Sameer Agarwal 79a28d1e49 Rename a confusingly named member of Solver::Options
Solver::Options::numeric_derivative_relative_step_size to
Solver::Options::gradient_check_numeric_derivative_relative_step_size

Change-Id: Ib89ae3f87e588d4aba2a75361770d2cec26f07aa
2016-08-31 07:47:29 -07:00
Sameer Agarwal 358ae741c8 Note that Problem::Evaluate cannot be called from an IterationCallback
Change-Id: Ieabdc2d40715e6b547ab22156ba32e9c8444b7ed
2016-08-31 07:42:00 -07:00
Mike Vitus f6df6c05dd Add an example for modeling and solving a 3D pose graph SLAM problem.
Change-Id: I750ca5f20c495edfee5f60ffedccc5bd8ba2bb37
2016-08-22 15:26:02 -07:00
David Gossow ac3b8e8217 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.

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
2016-08-18 06:18:43 +00:00
Mike Vitus d4264ec10d Add a quaternion local parameterization for Eigen's quaternion element convention.
Change-Id: I7046e8b24805313c5fb6a767de581d0054fcdb83
2016-08-17 18:28:54 -07:00
Mike Vitus fd7cab65ef Fix typos in the pose graph 2D example.
Change-Id: Ie024ff6b6cab9f2e8011d21121a91931bd987bd1
2016-08-10 09:37:47 -07:00
Mike Vitus 375dc34874 Remove duplicate entry for the NIST example in the docs.
Change-Id: Ic4e8f9b68b77b5235b5c96fe588cc56866dab759
2016-08-05 21:50:48 +00:00
Mike Vitus f554681bf2 Add an example for modeling and solving a 2D pose graph SLAM problem.
Change-Id: Ia89b12af7afa33e7b1b9a68d69cf2a0b53416737
2016-08-05 14:22:27 -07:00
Sameer Agarwal 080ca4c5f2 Fix typos in users.rst
Change-Id: Ifdc67638a39403354bc9589f42a1b42cb9984dd2
2016-04-24 22:46:54 -07:00
Sameer Agarwal ee40f954cf Add colmap to users.rst
Change-Id: I452a8c1dc6a3bc55734b2fc3a4002ff7939ba863
2016-04-24 07:56:12 -07:00
Alex Stewart 9843f32803 Report Ceres compile options as components in find_package().
- 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.

Change-Id: I65f1ddfd7697e6dd25bb4ac7e54f5097d3ca6266
2016-04-10 17:27:26 +00:00
Timer e4d4d88bbe Fix a spelling error in nnls_modeling.rst
Change-Id: I341d901d3df993bc5397ed15e6cb330b0c38fd72
2016-04-08 15:50:52 +08:00
Alex Stewart 77d94b3474 Fix install path for CeresConfig.cmake to be architecture-aware.
- 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.

Change-Id: If126260d7af685779487c01220ae178ac31f7aea
2016-03-16 21:20:31 +00:00
Alex Stewart eaa58c5d6e Fix CXX11 option to be available on MinGW & CygWin, but not MSVC.
- Previously we were disabling the CXX11 option when WIN32 was defined,
  which it can be on both MinGW & CygWin, even though the compilers
  there can support the -std=c++11 option.
- Now we disable the CXX11 option only when the compiler used is MSVC.

Change-Id: I68ebcf0a4241afe93892a3c6f79cdd98887e785a
2016-02-07 13:50:48 +00:00
Niels Ole Salscheider 1f20b72afd Allow users to override the documentation install directory.
This is needed for multiarch layouts where the prefix is /usr/${host}
but where arch-independent files are installed to /usr/share.

Change-Id: Icec01f8ea927594b4edb26997d6384e478415999
2016-01-10 20:39:12 +01:00
Sameer Agarwal 52c1bc92c6 Fix a malformed sentence in the tutorial.
Thanks to abrock for pointing this out.

Change-Id: I3fe943dc415dc389396e13dbdd5aec09ee9b76cc
2016-01-03 22:42:04 -08:00
Sameer Agarwal 992ae55e84 Report the number of line search steps in FullReport.
Accumulate the number of steps of the line search algorithm
and report it as part of Summary::FullReport.

Change-Id: I1de12784009a3e08f2a2c2aff5085d57a3c73828
2015-12-01 14:26:13 -08:00
Sameer Agarwal ba67ed1e01 A variety of small updates
1. Add answers to a number of FAQs.
2. Add a note to the documentation for NumericDiffCostFunction that
   NumericDiffOptions needs to be documented and mentioned.
3. Update the docs for Solver::Options::numeric_derivative_relative_step_size
   to indicate that this setting only applies to the gradient checker.
4. Remove deprecated constructors from NumericDiffCostFunction and
   DynamicNumericDiffCostFunction.

Change-Id: If8fc011b2a5996dbc2c51268aa477550ed014a1c
2015-11-08 10:59:42 -08:00
Alex Stewart 41455566ac Remove link-time optimisation (LTO).
- On GCC 4.9+ although GCC supports LTO, it requires use of the
  non-default gcc-ar & gcc-ranlib.  Whilst we can ensure Ceres is
  compiled with these, doing so with GCC 4.9 causes multiple definition
  linker errors of static ints inside Eigen when compiling the tests
  and examples when they are not also built with LTO.
- On OS X (Xcode 6 & 7) after the latest update to gtest, if LTO
  is used when compiling the tests (& examples), two tests fail
  due to typeinfo::operator== (things are fine if only Ceres itself is
  compiled with LTO).
- This patch disables LTO for all compilers. It should be revisited when
  the performance is more stable across our supported compilers.

Change-Id: I17b52957faefbdeff0aa40846dc9b342db1b02e3
2015-10-05 18:54:11 +01:00
Alex Stewart 89c40005bf Only use LTO when compiling Ceres itself, not tests or examples.
- If Ceres is built as a shared library, and LTO is enabled for Ceres
  and the tests, then type_info::operator==() incorrectly returns false
  in gtests' CheckedDowncastToActualType() in the following tests:
-- levenberg_marquardt_strategy_test.
-- gradient_checking_cost_function_test.
  on at least Xcode 6 & 7 as reported here:
  https://github.com/google/googletest/issues/595.
- This does not appear to be a gtest issue, but is perhaps an LLVM bug
  or an RTTI shared library issue.  Either way, disabling the use of
  LTO when compiling the test application resolves the issue.
- Allow LTO to be enabled for GCC, if it is supported.
- Add CMake function to allow easy appending to target properties s/t
  Ceres library-specific compile flags can be iteratively constructed.

Change-Id: I923e6aae4f7cefa098cf32b2f8fc19389e7918c9
2015-09-28 15:08:39 +01:00
Sameer Agarwal 0794f41cca Documentation updates.
1. Fix a typo in the Trust Region algorithm.
2. Add ARL in the list of users.
3. Update the version history.

Change-Id: Ic286e8ef1a71af07f3890b7592dd3aed9c5f87ce
2015-09-26 14:14:20 -07:00
Alex Stewart c4c7947211 Clean up iOS.cmake to use xcrun/xcodebuild & libtool.
- Substantial cleanup of iOS.cmake to use xcrun & xcodebuild to
  determine the SDK & tool paths.
- Use libtool -static to link libraries instead of ar + ranlib, which
  is not compatible with Xcode 7+, this change should be backwards
  compatible to at least Xcode 6.
- Force locations of unordered_map & shared_ptr on iOS to work around
  check_cxx_source_compiles() running in a forked CMake instance without
  access to the variables (IOS_PLATFORM) defined by the user.
- Minor CMake style updates.

Change-Id: I5f83a60607db34d461ebe85f9dce861f53d98277
2015-09-20 20:12:04 +01:00
Alex Stewart 0c4647b8f1 Remove FAQ about increasing inlining threshold for Clang.
- Changing the inlining threshold for Clang as described has a minimal
  effect on user performance.
- The problem that originally prompted the belief that it did was
  due to an erroneous CXX flag configuration (in user code).

Change-Id: I03017241c0f87b8dcefb8c984ec3b192afd97fc2
2015-09-16 20:01:11 +01:00
Alex Stewart 1936d47e21 Revert increased inline threshold (iff Clang) to exported Ceres target.
- Increasing the inline threshold results in very variable performance
  improvements, and could potentially confuse users if they are trying
  to set the inline threshold themselves.
- As such, we no longer export our inline threshold configuration for
  Clang, but instead document how to change it in the FAQs.

Change-Id: I88e2e0001e4586ba2718535845ed1e4b1a5b72bc
2015-09-08 23:27:42 +01:00
Sameer Agarwal a66d89dcda Get ready for 1.11.0RC1
Update version numbers.
Drop CERES_VERSION_ABI macro.

Change-Id: Ib3eadabb318afe206bb196a5221b195d26cbeaa0
2015-09-08 14:55:28 -07:00
Sameer Agarwal 1ac3dd223c Fix a bug in CompressedRowSparseMatrix::AppendRows
The test for CompressedRowSparseMatrix::AppendRows tries to add
a matrix of size zero, which results in an invalid pointer deferencing
even though that pointer is never written to.

Change-Id: I97dba37082bd5dad242ae1af0447a9178cd92027
2015-09-05 15:56:14 -07:00
Sameer Agarwal 5742b7d0f1 Improve performance of SPARSE_NORMAL_CHOLESKY + dynamic_sparsity
The outer product computation logic in SparseNormalCholeskySolver
does not work well with dynamic sparsity. The overhead of computing
the sparsity pattern of the normal equations is only amortized if
the sparsity is constant. If the sparsity can change from call to call
SparseNormalCholeskySolver will actually be more expensive.

For Eigen and for CXSparse we now explicitly compute the normal
equations using their respective matrix-matrix product routines and solve.
Change-Id: Ifbd8ed78987cdf71640e66ed69500442526a23d4
2015-09-05 14:31:52 -07:00
Alex Stewart 0e8264cc47 Add increased inline threshold (iff Clang) to exported Ceres target.
- When compiled with Clang, Ceres and all of the examples are compiled
  with an increased inlining-threshold, as the default value can result
  in poor Eigen performance.
- Previously, client code using Ceres would typically not use an
  increased inlining-threshold (unless the user has specifically added
  it themselves).  However, increasing the inlining threshold can result
  in significant performance improvements in auto-diffed CostFunctions.
- This patch adds the inlining-threshold flags to the interface flags
  for the Ceres CMake target s/t any client code using Ceres (via
  CMake), and compiled with Clang, will now be compiled with the same
  increased inlining threshold as used by Ceres itself.

Change-Id: I31e8f1abfda140d22e85bb48aa57f028a68a415e
2015-09-02 19:37:01 +01:00
Alex Stewart a1b3fce9e0 Add optional export of Ceres build directory to new features list.
Change-Id: I6f1e42b41957ae9cc98fd9dcd1969ef64c4cd96f
2015-08-31 14:14:56 +01:00
Alex Stewart e46777d8df Credit reporters of buildsystem bugs in version history.
Change-Id: I16fe7973534cd556d97215e84268ae0b8ec4e11a
2015-08-31 12:41:54 +01:00
Sameer Agarwal 01548282cb Update the version history.
Change-Id: I29873bed31675e0108f1a44f53f7bc68976b7f98
2015-08-30 22:34:04 -07:00
Tal Ben-Nun 4f049db7c2 Adaptive numeric differentiation using Ridders' method.
This method numerically computes function derivatives in different
scales, extrapolating between intermediate results to conserve function
evaluations. Adaptive differentiation is essential to produce accurate
results for functions with noisy derivatives.

Full changelist:
-Created a new type of NumericDiffMethod (RIDDERS).
-Implemented EvaluateRiddersJacobianColumn in NumericDiff.
-Created unit tests with f(x) = x^2 + [random noise] and
 f(x) = exp(x).

Change-Id: I2d6e924d7ff686650272f29a8c981351e6f72091
2015-08-30 14:06:13 +03:00
Alex Stewart cc8d47aabb Update all CMake to lowercase function name style.
- Updated to new CMake style where function names are all lowercase,
  this will be backwards compatible as CMake function names are
  case insensitive.
- Updated using Emacs' M-x unscreamify-cmake-buffer.

Change-Id: If7219816f560270e59212813aeb021353a64a0e2
2015-08-09 15:18:42 +01:00
Alex Stewart 1f106904c1 Update minimum iOS version to 7.0 for shared_ptr/unordered_map.
- In order to correctly detect shared_ptr (& unordered_map)
  the iOS version must be >= 7.0 (Xcode 5.0+).  This only affects the
  SIMULATOR(64) platform builds, as the OS (device) build uses the
  latest SDK which is now likely 8.0+.

Change-Id: Iefec8f03408b8cdc7a495f442ebba081f800adb0
2015-08-09 14:55:02 +01:00
Alex Stewart 56be8de007 Add docs for new CXX11 option & mask option for Windows.
- The CXX11 option has no effect on Windows, as there, any new C++11
  features are enabled by default, as such to avoid confusion we only
  present the option for non-Windows.

Change-Id: I38925ae3bb8c16682d404468ba95c611a519b9b9
2015-08-07 20:15:34 +01:00
Sameer Agarwal 560940fa27 A refactor of the cubic interpolation code
1. Push the boundary handling logic into the underlying array
object. This has two very significant impacts:

a. The interpolation code becomes extremely simple to write
and to test.

b. The user has more flexibility in implementing how out of bounds
values are handled. We provide one default implementation.

Change-Id: Ic2f6cf9257ce7110c62e492688e5a6c8be1e7df2
2015-08-06 14:49:55 -07:00
Sameer Agarwal dfdf19e111 Lint cleanup from Jim Roseborough
Change-Id: Id6845c85644d40e635ed196ca74fc51a387aade4
2015-08-05 15:20:57 -07:00
Alex Stewart 5a48b92123 Export Ceres build directory into local CMake package registry.
- Optionally use CMake's export() functionality to export the Ceres
  build directory as a package into the local CMake package registry.
- This enables the detection & use of Ceres from CMake *without*
  requiring that Ceres be installed.

Change-Id: Ib5a7588446f490e1b405878475b6b1dd13accd1f
2015-08-03 16:46:05 +00:00
Sameer Agarwal d9790e7789 Add ProductParameterization
Often a parameter block is the Cartesian product of a number of
manifolds. For example, a rigid transformation SE(3) = SO(3) x R^3
In such cases, where you have the local parameterization
of the individual manifolds available,
ProductParameterization can be used to construct a local
parameterization of the cartesian product.

Change-Id: I4b5bcbd2407a38739c7725b129789db5c3d65a20
2015-07-27 13:37:10 -07:00
Alex Stewart bae78c88c7 Fix links to SuiteSparse & CXSparse.
- Thanks to Henrique Mendonça for reporting this.

Change-Id: I590f6138177b2e608eca9726f556d2f92d00d4d7
2015-06-28 14:02:10 +01:00
Alex Stewart b7e9a5762b Ensure Eigen is at least 3.1.0 for Eigen/SparseCore.
- Eigen/SparseCore is required by covariance_impl, this was added in
  v 3.1.0 of Eigen, and thus without at least this version Ceres will
  not compile.
- Note that Ubuntu 12.04 provides only version 3.0.5 in the mainline
  repository.
- Update docs to match CMake check for Eigen >= 3.2.2 to avoid warning
  about reduced sparse performance.

Change-Id: I291bb185d1c76e1e1422429169a76e3f1b828163
2015-06-27 16:03:41 +00:00
David Gossow 2a1dfd2b71 Add DynamicCostFunctionToFunctor.
This adds a new wrapper class called DynamicCostFunctionToFunctor
that closes a gap in the current API: the existing
CostFunctionToFunctor can only be used with a SizedCostFunction, where
the number and sizes of all parameter vectors are known at compile-time.
The DynamicCostFunctionToFunctor allows you to wrap a generic
CostFunction into a templated functor which can then be used in a
DynamicAutoDiffCostFunction.

Also updates the existing CostFunctionToFunctor class to internally use
DynamicCostFunctionToFunctor.

Change-Id: I088adc3271c58d2519126c27037c3576965a36d6
2015-06-18 16:01:15 -07:00
Chris Sweeney 967122def6 Add Theia to users.
Change-Id: Ic112d31e2b8d7ecd28816fdc76e27adb1da27ac5
2015-05-13 12:11:14 -07:00
Alex Stewart 4707eb22e9 Remove use of :caption tag in Sphinx.
Change-Id: I1fb5f2504424506e1bba244bcb8efb25329564d1
2015-05-06 20:56:08 +01:00
Sameer Agarwal 5c0954438f Lint changes from William Rucklidge.
Change-Id: I6592b61451ead8f0407bec134fcf4b56ba22ffb9
2015-05-05 11:25:42 -07:00
Johannes Schönberger 239dd59ea5 Homogenize convergence operators in docs and code
Change-Id: Iec7c12e971b331d1847f9aa91349317eb6524856
2015-04-16 16:01:18 -04:00
Alex Stewart 08f3861b43 Fix CMake config file docs to include 2.8.x & 3.x styles.
- Include example use of new find_dependency() macro in CMake 3.x to
  find dependencies in <Project>Config.cmake files.
- Also fix typo in NNLS modeling docs.

Change-Id: Ie9862b69c0451ee8775826f2957f5e182d937439
2015-04-11 14:53:52 +01:00
Alex Stewart d95f9192dd Add documentation on CMake package installation process.
- A lot of users find the CMake package installation process confusing,
  particularly the use of imported targets when exporting their own
  projects which use Ceres.
- This patch adds a brief description of the overall process and the
  main bear-trap users are ensnared by.

Change-Id: I44c022bbd18a393868bf88ea9ddd807c5e08abc9
2015-04-06 16:22:32 +00:00