Commit Graph

223 Commits

Author SHA1 Message Date
Sameer Agarwal b23fd4e667 Add IterationSummary::step_is_nonmonotonic.
So that IterationCallback objects know the kind of step that they
are dealing with.

Change-Id: I7782b211af882bd7b67307c3c23d8021cb56e8ab
2012-09-25 10:14:08 -07:00
Sameer Agarwal d3ace02d13 Fix a bunch of compiler warnings.
Change-Id: Iacc3beff295d4f4f6334ef598b10c73de509b3c0
2012-09-23 18:19:49 -07:00
Ricardo Martin f9a7ce831e Correct snavely reprojection error in code and doc.
The snavely reprojection error is wrong both in the sample code and
in the documentation. It should not multiply by the focal length
before calculating the distortion.

Change-Id: I292af962e634506a7cc57af9ce72b08f81ce3425
2012-09-21 12:14:44 -07:00
Sameer Agarwal 1dc544adb0 Remove ParameterBlock::state_offset as it is not used.
Change-Id: I3d6fbe333dde73ceb4c6c5e01460aa997883889f
2012-09-19 12:11:55 -07:00
Petter Strandmark dd1a276561 Fix of compilation errors in solver_impl.cc
They appear is SuiteSparse is disabled.

Change-Id: I2c2e9dac49afe81ddb810b546135621b325c2c97
2012-09-19 13:01:02 +02:00
Keir Mierle 97ca0fbbea Compile with warnings on Unix.
The warnings got disabled at some point; this re-enables some of them, and
fixes some of the warnings.

Change-Id: I290a4fdfad18cea85e9177ba57744d97b6856bb2
2012-09-18 17:07:18 -07:00
Sameer Agarwal c014997cdb Replace EXPECT/ASSERT_DEATH with EXPECT_DEATH_IF_SUPPORTED.
This allows us to remove all the WIN32/MSVC ifdefs in the
various tests.

http://code.google.com/p/ceres-solver/issues/detail?id=55

Change-Id: Ida053e44ea84b6915758318403f3db05325f1226
2012-09-18 13:55:18 -07:00
Keir Mierle 44714e3c31 Add an example Makefile for using Ceres.
Using Ceres in your application involves linking several dependent
libraries, depending on how you compiled Ceres. The example makes
it easier for users to leverage Ceres in their applications.

Change-Id: I6331fd9c6e36c3eac464be2a7a6b905cc76ed843
2012-09-18 12:15:22 -07:00
Sameer Agarwal 65625f7782 Solver::Options::ordering* are dead.
Remove the old ordering API, and modify solver_impl.cc
to use the new API everywhere.

In the process also clean up the linear solver instantion
logic in solver_impl.cc a bit too.

Change-Id: Ia66898abc7f622070b184b21fce8cc6140c4cebf
2012-09-17 15:41:10 -07:00
Sameer Agarwal 0c52f1e29b LinearSolver::Options::num_eliminate_blocks is dead.
Replaced with LinearSolver::Options::elimination_groups.

