Commit Graph

312 Commits

Author SHA1 Message Date
Sameer Agarwal 931c309b27 Cleanup based on comments by William Rucklidge
Change-Id: If269ba8e388965a8ea32260fd6f17a133a19ab9b
2013-02-25 10:13:29 -08:00
Taylor Braun-Jones df36218c95 Add support for the CMake "LIB_SUFFIX" convention
Allows `make install` to work correctly on e.g. 64-bit systems where the
native libraries are installed to /usr/lib64

Change-Id: I71b4fae7b459c003cb5fac981278c668f2e29779
2013-02-25 18:07:19 +00:00
Taylor Braun-Jones 70701745b8 Add RPM .spec file
Tested on RHEL6.1 (with epel repository for dependencies).

make_release checks that that the version string in the .spec file is in
sync with the rest of the project and reminds the user to bump the
release string if necessary and to build/upload the RPM package.

Change-Id: I5f454f2a7301d1e0e120cb3c0e13a68d03bca917
2013-02-25 02:56:17 -05:00
Sameer Agarwal d2a5195b51 Version history update.
Change-Id: I477ec05a78ca4cd735a525253c9b6adfa3bddea7
2013-02-24 15:11:11 -08:00
Sameer Agarwal 2160c5b757 Minor release script fixes.
Change-Id: Ifd0a7f4f584c85d4d9574eca46094b372a8d7aff
2013-02-24 22:20:32 +00:00
Sergey Sharybin b53c9667f5 Solve No Previous Prototype GCC warning
In some cases there were missing includes of own
header files from implementation files.

In other cases moved function which are only used
within single file into an anonymous namespace.

Change-Id: I2c6b411bcfbc521e2a5f21265dc8e009a548b1c8
2013-02-25 01:44:50 +06:00
Sergey Sharybin 267ccc45a3 Fix for MinGW build on Windows
GG_LONGLONG and GG_ULONGLONG shall use LL and ULL suffixes,
since MinGW is actuall a GCC compiler.

Solved by checking whether compilation happens with MinGW
or not using standard MinGW's __MINGW32__ and __MINGW64__
definitions.

Change-Id: I789b34f6342a56ba42f4b280f7242700022ab7a1
2013-02-24 19:11:42 +00:00
Sameer Agarwal 509f68cfe3 Problem::Evaluate implementation.
1. Add Problem::Evaluate and tests.
2. Remove Solver::Summary::initial/final_*
3. Remove Solver::Options::return_* members.
4. Various cpplint cleanups.

Change-Id: I4266de53489896f72d9c6798c5efde6748d68a47
2013-02-24 19:04:21 +00:00
Keir Mierle d4a0bf86d6 Fix threading build on Windows.
On Windows, including the "windows.h" header defines an enormous number of
symbols; some of which are macros with common names. In particular, "ERROR" and
"min" and "max" get defined. This causes clashes when user code references
these names in a context other than the intended use in windows.h.

To deal with this, the Microsoft engineers added the ability to control the
definition of these symbols by adding extra defines. In particular, including
windows.h in the following way

  #define NOGDI
  #define NOMINMAX

will reduce the number of macros defined. This way they will not conflict with
other uses in Ceres. For example, numeric_limits<double>::max() is impossible
to call without defining NOMINMAX.

Change-Id: I166f5d3bb6dc0e2e4b2ebf800fb19e49206f7874
2013-02-24 10:40:03 -08:00
Sameer Agarwal beb4505311 Minor fixes
Based on William Rucklidge's review, including
a nasty bug in parameter block removal.

Change-Id: I3a692e589f600ff560ecae9fa85bb0b76063d403
2013-02-22 13:37:05 -08:00
Sameer Agarwal 9a88bd7c4b Minor bug fixes
Change-Id: I94e4521adf76a6c77db954c4a8955168e9d37b55
2013-02-19 13:09:12 -08:00
Sameer Agarwal 956ed7e8f2 Various minor fixes.
1. Unused variable warnings and fixes.
2. Minor documentation update.

Change-Id: I815588a5806df1030a7c8750f4fb594c503f8998
2013-02-19 09:13:50 -08:00
Keir Mierle 3e2c4ef9ad Add adapters for column/row-major matrices to rotation.h
This patch introduces a matrix wrapper (MatrixAdapter) that allows to
transparently pass pointers to row-major or column-major matrices
to the conversion functions.

