Commit Graph

733 Commits

Author SHA1 Message Date
Sameer Agarwal 4fce29c29e Documentation update.
Update the documentation to reflect the new trust region solver
logging style.

Change-Id: Id2d6b9efeee86c690c349a225d344e9f97ddbcdf
2014-06-06 05:02:07 +00:00
Greg Coombe 252917655b Add two missing files to Android.mk
Change-Id: Ic69a9550874de9540fbb351b882d87541e7c2542
2014-06-05 17:05:36 -07:00
Sameer Agarwal bb5baea725 Improve NDK version detection.
The script assert_ndk_version.sh used to require that the user
either define ANDROID_NDK_ROOT or ndk-build be in the path
so that ANDROID_NDK_ROOT can be inferred.

But since we are always calling this script from within an
Android.mk file, ndk-build already defines a variable called
NDK_ROOT, which we can pass to the script, thereby simplifying it
and making it more robust.

Change-Id: I31d66529a36a93e760e0dd0f17cfe61428fbac55
2014-06-05 12:18:23 -07:00
Sameer Agarwal d54e98777f Add a note about git commit message style.
Update contributing.rst to point to Tim Pope's suggestions
for how to write git commit messages.

Change-Id: Idcbece3e7576f54794d8a107aa2c5aa48dc4ddf7
2014-06-05 19:10:19 +00:00
Sameer Agarwal 14ec849eac Change logging for TRUST_REGION.
The current logging for trust region minimizer is very informative
but cryptic. Single or double letter abbreviations must be deciphered
to make sense of it.

Here is an alternate take on it.

Before:

   0: f: 4.185660e+06 d: 0.00e+00 g: 2.16e+07 h: 0.00e+00 rho: 0.00e+00 mu: 1.00e+04 li:  0 it: 7.36e-02 tt: 3.47e-01
   1: f: 1.980525e+05 d: 3.99e+06 g: 5.34e+06 h: 2.40e+03 rho: 9.60e-01 mu: 3.00e+04 li:  1 it: 1.80e-01 tt: 5.27e-01
   2: f: 5.086543e+04 d: 1.47e+05 g: 2.11e+06 h: 1.01e+03 rho: 8.22e-01 mu: 4.09e+04 li:  1 it: 1.57e-01 tt: 6.84e-01
   3: f: 1.859667e+04 d: 3.23e+04 g: 2.87e+05 h: 2.64e+02 rho: 9.85e-01 mu: 1.23e+05 li:  1 it: 1.50e-01 tt: 8.34e-01
   4: f: 1.803857e+04 d: 5.58e+02 g: 2.69e+04 h: 8.66e+01 rho: 9.93e-01 mu: 3.69e+05 li:  1 it: 1.47e-01 tt: 9.82e-01
   5: f: 1.803391e+04 d: 4.66e+00 g: 3.11e+02 h: 1.02e+01 rho: 1.00e+00 mu: 1.11e+06 li:  1 it: 1.51e-01 tt: 1.13e+00

After:

iter      cost      cost_change  |gradient|   |step|    tr_ratio  tr_radius  ls_iter  iter_time  total_time
   0  4.185660e+06    0.00e+00    2.16e+07   0.00e+00   0.00e+00  1.00e+04       0    7.16e-02    3.27e-01
   1  1.980525e+05    3.99e+06    5.34e+06   2.40e+03   9.60e-01  3.00e+04       1    1.77e-01    5.04e-01
   2  5.086543e+04    1.47e+05    2.11e+06   1.01e+03   8.22e-01  4.09e+04       1    1.49e-01    6.54e-01
   3  1.859667e+04    3.23e+04    2.87e+05   2.64e+02   9.85e-01  1.23e+05       1    1.45e-01    7.99e-01
   4  1.803857e+04    5.58e+02    2.69e+04   8.66e+01   9.93e-01  3.69e+05       1    1.46e-01    9.45e-01
   5  1.803391e+04    4.66e+00    3.11e+02   1.02e+01   1.00e+00  1.11e+06       1    1.48e-01    1.09e+00