Change-Id: I7c07542ec19279a35ddf6da498d417a79395c77f
2012-09-17 11:40:03 -07:00
Sameer Agarwal 91c9bfee33 Start of the new ordering API.
Change-Id: I37b0f39011f590d54962ad3e1da1f42712008f82
2012-09-17 11:21:22 -07:00
Petter Strandmark 76533b3c46 Adding high-precision timer using OpenMP
(fixes issue #41)

Change-Id: Ieffe5f789a591c1e766ae619b75f0d7f6cd890f4
2012-09-13 18:10:57 -07:00
Keir Mierle 7e73d1020f Ensure CMakeLists.txt and include versions match.
This causes the release script to abort if the
Ceres version in the headers, command line,
and CMake files don't match.

Change-Id: I38c4f1b4ebf3499d2ba4f698fa3f4936538c3de7
2012-09-11 18:05:24 -07:00
Keir Mierle 6da1f87a6b Add Ceres version and ABI version defines to ceres.h
This will make it possible to write code which detects Ceres
versions and does different things with different versions.
Ideally this wouldn't be necessary, but in practice it is
sometimes useful.

Change-Id: I8d9f56d664ef75706e87c9bd7954e709dd7c0278
2012-09-11 17:36:47 -07:00
Sameer Agarwal fba3844b43 Fix two segaults in test code.
Thanks to Sergey Popov for reporting this.

Change-Id: Ib5124a90fc42ae9d7295c04d51a5dd8d16250504
2012-09-10 09:28:12 -07:00
Petter Strandmark ab8e2dc453 EigenSolver takes a bool
Change-Id: Ie197b4530adf23cee799b369ab96b0afafb9ead3
2012-09-10 08:46:22 -07:00
Petter Strandmark eb38e74267 Inclusion guard fix
Change-Id: Idf6245bb76c86817e332aca4393c9db86a1e2059
2012-09-08 13:53:24 -07:00
Petter Strandmark fce6aebd91 Adding a denoising example using Fields of Experts.
We have permission from Stefan Roth to use the coefficients from his
Matlab toolbox. They have been added as *.foe files.

Change-Id: Ice529e5cab0302b9f27648dd3c8e5ed7b9662aba
2012-09-07 11:54:32 -07:00
Markus Moll 059ad6e1ff Check return status in nist evaluation.
Previously, the return status was ignored, which meant that e.g. a
numerical failure (which returns 0 final error) would be counted as
correct answer (as the final error is at least as good as the certified
error).

Change-Id: Ia627d5fadf9b20100e628519af794ce0c0b195f4
2012-09-07 19:23:09 +02:00
Markus Moll 58b07a61e8 Allow choice of trust region radius in nist.cc
Change-Id: I0a03b7b6da14af22117685d5f31b06ef384a7ced
2012-09-07 10:22:20 +02:00
Sameer Agarwal 14ee795aea Add ability to query available linear algebra backend.
Change-Id: Ide349a04a69b1a377ea789b355e00b210ec792ba
2012-09-06 11:09:04 -07:00
Ricardo Martin 0b5b788187 Tiny changes to prevent a signed/unsigned compile warning.
Change-Id: Id80bad85009df7be039324609528c944b3195c60
2012-09-06 11:07:52 -07:00
Sameer Agarwal 08f0d4dee0 Stricter checking of Solver::Option::num_eliminate_blocks.
Change-Id: Ic8e61cedbe0eb028a32c89f77dc6b838d3a8caa4
2012-09-05 14:06:22 -07:00
Sameer Agarwal b329e58537 Numerically robust computation of model_cost_change.
Change-Id: I421df17bab3bfdf782d95285cf352ed37675d835
2012-09-05 11:14:09 -07:00
Sameer Agarwal cbae856193 Various cleanups to nist.cc.
More flexible testing.
Read and parse the certified cost value from the data file.
Remove the ugly hack for computing the certified cost.
Refactored the flags parsing logic

Change-Id: I8f2e6be183b758b2453302fcdc6696bfa0db5eb8
2012-09-04 15:39:18 -07:00
Sameer Agarwal a406b17d66 Fix the jacobian scaling bug.
If the norm of a column in the jacobian is near zero.
The jacobian scaling could in trying to avoid division
by zero actually make things much worse. It made it
appear that the column actually had mass when in fact
it did not.

This leads to inflated values for the parameters for
that column when we get some numerical garbage back
from the linear solver.

This should also address the case where users are setting
some columns to zero to hold some parameter constant.

The fix is a bit delicate, and frankly I am not
completely sure that it fixes the issue. But right now
I am quite certain that the current implementation is
better than what we had earlier. Whether this is the
best fix is not entirely certain.

To test the fix, I converted Arnaud Gelas' original
code which triggered this bug into a test case.

Change-Id: Idbbd8177269bdc06338e0f54410f93ddc127c8ca
2012-09-04 10:35:23 -07:00
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