Change-Id: I7f1683a8722088cffcc542f593ce7eb46fca109b
2013-02-19 08:40:09 +00:00
Keir Mierle 04938efe4b Add support for removing parameter and residual blocks.
This adds support for removing parameter and residual blocks.
There are two modes of operation: in the first, removals of
paremeter blocks are expensive, since each remove requires
scanning all residual blocks to find ones that depend on the
removed parameter. In the other, extra memory is sacrificed to
maintain a list of the residuals a parameter block depends on,
removing the need to scan. In both cases, removing residual blocks
is fast.

As a caveat, any removals destroys the ordering of the parameters,
so the residuals or jacobian returned from Solver::Solve() is
meaningless. There is some debate on the best way to handle this;
the details remain for a future change.

This also adds some overhead, even in the case that fast removals
are not requested:

- 1 int32 to each residual, to track its position in the program.
- 1 pointer to each parameter, to store the dependent residuals.

Change-Id: I71dcac8656679329a15ee7fc12c0df07030c12af
2013-02-18 15:00:30 -08:00
Sameer Agarwal fa21df8cd9 Add script for building documentation.
Update make_release

Minor documentation fixes.

Change-Id: I1248ec3f58be66b5929aee6f2aa392c15d53ed83
2013-02-18 09:22:08 -08:00
Sameer Agarwal 290b975d1d Preconditioner refactoring.
1. Added a Preconditioner interface.
2. SCHUR_JACOBI is now its own class and is independent of
SuiteSparse.

Change-Id: Id912ab19cf3736e61d1b90ddaf5bfba33e877ec4
2013-02-17 23:20:41 -08:00
Sameer Agarwal d010de5435 Solver::Summary::FullReport() supports line search now.
Change-Id: Ib08d300198b85d9732cfb5785af4235ca4bd5226
2013-02-16 01:32:44 +00:00
Sameer Agarwal fbbea464d1 Update documentation.
Change-Id: Idb03741fab9facbbbda85d5a82723f0b4c1c6c60
2013-02-15 14:29:51 -08:00
Sameer Agarwal 8e1f83c4c4 Speed up Problem construction and destruction.
Change-Id: I3147b0b60eedf40f8453d5a39ff04a572c445a2f
2013-02-15 09:13:14 -08:00
Sameer Agarwal efb47f39c3 Documentation update
Change-Id: I0fec43bff4fe0ea6cd2d2a8b34dac2330a517da0
2013-02-15 17:10:50 +00:00
Markus Moll be418a336c Fix evaluation of initial cost and corresponding test
Commit f102a68e41 seems to have introduced
a bug in both solver_impl.cc and solver_impl_test.cc
solver_impl_test showed 3 errors, where two were due to ceres NOT
failing when the test expected that, and one was due to the initial cost
being wrong (-1 instead of 0.5)
Ceres now does not attempt to evaluate the initial cost if
options.return_initial_xxx is not set. It therefore did not fail in
the tests.
It also seems that the CERES_EVALUATE macro erroneously always sets
final_cost, even when called with 'initial' as argument.

Change-Id: Ia3c3eeb476e7023a3f80b201124010d6c67e9824
2013-02-15 17:19:28 +01:00
Sameer Agarwal 974513a41f Bug fix in DynamicAutoDiffCostFunction
Add handling of constant parameter blocks.

Change-Id: I8b2ea79f47e190604fc4bed27705798240689f71
2013-02-12 14:59:04 -08:00
Keir Mierle 3130b3cea4 Add support for dynamic autodiff
Change-Id: I17d573696172ab691a9653db99a620e4bc1bd0d0
2013-02-11 22:47:10 -08:00
Sameer Agarwal c58e6dc3ea More refined event logging in solver_impl.cc
Change-Id: Ie3061c921c006d2600d16185c690f52ccf816f68
2013-02-11 18:23:27 -08:00
Sameer Agarwal f102a68e41 Remove extraneous initial and final evals.
Change-Id: I80ed87435f399cbf452c68be7ea1e7139696aa4a
2013-02-11 15:19:21 -08:00
Sameer Agarwal 0593747ee0 Fix a memory leak in cxsparse.cc
Thanks to Alexander Mordvintsev for reporting it.