Change-Id: I251f99d474028e07cb709965d513809c443884b6
2014-06-05 19:09:29 +00:00
Greg Coombe 2a5599f378 Fix Cmake error when using miniglog.
Create the glog include directories and library directories
only if we've already checked that the user is using
glog (and not miniglog).

Otherwise, @GLOG_INCLUDE_DIR@ and @GLOG_LIBRARY@ will be
empty and the generated files will cause Cmake errors.

Change-Id: Ia0ce9cf98f7d56c83b2285f72f45b8e0d5dc34c4
2014-06-04 23:21:33 +00:00
Björn Piltz add50e3697 Don't build miniglog unconditionally as a static library
This is only needed on Windows because of lacking dllexport's.

Change-Id: I7ee4b3fd640d5870af2a73d7bfa6ccc8356b2fa0
2014-06-04 10:23:41 +02:00
Björn Piltz 4c5f6cd032 Added missing include.
MSVC complained about not finding std::min(),

Change-Id: If0a1eb77fa2988cabf26da4a49bf018e34a38b9c
2014-06-04 10:17:04 +02:00
Sameer Agarwal c8063df917 POLAK_RIBIRERE -> POLAK_RIBIERE
Thanks to Vladimir Chalupecky for reporting this.

Change-Id: I2e419415394f5d2be35b825d7c777b01ff31add1
2014-06-03 20:30:15 -07:00
Alex Stewart 52bad6223b Adding assert_ndk_version for Android from Jørgen Tjernø.
- Ceres now requires Android NDK version >= r9d to compile, Jørgen's
  script allows a clean way to verify this condition is met before
  trying to compile for Android.
- Note that this is a modified version of the original script, which
  adds support for versions >= 10, and fixes extraction of the version
  number now that the architecture is also included.

Change-Id: Icd7ffd25407bcf29af007e30b5da5d18eb799adf
2014-06-03 23:25:56 +01:00
Sameer Agarwal 70af9a58f1 Improve logging in Solver::Options::IsValid.
The error message now includes the value of the offending option.

Change-Id: Ic2493709f54f7efe59313d51d1ff9638191c8b38
2014-06-03 16:06:23 +00:00
Sameer Agarwal 79df23ed78 Remove NDK/Eigen bug work around.
The bug was multiple compilers ago. Now is as good a point as
any to remove the work around.

Change-Id: I1f14732d042fe061adcb31b14a6b39d8fc0ca69e
2014-06-02 21:33:40 -07:00
Sameer Agarwal 5d51e4d4bc Addressing comments from Jim Roseborough.
Change-Id: I9f5bdb4a81cd25ee4ea5de65aeddcaa0c5d18197
2014-06-02 08:12:11 -07:00
Sameer Agarwal b4a5f7ea25 Program::RemoveFixedBlocks -> Program::CreateReducedProgram.
CreateReducedProgram is a safer API, reduces the possibility of
memory leaks and produces valid programs.

Change-Id: I094d53d207fced970a4d9ea0b66cdb09ce5f0657
2014-06-01 16:38:08 -07:00
Sameer Agarwal 29fe072781 Solver::Options::min_relative_decrease can be zero.
Change-Id: I82ae5227ad0f8f6ff21e859e11f0d18ac7d9828c
2014-06-01 00:25:34 -07:00
Sameer Agarwal 226a95e488 Fix more typos in solver.cc
A number of typos in solver.cc which were hidden behind ifdefs
and were only revealed when building under android.

Change-Id: I89cbe8056da071479d2d1a251a8919b0be1f1cd4
2014-06-01 06:55:18 +00:00
Sameer Agarwal 7135be7b34 Conditionally disable SparseNormalCholesky.
Disable creation of SparseNormalCholesky if CXSparse and
SuiteSparse are not evailable.

Change-Id: I9a3beafef0073d1c55305beb0af31bc67ef39691
2014-05-31 23:44:18 -07:00
Sameer Agarwal be43201953 Update Android.mk
Add callbacks.cc and summary_utils.cc.

