The GradientChecker is a utility class written by
William Rucklidge that can be used to check that the
derivatives returned by a cost function match those
returned by numerically differentiating the residuals
returned by the same cost function.
This is useful when developing CostFunction objects
and testing them before plugging them into an optimization
problem.
Change-Id: Ic60f859b48b6246406448555d25556784e097b81
Following the last commit, which extends the number of parameters blocks autodiff can accept, the interface of Problem::AddResidualBlock is extended to accept up to 10 parameter blocks.
Change-Id: I162c3d1b1868fdda32c1522d57e9a211a9c02f90
Supporting only 6 parameters in autodiff was enough for most
cases, but 6 was not always sufficient. This extends the
current implementation to work with up to 10 parameters.
This also increases the number of parameters supported in
SizedCostFunction to 10.
Change-Id: Ic783602f93e6ddf4af24fa34eff37c0a4b775dc1
The NDK build of Ceres was broken; this fixes it and also
disables a useless warning that shows up in NDK 8b.
Change-Id: I54cfb3de7ccea4a0864385f7ffdb55d8f3431f34
Improve the logic with which various corner cases like
constant program, failures to evaluate initial and final
cost etc are handled.
Change-Id: Id43d45ebe46b65918909d47201d6fb7b89ebbd57
Add automatic recursive independent set decomposition.
Clean up the naming and the API for inner iterations.
Change-Id: I3d7d6babb9756842d7367e14b7279d2df98fb724
A non-linear generalization of Ruhe & Wedin's algorithm
for separable non-linear least squares problem. It is implemented
as coordinate descent on an independent subset of the parameter
blocks at the end of every successful Newton step. The resulting
algorithm has much improved convergence at the cost of some
execution time.
Change-Id: I8fdc5edbd0ba1e702c9658b98041b2c2ae705402
The warnings got disabled at some point; this re-enables some of them, and
fixes some of the warnings.
Change-Id: I290a4fdfad18cea85e9177ba57744d97b6856bb2
Remove the old ordering API, and modify solver_impl.cc
to use the new API everywhere.
In the process also clean up the linear solver instantion
logic in solver_impl.cc a bit too.
Change-Id: Ia66898abc7f622070b184b21fce8cc6140c4cebf
More flexible testing.
Read and parse the certified cost value from the data file.
Remove the ugly hack for computing the certified cost.
Refactored the flags parsing logic
Change-Id: I8f2e6be183b758b2453302fcdc6696bfa0db5eb8
If the norm of a column in the jacobian is near zero.
The jacobian scaling could in trying to avoid division
by zero actually make things much worse. It made it
appear that the column actually had mass when in fact
it did not.
This leads to inflated values for the parameters for
that column when we get some numerical garbage back
from the linear solver.
This should also address the case where users are setting
some columns to zero to hold some parameter constant.
The fix is a bit delicate, and frankly I am not
completely sure that it fixes the issue. But right now
I am quite certain that the current implementation is
better than what we had earlier. Whether this is the
best fix is not entirely certain.
To test the fix, I converted Arnaud Gelas' original
code which triggered this bug into a test case.
Change-Id: Idbbd8177269bdc06338e0f54410f93ddc127c8ca
1. CostFunction returning false is handled better.
If only the cost is being evaluated, it is possible to
use the false value as an infinite value signal/outside
a region of validity. This allows a weak form of constraint
handling. Useful for example in handling infinities.
2. Changed the way how the slop around zero when model_cost
is larger than the current cost. Relative instead of absolute
tolerances are used. The same logic is propagated how the
corresponding clamping of the model_cost is done.
3. Fixed a minor indexing bug in nist.cc.
4. Some minor logging fixes to nist.cc to make it more
compatible with the rest of ceres.
Together these changes, take the successful solve count from
41/54 to 46/54 and eliminate all NUMERICAL_FAILURE problems.
Change-Id: If94170ea4731af5b243805c0200963dd31aa94a7
Average factorization times for bundle adjustment test problem:
SuiteSparse: 0.2794 s.
CXSparse: 0.4039 s.
CXSparse cached: 0.2399 s.
CXSparse will still be slower, though, because it has to compute
the transpose and J^T * J.
Change-Id: If9cdaa3dd520bee84b56e5fd4953b56a93db6bde
Linking currently fails in Visual Studio due to a missing library
"gomp.lib". This is not needed in Visual Studio. OpenMP works
without it.
Change-Id: I39e204a8dd4f1b7425df7d4b222d86a8bb961432
The overload for pointers in hash tables was applied in normal
usage of schur_ordering.cc. However, the tests did not include the
overload since they only included collections_port.h. As a result,
the routines in schur_ordering.cc were using a different hash
function than that inside the tests.
The fix is to remove the specialization. If this breaks one of the
compiler configurations, we will find a workaround at that time.
Change-Id: Idbf60415d5e2aec0c865b514ad0c577d21b91405
On certain NDK build configurations, one of the innermost
parts of the Schur eliminator would get compiled
incorrectly. The compiler changed a -= to a +=.
The normal Ceres unit tests caught the problem; however,
since it is not possible to build the tests with the NDK
(only with the standalone toolchain) this was difficult to
track down. Finding the issue involved pasting the schur
eliminator unit test inside of solver_impl.cc and other such
hacks.
Change-Id: Ie91bb545d74fe39f0c8cbd1a6eb69ee4d8b25fb2