Commit Graph

197 Commits

Author SHA1 Message Date
Sameer Agarwal ca0ff62ddb Fix to Roszman1's certified solution.
Extend nist.cc to test more nonlinear and linear solvers.

(Thanks to Markus Moll for finding the Roszman1 bug)

Change-Id: I92b4bab0771de85f7fe711fb0853f155991f4aaf
2012-09-01 14:41:44 -07:00
Markus Moll 43904888cd Fix typo in Misra1c NIST problem.
The exponent is -0.5, not 0.5.

Change-Id: I77c7bd2ed2b9b20e83d830f74c73088c1b3b3435
2012-08-31 22:54:29 +02:00
Sameer Agarwal 552f9f85bb Various minor bug fixes to the solver logic.
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
1.3.0
2012-08-31 12:24:28 -07:00
Sameer Agarwal 0b776b5cc9 Update docs.
Change-Id: I69d50bcd37aed3bea2190ca614f023e83172901b
2012-08-31 11:04:24 -07:00
Petter Strandmark 2d7176ad7c max_consecutive_nonmonotonic_steps should be int
Found via Visual Studio warning.

Change-Id: Id2cd7de562dfc8cd35df5d5f5220dd2d7350eb2c
2012-08-30 19:51:24 -07:00
Sameer Agarwal 1a89bcc94e Better reporting on the NIST problems.
Change-Id: I7cf774ec3242c0612dbe52fc233c3fc6cff3f031
2012-08-30 15:32:13 -07:00
Sameer Agarwal ea11704857 Basic harness for testing NIST problems.
Change-Id: I5baaa24dbf0506ceedf4a9be4ed17c84974d71a1
2012-08-30 13:48:40 -07:00
Sameer Agarwal 98bf14d2b9 Miscellaneous fixes.
Change-Id: I521e11f2d20bf24960bbc6b5dab4ec8bb1503d23
2012-08-30 10:26:44 -07:00
Petter Strandmark 1e3cbd9a44 Caching the symbolic Cholesky factorization when using CXSparse
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
2012-08-30 09:45:20 -07:00
Sameer Agarwal 8b64140878 Documentation update
Change-Id: I271a0422e7f6f42bcfd1dc6b5dc10c7a18f6a179
2012-08-29 05:41:22 -07:00
Petter Strandmark a5353acd85 Adding gflags include to test_util.cc
test_util seems to need gflags.

Change-Id: I0c4757960f8ac69ad599c138aea58e3c88a4ea28
2012-08-28 20:40:50 -07:00
Petter Strandmark 87ca1b2ba2 Changing random.h to use cstdlib for Windows compability.
As discussed with Sameer today.

Change-Id: If3d0284830c6591c71cc77b8400cafb45c0da61f
2012-08-28 18:05:20 -07:00
Petter Strandmark aeb00a0732 Removing gomp for Visual Studio
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
2012-08-27 22:22:57 -07:00
Markus Moll 6f362464ba Add some tests for DoglegStrategy.
Not necessarily a complete set.

Change-Id: I14eb3a38c6fe976c8212f3934655411b6d1e0aa4
2012-08-27 21:10:01 -07:00
Sameer Agarwal 122cf836a6 Documentation update.
Change-Id: I0a3c5ae4bc981a8f5bdd5a8905f923dc5f09a024
2012-08-27 14:29:21 -07:00
Keir Mierle 69081719f7 Remove unnecessary overload for hash<>
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
2012-08-27 13:32:53 -07:00
Sameer Agarwal 1762420b6e Update changelog.
Change-Id: Idf5af69d5a9dbe35f58e30a8afcbfcd29bb7ebfe
2012-08-24 10:24:02 -07:00
Keir Mierle 976ab7aca9 Remove Google-era vestigial unit test.
Change-Id: Ia7a295a5c759a17c1675a3055d287d3e40e9e0fe
2012-08-23 18:21:36 -07:00
Keir Mierle 6ad6257de0 Add a workaround for an Android NDK compiler bug.
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
2012-08-22 11:10:31 -07:00
Sameer Agarwal aecb2dc92b Fix relative path bug in bibtex call.
Change-Id: I0d31786564320a6831259bcdf4c75a6b665c43ad
2012-08-22 10:08:17 -07:00
Sameer Agarwal 1e2892009e Update Summary::FullReport to report dogleg type.
Change-Id: I0b4be8d7486c1c4b36b299693b3fe8b0d3426537
2012-08-22 08:50:17 -07:00
Sameer Agarwal 295ade1122 Fix Eigen3 Row/Column Major storage issue.
Eigen3 does not allow column vectors to be stored in row-major
format. NumericDiffCostFunction by default stores its Jacobian
matrices in row-major format. This works fine if the residual
contains more than one variable. But if the residual block
depends on one variable and has more than one residuals, the
resulting Jacobian matrix is a column matrix in row-major format
resulting in a compile time error.