Change-Id: Ia356b0c82138ca4c2235015986deff0e30b37304
2014-05-31 23:30:32 -07:00
Sameer Agarwal e911db19aa Fix a memory leak in program_test.cc
Program::RemoveFixedBocks will happily drop all fixed parameter
and residual blocks. So if it is called on the one and only copy
of a program, like it was being called in the tests, this will
result in a memory leak because we would have lost track of the
fixed parameter and residual blocks.

This is not a problem in actual usage since CreateReducedProgram
will first create a copy of the program and then remove the fixed
blocks from it. But in the tests, we were creating a ProblemImpl
and then calling RemovedFixedBlocks on the underlying program
object causing a memory leak.

The fix to make a copy in the tests and then work on that. I
have also added a warning in program.h

Change-Id: I03a5f7a7f5453aec848451a5c0ace4b065f71e9b
2014-05-31 23:21:44 -07:00
Sameer Agarwal 19dee8d591 Fix a typo in solver.cc
Change-Id: I3f2e058e2d45c72eaa12129ff0b9366332ee87f5
2014-05-31 23:04:44 -07:00
Sameer Agarwal 99dead5cbf Move inner iteration ordering related methods.
Inner iterations require specific constraints on parameter
block orderings. The creation and validation routines for
these orderings are not static methods in CoordinateDescentMinimizer.

Change-Id: Ifc89491c9a8672e08523191b74b53058cbfa1db3
2014-05-30 16:16:27 -07:00
Sameer Agarwal 1228a4f332 Move alternate linear solver and preconditioner policy.
Move functions that determine alternatives to Schur type linear
solver and preconditioners into the LinearSolver and Preconditioner
interfaces.

Change-Id: Iae900afb7db17cdbeb7753497005a48c3144e2d7
2014-05-30 15:58:44 -07:00
Sameer Agarwal 1693645a67 Add Solver::Options::IsValid.
This provides a user visible way to validate the Solver::Options
before calling Solve.

Change-Id: Ife84fd33532ab2ccb7ac95abe22735843db51fde
2014-05-30 13:00:18 -07:00
Sameer Agarwal 3b73313e2a Use Program::RemoveFixedBlocks.
And get rid of the code and tests related to
SolverImpl::RemovedFixedBlocksFromProgram.

Change-Id: Iccf6501dfe93db737f5a2265bbab0021712be92f
2014-05-30 11:32:08 -07:00
Alex Stewart 1c4b48afae Fixing missing Sphinx formatting for parameter bound methods.
Change-Id: I0364cd284355d6284e0836a120417c5f0c7a78fe
2014-05-30 16:42:43 +01:00
Sameer Agarwal a2df262441 SummarizeOrdering -> OrderingToGroupSizes
Change-Id: I6f852811c6d3812865b1da5cb94272cdf3fa4a38
2014-05-29 22:51:12 -07:00
Sameer Agarwal 3a783ac408 Move Summary related functions into their own file.
Change-Id: Ie063de83e5b5e2b6d93322dd901d23b53e3d4b6a
2014-05-29 22:41:44 -07:00
Keir Mierle 80a85ca53f Replace broken CERES_VERSION macro
This replaces the broken CERES_VERSION and CERES_ABI_VERSION
defines with a different set, including integer versions for
MAJOR/MINOR/etc.

This also adds the Ceres version to Solver::FullReport().

Example report from powell:

Ceres Solver v1.10.0 Solve Report
----------------------------------
                                     Original                  Reduced
Parameter blocks                            4                        4
Parameters                                  4                        4
Residual blocks                             4                        4
Residual                                    4                        4

Minimizer                        TRUST_REGION

Dense linear algebra library            EIGEN
Trust region strategy     LEVENBERG_MARQUARDT

                                        Given                     Used
Linear solver                        DENSE_QR                 DENSE_QR
Threads                                     1                        1
Linear solver threads                       1                        1

Cost:
Initial                          1.075000e+02
Final                            1.791438e-14
Change                           1.075000e+02

