Commit Graph

274 Commits

Author SHA1 Message Date
Sameer Agarwal a2fd9ca8be Fix Android.mk
Change-Id: I1093c2731283890d1f3792bf8e6741f448f1465d
2013-01-29 16:02:41 -08:00
Sameer Agarwal 977be7cac3 Add support for reporting linear solver and inner iteration
orderings.

Change-Id: I0588a4285e0925ce689e47bd48ddcc61ce596a1f
2013-01-26 16:02:33 -08:00
Sameer Agarwal 146b9acb4d Update include/ceres.h to export headers.
Update the ABI version.

Change-Id: I5c1c4f110cddc816bbb5a737634f55b4cbea98e1
2013-01-22 10:40:56 -08:00
Sameer Agarwal e837aeaf9e Documentation update.
Change-Id: Ica8681f4bb58c60349d0dae453c652f2522eebf6
2013-01-21 22:47:46 +00:00
Sameer Agarwal 2f0d7249cc NumericDiffFunctor.
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
2013-01-18 14:01:47 -08:00
Sameer Agarwal 2fc0ed6143 Change NumericDiffCostFunction to accept variadic functors.
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
2013-01-18 13:06:31 -08:00
Sameer Agarwal 9c5acce674 Add CostFunctionToFunctor.
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
2013-01-18 11:43:48 -08:00
Sameer Agarwal c89ea4b9de Minor corrections based on Jim Roseborough's comments
Change-Id: I4a8c7a454ddf038a3ed2567c101f9aee582044bf
2013-01-09 16:15:09 -08:00
Keir Mierle 00c8a06192 Fix bug in DenseSparseMatrix::ToDenseMatrix().
Change-Id: I74a1a03149d74fbc4268ec3ce9d20e09746a7227
2012-12-01 13:28:41 -08:00
Sameer Agarwal bcac4de5b7 Speedup corrector.cc
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
2012-11-30 23:11:26 -08:00
Sameer Agarwal 9883fc396b Refactoring of the LineSearchMinimizer.
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
2012-11-30 18:37:42 -08:00
Sameer Agarwal 2293cb5bc9 Add missing documentation to solver.h
Change-Id: I86e7c4f1f6cc1e15d5eb2cf23e73c32d94d458c1
2012-11-29 16:00:18 -08:00
Sameer Agarwal aed99615c0 Expose lbfgs rank in solver.h
Change-Id: Ibc184b1a2f94a4057fa6569d539ca3a55d6d6098
2012-11-29 15:54:34 -08:00
Sameer Agarwal 1afd498f50 String to and from enum conversion routines.
Update types.h/cc with stringication and unstringication
routines for the newly introduced enums.

Change-Id: I0fe2842b5b1c75ba351f4ab87ec9fa60af2f9ed2
2012-11-29 10:33:37 -08:00
Sameer Agarwal 3e8d192f28 Add a rough implementation of LBFGS.
Change-Id: I2bc816adfe0c02773a23035ea31de3cddc1322a4
2012-11-28 18:26:41 -08:00
Sameer Agarwal f4d0164607 Add a line search based minimizer.
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
2012-11-28 16:18:01 -08:00
Sameer Agarwal 0b5df70e33 Bug fix in solver_impl_test.
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
2012-11-28 15:53:07 -08:00
Sameer Agarwal 86f6ea68b8 Fix a variadic evaluation bug in AutoDiff.
Thanks to Julien Michot for reporting.

Change-Id: I322cd177e85c18ba3fbee56149696d4140f79c68
2012-11-28 15:13:21 -08:00
Sameer Agarwal 9895a4f50c Update comment in trust_region_minimizer.h.
Update comment to better reflect the Minimizer API.

Change-Id: Icca1d41fdea1f8dacde2e1af3239486820ef2b7f
2012-11-26 16:48:32 -08:00
Sameer Agarwal 1d11be9d38 Armijo line search.
An interface for line search and an initial implementation of
Armijo line search with and without interpolation.

Change-Id: I234da141be36172819a6df87ce5625aa8b58ed47
2012-11-26 12:14:22 -08:00
Sameer Agarwal 31432aeec4 Fix an initialization bug in ProgramEvaluator.
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
2012-11-25 18:36:04 -08:00
Sameer Agarwal e7295c246b Add polynomial interpolation and minimization.
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
2012-11-25 16:53:05 -08:00
Sameer Agarwal 8af9ebf38c Update changelog.
Change-Id: I055b304b691ebbafbd93368f23ed9e6d4b2288e5
1.4.0
2012-11-17 15:13:22 -08:00
Sameer Agarwal 747845fc82 Add the GradientChecker.
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
2012-11-08 10:40:18 -08:00
Sameer Agarwal bdabc29d90 Change LOG(ERROR) to LOG(WARNING) in schur_complement_solver.cc
Change-Id: Ie248989b230ec2357a00a15ef35087e85682315c
2012-11-07 11:26:32 -08:00
Sameer Agarwal d779b04eb4 Sort filenames in internal/CMakeList.txt
Change-Id: Id86f998ae0a1261e62d940e8e664102ff7526ec3
2012-11-02 11:05:42 -07:00
Sameer Agarwal c811d010c0 Documentation bug fixes.
Thanks Vladimir Chalupecky

