This commit fixes a bug related to the computation of covariance blocks
in the tangent space for constant parameter blocks, causing out of
bounds memory access.
Change-Id: Iaeee7992405fcaaae6086612798e96f2e10ebc5c
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
- Gives an option to specify a lower deployment target version than the
current SDK for backward compatibility.
Change-Id: Ieb84ba7f42cdf925510f84b8e0cd01b5e9fc051b
- 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
- 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
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
- The newer style, which are more specific and match the SDK names
are not available on Xcode < 7.0.
Change-Id: I2f07a0365183d2781157cdb05fd49b30ae001ac5
- 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
- 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
1. Move common test infrastructure into test_util.
2. system_test now only contains powells function.
3. Add bundle_adjustment_test.
Instead of a single function which computes everything,
there is now a test for each solver configuration which
uses the reference solution computed by the fixture.
Change-Id: I16a9a9a83a845a7aaf28762bcecf1a8ff5aee805
- 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
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
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
- 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
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
- Previously, when Ceres was built as a static library we did not
compile position independent code. This means that the resulting
static library could not be linked against shared libraries, but
could be used by executables.
- To enable the use of a static Ceres library by other shared libraries
as reported in [1], the static library must be generated from
position independent code (except on Windows, where PIC does not
apply).
[1] https://github.com/Itseez/opencv_contrib/pull/290#issuecomment-130389471
Change-Id: I99388f1784ece688f91b162d009578c5c97ddaf6
The logic for determing static/dynamic f-block size in
DetectStructure was broken in a corner case, where the very first
row block which was used to initialize the f_block_size contained
more than one f blocks of varying sizes. The way the if block
was structured, no iteration was performed on the remaining
f-blocks and the loop failed to detect that the f-block size
was actually changing.
If in the remaining row blocks, there were no row blocks
with varying f-block sizes, the function will erroneously
return a static f-block size.
Thanks to Johannes Schonberger for providing a reproduction for this
rather tricky corner case.
Change-Id: Ib442a041d8b7efd29f9653be6a11a69d0eccd1ec
The schur eliminator treats rows with e blocks and row with
no e blocks separately. The template specialization logic only
applies to the rows with e blocks.
So, in cases where the rows with e-blocks have a fixed size f-block
but the rows without e-blocks have f-blocks of varying sizes,
DetectStructure will return a static f-block size, but we need to be
careful that we do not blindly use that static f-block size everywhere.
This patch fixes a bug where such care was not being taken, where
it was assumed that the static f-block size could be assumed for all
f-block sizes.
A new test is added, which triggers an exception in debug mode. In
release mode this error does not present itself, due to a peculiarity
of the way Eigen works.
Thanks to Werner Trobin for reporting this bug.
Change-Id: I8ae7aabf8eed8c3f9cf74b6c74d632ba44f82581
When the user provides an ordering which starts at a non-zero group id,
or has gaps in the groups, then CAMD, the algorithm used to reorder
the program can crash or return garbage results.
The solution is to map the ordering into grouping constraints, and then
to re-number the groups to be contiguous using a call to
MapValuesToContiguousRange. This was already done for CAMD based
ordering for Schur type solvers, but was not done for SPARSE_NORMAL_CHOLESKY.
Thanks to Bernhard Zeisl for not only reporting the bug but also
providing a reproduction.
Change-Id: I5cfae222d701dfdb8e1bda7f0b4670a30417aa89
- Shorten description for EIGENSPARSE to a single line, as otherwise
it is not correctly displayed in the ncurses CMake GUI.
- Made explicit in description that this results in an LGPL licensed
version of Ceres (this is also made clear in the CMake log output if
EIGENSPARSE is enabled).
Change-Id: I11678a9cbc7a817133c22128da01055a3cb8a26d
The previous implementation incorrectly cached the outer product matrix
pattern even when `dynamic_sparsity = true`.
Change-Id: I1e58315a9b44f2f457d07c56b203ab2668bfb8a2
- Before the new CMake buildsystem in 1.8, Ceres used non-standard
HINTS variables for dependencies. For backwards compatibility CMake
macros were added to translate these legacy variables into the new
(standard) variables.
- As it has now been multiple releases since the legacy variables
were used and they no longer appear in any of the documentation
support for them has now expired.
Change-Id: I2cc72927ed711142ba7943df334ee008181f86a2
- If a CMake-ified version of gflags is not detected, then
gflags_LIBRARIES is not set and the TARGET condition within a
multiconditional if() statement prevents configuration.
Change-Id: Ia92e97523d7a1478ab36539726b9540d7cfee5d0
- 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
- 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
- gflags <= 2.1.2 has a bug in its exported gflags-config.cmake:
https://github.com/gflags/gflags/issues/110 whereby it sets
gflags_LIBRARIES to a non-existent 'gflags' target.
- This causes linker errors if gflags is installed in a non-standard
location (as otherwise CMake resolves gflags to -lgflags which
links if gflags is installed somewhere on the current path).
- We now check for this case, and search for the correct gflags imported
target and update gflags_LIBRARIES to reference it if found, otherwise
proceed on to the original manual search to try to find gflags.
Change-Id: Iceccc3ee53c7c2010e41cc45255f966e7b13d526
- 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
Now that ceres is part of RawHide, there is no need to carry
this spec file with the ceres distribution.
Change-Id: Icc400b9874ba05ba05b353e2658f1de94c72299e
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
The reason this rather serious looking typo has not
caused any problems uptil now is because NUM_ROW_B is
computed but never actually used.
Thanks to Werner Trobin for pointing this out.
Change-Id: Id2b4d9326ec21baec8a85423e3270aefbafb611e