Minimizer iterations                       14
Successful steps                           14
Unsuccessful steps                          0

Time (in seconds):
Preprocessor                            0.001

  Residual evaluation                   0.000
  Jacobian evaluation                   0.000
  Linear solver                         0.000
Minimizer                               0.001

Postprocessor                           0.000
Total                                   0.003

Change-Id: I5bf0e8023693e9195276b1f1e881b13121ba1196
Termination:                      CONVERGENCE (Gradient tolerance reached. Gradient max norm: 3.642190e-11 <= 1.000000e-10)
2014-05-30 05:18:36 +00:00
Sameer Agarwal 87a40da145 Refactor Program related functions.
Move

ParameterBlocksAreFinite
IsBoundsConstrained
IsFeasible
RemoveFixedBlocks
IsParameterBlockSetIndependent
CreateJacobianBlockSparsity

from being static methods in SolverImpl to member functions
in the Program class.

Change-Id: I80fa4a429a716ea4371ad6c67864adad438e1553
2014-05-29 21:21:49 -07:00
Sameer Agarwal f5e81b61e7 Move IterationCallbacks into their own file.
1. Merge TrustRegionLoggingCallback and LineSearchLoggingCallback
   into a single callback.
2. Move the callbacks into callback.h
3. Update SolverImpl to use the new callbacks.

Change-Id: I9e82173cf2b828d023d96c57d1cba17f4832aeae
2014-05-29 15:03:10 -07:00
Sameer Agarwal b766177bab Remove support for Solver::Options::solver_log.
This is not really used and if needed can be implemented
in user code.

Change-Id: I56328d51c9d3788f90c751ff9c3a5937989f6ee0
2014-05-29 21:59:37 +00:00
Sameer Agarwal 558ee40ee1 Add SuiteSparse::IsConstrainedApproximateMinimumDegreeOrderingAvailable.
This allows checking for the availability of CAMD without depending
on a preprocessor symbol, which can be the source of subtle bugs
if the file defining that symbol was not included.

Change-Id: I6f1ef91a20baeecf68e8dd467ebe707dde8c5f79
2014-05-29 21:58:40 +00:00
Sameer Agarwal ec3a3ceafc Flesh out OrderedGroups.
1. Add the ability to bulk remove elements.
2. Add accessor for elements_to_group.
3. Early exit in Remove if there are no elements.

Change-Id: I3df1f00de05338a42e9907423b674469a022d3bc
2014-05-29 14:55:26 -07:00
Sameer Agarwal 041f27516a Move CompactifyArray to array_utils.
1. Rename it to MapValuesToContiguousRange.
2. Improve implementation to just use a vector.

Change-Id: I2a5e73e3a6fb81694c6f452a00d60df16c0149e6
2014-05-29 14:52:17 -07:00
Sameer Agarwal 9a022f601b Fix a typo in index.rst
Thanks to Pierre Moulon for pointing this out.

Change-Id: I1e0021b613e57e9f0c13db4634662ee3e1e22aa9
2014-05-27 23:58:02 -07:00
Sameer Agarwal 451e71c6b7 Prepare for version 1.9.0
1. Update ceres-solver.spec with version bump
   and a new package description.
2. Update the docs to refer to 1.9.0
3. Update version history.
4. Change build requirements for Android to be r9d.

Change-Id: Ibab27976b214a11549cb2688b91f791a6388b0b5
1.9.0
2014-05-27 11:39:07 -07:00
Alex Stewart 9febb5f2ef Updating docs to include Windows options for SuiteSparse.
- A number of users are now successfully using the
  suitesparse-metis-for-windows project to build Ceres with SuiteSparse
  on Windows.
- Also fixing missing requirement for sphinx_rdm_theme if building
  the Ceres docs.