Change-Id: I52a11d75adbf7adb1233c4d5ec2bc599448ab240
2012-11-01 10:22:11 -07:00
Sameer Agarwal 3dadfb78b7 static cast to force Eigen::Index to long conversion.
Change-Id: I11945c455eb3fef9bfb952f5a30d657542fbccae
2012-10-30 17:41:50 -07:00
Fisher 12626e8cba Add support for up to 10 parameters in Problem
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
2012-10-21 14:26:30 -04:00
Keir Mierle f1e67cc90b Add support for up to 10 parameters in autodiff.
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
2012-10-19 11:00:46 -07:00
Sameer Agarwal a45046a4e2 Remove verbose logging from DenseQRSolver
Change-Id: I37999657443697440afc6908ed3c05911419314d
2012-10-15 17:59:23 -07:00
Keir Mierle c804bb0a51 Add missing wall_time.cc to Android.mk.
Change-Id: I1aee667a4d4a968a10f60a87376f6a38c1809454
2012-10-15 14:10:43 -07:00
Keir Mierle 27dd0d3307 Fix the Ceres Android NDK build.
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
2012-10-15 13:54:10 -07:00
Keir Mierle f91263db61 Add missing logging.cc to Android.mk.
Change-Id: Ic1a81a859a21cfa3602e5544b7c53bee3873a3c8
2012-10-15 13:21:13 -07:00
Sameer Agarwal 583019b8df Drop spurious changelog update.
Change-Id: I496b497b05758b697aa9f287e79509acf72dd3bd
2012-10-12 14:01:16 -07:00
Sameer Agarwal f5a7d9a73c Changelog update.
Change-Id: Ic2f141c8fdb2c1092f363032956133a933036ff0
2012-10-12 12:31:11 -07:00
Sameer Agarwal 67a107b2f4 SolverImpl refactoring.
Improve the logic with which various corner cases like
constant program, failures to evaluate initial and final
cost etc are handled.

Change-Id: Id43d45ebe46b65918909d47201d6fb7b89ebbd57
2012-10-11 17:44:23 -07:00
Sameer Agarwal f3c1077c12 Remove collections_port.h from ordered_group.h
Change-Id: Ib81f475d909f9973c78f83961e477d046e24c30d
2012-10-08 11:17:31 -07:00
Sameer Agarwal 66fcc7d5da Fix a memory leak in trust_region_minimizer_test.cc
Change-Id: I46dff90485a8106c154cbd72493acda64971e94a
2012-10-08 09:54:16 -07:00
Sameer Agarwal 76e8bb532c Add a missing OpenMP ifdef to coordinate_descent_minimizer.cc
Change-Id: I4eb74ab0cba86eee65a0ccfa2373c8e108f53758
2012-10-08 09:12:52 -07:00
Sameer Agarwal 68b32a941c ordering -> linear_solver_ordering.
Change-Id: If4af72da90725db2a2d4f397f4cb671c2e863a98
2012-10-06 23:16:04 -07:00
Sameer Agarwal c1ffad6009 Schur ordering was operating on the original program.
Thanks to Ricardo Martin for reporting this.

Change-Id: Iacf44f672287e4d76633878c7051694a39b3056f
2012-10-05 16:58:32 -07:00
Sameer Agarwal e3c5570b05 Petter's MSVC fixes
Change-Id: I13a2f6e1046136ce240c22dadd1b7547f56d4493
2012-10-05 14:08:42 -07:00
Sameer Agarwal 5bfa7e4e8f Improve the performance of DenseQRSolver
1. Reduce amount of reallocations.

Change-Id: I91b17c781ae94ed12014d647f0162cfce4f6ed7b
2012-10-05 13:59:51 -07:00
Sameer Agarwal ba8d967f8c Generalization of the inner iterations algorithm.
Add automatic recursive independent set decomposition.
Clean up the naming and the API for inner iterations.

Change-Id: I3d7d6babb9756842d7367e14b7279d2df98fb724
2012-10-05 08:35:53 -07:00
Sameer Agarwal 2c94eed50f Move from Ordering to ParameterBlockOrdering.
Change-Id: I9320afff13ee62be407c725f42f41a18f537bcc1
2012-10-01 16:47:26 -07:00
Sameer Agarwal b6da9c794e OrderedGroups implementation.
This generalizes the Ordering object and paves the path for a more
general inner iteration API.

Change-Id: I6efce5f999c2bfab5f90a8a18e21140581f207cd
2012-10-01 15:23:28 -07:00
Sameer Agarwal b13e42da3e CMake version update
Change-Id: I17a497366e132af68e2b52f4c0e10974db8bfac7
2012-09-26 16:52:19 -07:00
Sameer Agarwal a693c8bfd5 Remove redundant broken test.
Change-Id: Ibf8dbd477842b1bc11d2294d8edad67140893602
2012-09-26 16:42:00 -07:00
Sameer Agarwal faf88a1b51 Documentation update.
Change-Id: Ic5f209da760562aa89a822f7e5853c5639a427eb
2012-09-26 16:33:21 -07:00