A wrapper class that takes a variadic functor evaluating a
function, numerically differentiates it and makes it available as a
templated functor so that it can be easily used as part of Ceres'
automatic differentiation framework.
The tests for NumericDiffCostFunction and NumericDiffFunctor have
a lot of stuff that is common, so refactor them to reduce code.
Change-Id: I83b01e58b05e575fb2530d15cbd611928298646a
The interface for NumericDiffCostFunction and AutoDiffCostFunction
are not comparable. They both accept variadic functors.
The change is backward compatible, as it still supports numeric
differentiation of CostFunction objects.
Some refactoring of documentation and code in auto_diff_cost_function
and its relatives was also done to make things consistent.
Change-Id: Ib5f230a1d4a85738eb187803b9c1cd7166bb3b92
CostFunctionToFunctor wraps a CostFunction, and makes it available
as a templated functor that can be called from other templated
functors. This is useful for when one wants to mix automatic,
numeric and analytic differentiated functions.
Also a bug fix in autodiff.h
Change-Id: If8ba281a89fda976ef2ce10a5844a74c4ac7b84a
Add a specialization for the common case where the residual block
outputs exactly one residual.
The matrix routines used by Corrector can be then specialized to
a scalar and be made considerably faster.
For denoising upto 400% speedup is observed.
Change-Id: I8e3f24b8ba41caa8e62ad97c5f5e96ab6ea47150
1. New LineSearchDirection interface, factory and instances.
2. Cleanup of LineSearchMinimizer to use the State and Direction objects.
3. LBFGS -> LowRankInverseHessian.
4. Refactoring of the RunCallbacks function and share it across
LineSearchMinimizer and TrustRegionMinimizer.
Change-Id: I19354afc6f5d6567b28918710c2012dc30ef8f32
1. Add a line search based minimization loop.
2. Currently this loop supports steepest descent and three
kinds of non-linear conjugate gradient algorithms.
3. Update SolverImpl to talk to LineSearchMinimizer.
4. Update IterationCallback to carry information about
line search.
5. Update LineSearch to take the initial point as input,
saving on one function evaluation.
6. Updates to the external API.
Change-Id: I901a0e89fc948451ab34c743e70f3dec57c9405e
One of the tests CreateLinearSolverNoSuiteSparse, fails
when no sparse backend is present. This was a failure
in running tests with all possible sparse backend settings.
Thanks to Sebastian Fabbro for reporting this.
Change-Id: I0ab98632ae7dd33f18d67cb9f490e74c034ce03d
An interface for line search and an initial implementation of
Armijo line search with and without interpolation.
Change-Id: I234da141be36172819a6df87ce5625aa8b58ed47
The buffers used to store the per thread value of the gradient
were not set to zero at the beginning of each call to evaluate.
Change-Id: I9c8afea54a4e2e0b805164025da3023166a309af
1. polynomial_solver* -> polynomial*.
2. Added support for differentiating polynomials.
2. Added support for interpolating polynomials from function
values and gradients.
3. Added support for minimizing polynomials by solving
for the roots of their derivatives in an interval.
4. Added support for finding the minimum of a polynomial
that interpolates function values and gradients in
an interval.
Change-Id: Id7e6764ad4db09c3edd60f1378c7f50f20dd08dc
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