The fix is to check the template parameters and switch to column-major
storage as needed.

Thanks to Lena Gieseke for reporting this.

Change-Id: Icc51c5b38e1f3609e0e1ecb3c4e4a02aecd72c3b
2012-08-22 08:20:06 -07:00
Arnaud Gelas 9ad27e8e9f Add one uninstall target to remove all installed files
Change-Id: Ifcf89a6c27b25f28403d95a50e29c093a525298f
2012-08-22 10:44:51 +02:00
Markus Moll 0c3a748ee4 Allow equal lower and upper bound for diagonal scaling.
This way, setting the lower and upper bound both to 1.0, one can disable
the automatic trust region scaling.

Change-Id: Ifa317a6911b813a89c1cf7fdfde25af603705319
2012-08-21 14:45:46 +02:00
Arnaud Gelas 3d644b76ad Install headers, libraries and pdf
Headers are installed in ${CMAKE_INSTALL_PREFIX}/include/ceres
Libraries are installed in ${CMAKE_INSTALL_PREFIX}/lib
pdf is installed in ${CMAKE_INSTALL_PREFIX}/share/ceres/docs

Change-Id: Ic175f2c2f5fa86820a1e8c64c2ed171f4a302a68
2012-08-21 09:40:59 +02:00
Arnaud Gelas d2fb5adea4 Configure gerrit hook at CMake time
If the source directory is a clone, at CMake time the commit-msg hook gets
downloaded and installed in the right location.

Change-Id: I5fee17d050ca22d8b92a49fdcc2a1cd6659f209b
2012-08-21 09:04:47 +02:00
Arnaud Gelas 73166098fc Add one CMake option to build the examples.
Currently the examples are always built. For external projects, it is useful
not to compile the examples.

Change-Id: I41d3bde19c7e742818e60f78222d39c43992ca8b
2012-08-21 08:41:13 +02:00
Keir Mierle 86d4f1ba41 Add missing return statement.
Change-Id: I5eaf718318e27040e3c97e32ee46cf0a11176a37
2012-08-20 11:52:04 -07:00
Keir Mierle 51eb229da3 Add Program::ToString() to aid debugging.
Change-Id: I0ab37ed2fe0947ca87a152919d4e7dc9b56dedc6
2012-08-20 11:46:12 -07:00
Keir Mierle bcc7100635 Ignore minted.sty.
Change-Id: I2467a6f801812b9007b51bf14b00757f026e4322
2012-08-20 11:45:04 -07:00
Keir Mierle 9705a736dd Add ParameterBlock::ToString() to aid debugging.
Change-Id: Id3f5cb27b855c536dd65a986f345bd8eb2799dfa
2012-08-20 11:25:26 -07:00
Sameer Agarwal 0c714a70e6 Fix blanks before private in loss_function.h
Change-Id: I068bed6431bc7c9b7958af391655df61499000b2
2012-08-20 11:18:16 -07:00
Markus Moll 51cf7cbe3b Add the two-dimensional subspace search to DoglegStrategy
Change-Id: I5163744c100cdf07dd93343d0734ffe0e80364f3
2012-08-20 11:16:41 -07:00
Sameer Agarwal ad1f7b772e Add ArcTanLoss, TolerantLoss and ComposedLossFunction.
Based on work by James Roseborough.

Change-Id: Idc4e0b099028f67702bfc7fe3e43dbd96b6f9256
2012-08-20 11:11:02 -07:00
Sameer Agarwal 05292bf8fc Add a TrustRegionStrategy::Summary object.
Change-Id: I7caee35a3408ee4a0ec16ba407410d822929340d
2012-08-20 08:48:09 -07:00
Arnaud Gelas b12b906c4d Add one option to generate the PDF from CMake at build time
Make sure pygmentize is installed