Change-Id: Ia872be42ce80209e46722fc16a928496cf97e256
2013-02-11 14:03:26 -08:00
Sameer Agarwal 0abfb8f46f Delete the tex documentation.
Change-Id: I15c78a8b33c5fd94941238814ac023a8fb251a20
2013-02-11 13:40:04 -08:00
Sameer Agarwal 085cd4a664 Rewrite of the tutorial.
1. Quicker starting point.
2. Better discussion of derivatives.
3. Better hyperlinking to code and class documentation.
4. New robust estimation example.
5. Better naming of example code.
6. Removed dependency on gflags in all the core examples covered
   in the tutorial.

Change-Id: Ibf3c7fe946fa2b4d22f8916a9366df267d34ca26
2013-02-11 13:37:43 -08:00
Sameer Agarwal c0fdc97539 Update nist.cc to better evaluate results.
Ceres beats Minpack and HBN handily.

Change-Id: I7df8a47b753202ed0b53ab128ce48466bf9f8083
2013-02-07 00:44:53 -08:00
Sameer Agarwal d91b671798 More small changes
More small changes to the docs.

1. Better landing page.
2. Minor tweaks to the side bar.
3. Reference to more example code.
4. Local MathJax references.

Change-Id: I39b9436dc2803732a875bbbee7f15802c4934031
2013-02-06 01:28:58 -08:00
Sameer Agarwal 42a84b87fa Expand reporting of timing information.
1. Add an ExecutionSummary object to record execution
   information about Ceres objects.
2. Add an EventLogger object to log events in a function call.
3. Add a ScopedExecutionTimer object to log times in ExecutionSummary.
4. Instrument ProgramEvaluator and all the linear solvers
   to report their timing statistics.
5. Connect the timing statistics to Summary::FullReport.
6. Add high precision timer on unix systems using
   gettimeofday() call.
7. Various minor clean ups all around.

Change-Id: I5e09804b730b09535484124be7dbc1c58eccd1d4
2013-02-06 01:00:38 -08:00
Sameer Agarwal 08c891fcb6 Various small changes.
1. Compact build instructions.
2. Lots of small edits by Simon Fuhrmann.

Change-Id: I8c0c67922021041dcf7f4ecdb6c6e6dd2e2fd7e5
2013-02-05 23:35:01 -08:00
Sameer Agarwal e2e857ad6b Sidebar has global table of contents.
Change-Id: I7fe9053868a4660b0db8d7607ee618fc30ddaefd
2013-02-04 19:40:45 -08:00
Sameer Agarwal b9182147d9 Change the theme to be closer to ReadTheDocs.org
Change-Id: I61a76f5b5e5c292b54fdf51b66940ce80bd1cd5f
2013-02-04 17:55:25 -08:00
Sameer Agarwal 3d87b72c89 Convert documentation from LaTeX to Sphinx.
A live version of the doc can be found at

http://homes.cs.washington.edu/~sagarwal/ceres-solver/

As it stands, the documentation has better hyperlinking
and coverage than the latex documentation now.

Change-Id: I7ede3aa83b9b9ef25104caf331e5727b4f5beae5
2013-02-04 17:09:39 -08:00
Sameer Agarwal 71c8058478 Remove ExecutionSummary from Evaluator and LinearSolver
Change-Id: If4dbaf516a8b14e0a79e1a2116ce66a99ed4a592
2013-01-31 17:33:01 -08:00
Sameer Agarwal fa1c31eee3 Correct the documentation for crs_matrix.h
Thanks to Joydeep Biswas for reporting this.

Change-Id: Iae5fc2274644aab40f2f922a671f65da15ae71fc
2013-01-30 08:50:41 -08:00
Sameer Agarwal bdd87c03ed Add an ExecutionSummary object that the Evaluator and LinearSolver can use to
report execution statistics of all kinds.

Currently a single map which maps arbitrary strings to doubles is supported,
which allows for precise timing information to be communicated.

Change-Id: Ibd930aca5c9e6cae89bcfeffe9b13e2887644881
2013-01-29 16:24:31 -08:00
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