Change-Id: I1a36c13166f96743557de2ac3b7c9b84531d1f24
2014-05-27 13:26:10 +00:00
Keir Mierle d0f194a454 Tweak iOS build instructions
Change-Id: I05a8e46f6db0eb5914f88a04dca90dec4441b5c1
2014-05-27 06:32:41 +00:00
Alex Stewart 1bc7b38ac1 Support user passing a custom CMAKE_MODULE_PATH (for BLAS / LAPACK).
- Previously we set CMAKE_MODULE_PATH explicitly rather than appending
  to it when adding our local cmake directory.
- This meant the user could not easily pass their own directory which
  would also be used.  This would be useful if they had their own
  custom FindBLAS / FindLAPACK scripts that they wanted to overload
  the defaults shipped with CMake.

Change-Id: I0c1fda1b6fd81eab68755aa036f64af3efbb226d
2014-05-26 19:54:03 +01:00
Keir Mierle 6a9367711f Tweak build dependencies in the documentation
Change-Id: Ice4cc42bbcf00dafb66785fc96a048618a0b834f
2014-05-23 01:53:18 +00:00
Keir Mierle 4425473ef5 Fix formatting in building docs
Change-Id: I75aa4f12733462d592775b4df766c05c50f20b60
2014-05-23 01:00:22 +00:00
Keir Mierle 38787f44f4 Strip breadcrumb from the documentation frontpage
Change-Id: I14a50de47e304a61b2b6bf3a9cf7cc168286ab40
2014-05-23 00:37:22 +00:00
Keir Mierle 556027a1a0 Strip breadcrumbs from the documentation
Change-Id: I2a1469844e5a20eecdd735f38d68e571fce3f3fa
2014-05-22 23:35:46 +00:00
Björn Piltz c0b883816f Disabled warning C4251 Added the files disable_warnings.h and reenable_warnings.h which need to be included by every file that uses the macro CERES_EXPORT.
Change-Id: I176326a600d094a4524bac873564fcbf8efd2456
2014-05-19 22:53:41 +02:00
Sameer Agarwal 8c62487e43 Preparations for 1.9.0 release.
Version bump.
minor docs update.

Change-Id: I2fbe20ba4af6b2e186fe244c96ce6d6464fe0469
1.9.0rc1
2014-05-16 09:48:41 -07:00
Sameer Agarwal 0831275a78 Documentation update.
1. Update iOS build instructions.
2. Update version history.

Change-Id: I49d62e86ecff39190b50c050cb12eef4e2773357
2014-05-16 08:32:23 -07:00
Jack Feng c7c7458625 add support for building for ios
use ios-cmake to build for ios

Change-Id: I6b17c33339f3121322a4004d79629b22a62f7a94
2014-05-16 13:04:57 +00:00
Sergey Sharybin 36c2ce87d1 Libmv 2D homography estimation example application
Add an example application of homography matrix estimation
from a 2D euclidean correspondences which is done in two
steps:

- Coarse algebraic estimation
- Fine refinement using Ceres minimizer

Nothing terribly exciting apart from an example of how to
use user callbacks.

User callback is used here to stop minimizer when average
of symmetric geometric distance becomes good enough.
This might be arguable whether it's the best way to go
(in some cases you would want to stop minimizer when
maximal symmetric distance is lower than a threshold) but
for a callback usage example it's good enough to stick
to current logic.

Change-Id: I60c8559cb10b001a0eb64ab71920c08bd68455b8
2014-05-15 15:17:14 +02:00
Björn Piltz d99a3a961e Separate PUBLIC and PRIVATE library dependencies
Do not propagate 3d party libs through
IMPORTED_LINK_INTERFACE_LIBRARIES_[DEBUG/RELEASE] mechanism
when building shared libraries. SuiteSparse, lapack & co
are considered private. Glog still gets propagated since
it is part of the public interface. See documentation of
TARGET_LINK_LIBRARIES().

Change-Id: If0563b0c705b102876f5190e9a86694d10f79283
2014-05-14 12:46:46 +02:00
Sameer Agarwal 1c089e8453 Notational fix in modeling.rst by William Rucklidge.
Change-Id: Iffa127541380fcc32da13fe4ac474692e1e3d0ec
2014-05-13 16:58:25 -07:00