Change-Id: I068ba45c33a8e96acc906a464b12d10d58b3e231
2012-08-20 09:13:21 +02:00
Sameer Agarwal b9f15a5936 Add a dense Cholesky factorization based linear solver.
For problems with a small number of variables, but a large
number of residuals, it is sometimes beneficial to use the
Cholesky factorization on the normal equations, instead of
the dense QR factorization of the Jacobian, even though it
is numerically the better thing to do.

Change-Id: I3506b006195754018deec964e6e190b7e8c9ac8f
2012-08-19 14:47:38 -07:00
Arnaud Gelas b3fa009435 Set CMAKE_*_OUTPUT_DIRECTORY
Gather
 * all executables in ${CMAKE_BINARY_DIR}/bin
 * all libraries (static and dynamic) in ${CMAKE_BINARY_DIR}/lib

Change-Id: Ibc2fa1adfb6f0aea65d66d570259b79546bf3b07
2012-08-19 08:30:14 -07:00
Sameer Agarwal 1b8a4d5d11 Fix a minor bug in detect_structure logging.
Change-Id: I117f7745e4c67595b3ff9244cde82b5b5b34ee4b
2012-08-17 16:56:10 -07:00
Keir Mierle 31c1e784ab Minor cleanups.
Change-Id: Ida4866997deeaa1bc2cebd6b69313a05ac82e457
2012-08-17 16:16:32 -07:00
Sameer Agarwal e83f7879a8 Fix SuiteSparse3 UFConfig.h detection really.
Change-Id: Id187102e755b7d778dff4363f22f9a4697ed12dd
2012-08-17 15:37:39 -07:00
Sameer Agarwal 96f25dc576 Fix SuiteSparse3 UFConfig.h detection.
Change-Id: Ia59aefdb0ad7f713f76ed79692f2db4fa2821e5b
2012-08-17 15:34:42 -07:00
Markus Moll c497bd6cd9 Add UFconfig and/or SuiteSparse_config test to CMakeLists.txt
SuiteSparse 4 requires linking to libsuitesparseconfig.a.
Both SuiteSparse 3 and SuiteSparse 4 require an additional header
(either UFconfig.h or SuiteSparse_config.h) that is not found if it is
in a separate path. Therefore, add explicit checks.

Change-Id: I699902b5db4f1b7f17134b5a54f9aa681445e294
2012-08-17 15:15:01 -07:00
Sameer Agarwal 383c04f423 Fix QuaternionToAngleAxis to ensure rotations are between -pi and pi.
Thanks to Guoxuan Zhang for reporting this.

Change-Id: I2831ca3a04d5dc6467849c290461adbe23faaea3
2012-08-17 14:32:23 -07:00
Sameer Agarwal dd2b17d7dd CERES_DONT_HAVE_PROTOCOL_BUFFERS -> CERES_NO_PROTOCOL_BUFFERS.
Change-Id: I6c9f50e4c006faf4e75a8f417455db18357f3187
2012-08-17 13:21:33 -07:00
Sameer Agarwal 8b4cb7aa2c Fix sparse linear algebra library logging in Summary::FullReport.
Change-Id: Id2c902dc86c00954fde7749c7b4a67dd94215a31
2012-08-17 13:20:06 -07:00
Markus Moll 47d26bcd3b Do not implicitly negate the step in the TrustRegionMinimizer.
In the TrustRegionMinimizer, the step is currently implicitly negated.
This is done so that the linearized residual is |r - J*step|^2, which
corresponds to J*step = r, so neither J nor r have to be modified.
However, it leads to the rather unintuitive situation that the strategy
returns a step in positive gradient direction, which you would expect to
increase the function value. One way is to rename the "step" parameter in
the strategy to "negative_step" and document it.
This patch instead moves the negation inside the strategy, just around
the linear solver call, so that it is done in a local context and easier
to document.

Change-Id: Idb258149a01f61c64e22128ea221c5a30cd89c89
2012-08-17 13:19:14 -07:00
Markus Moll 51da590c84 Remove tmp file
Change-Id: I07496fafae7b0c5c12cc26ae336e0db3b5592735
2012-08-17 12:56:09 +02:00
Sameer Agarwal 7006a1f2b1 Correct example code in Powell's function example.
Thanks to Petter Strandmark for pointing this out.

Change-Id: I967632235dccdb481396e94904bb911c9a1efe1e
2012-08-16 18:04:22 -07:00
Keir Mierle 57a44b27bc Remove unnecessary flags in NDK build.
Change-Id: Ib5b4d0b7f2d898671252734978c789b8171d96a8
2012-08-16 17:04:50 -07:00