Commit Graph

874 Commits

Author SHA1 Message Date
Sameer Agarwal 7d279fd96d Remove bounds checks from Array1D and Array2D.
This has a measurable impact on interpolation performance.

Also remove an accidentally named enum with an anonymous enum.

Change-Id: Ied6a4b2b06bb27a7f004bd0e01353742e1f84034
2015-02-15 12:42:48 +00:00
Julius Ziegler c2fe657e32 Fix typo in comment section: .a[...] -> .v[...]
Change-Id: I2116645938c4552ed495e371bfdbcaf62a443461
2015-02-12 20:27:30 +00:00
Chris Sweeney d9d9bc3ef5 Changed the CURRENT_CONFIG_INSTALL_DIR to be a variable local to Ceres.
This prevents any conflict with other libraries that use a similar syntax.

Change-Id: I7d67b283fb33ef677cc54a00c6ab66b82575422c
2015-02-10 15:05:23 +01:00
Sameer Agarwal c62bb845cd Fix sampled_function.cc to use the new CubicInterpolator API.
Change-Id: I1b2063505dc2296c141989c93a939175d5dba7e1
2015-02-08 10:56:39 -08:00
Sameer Agarwal 3125c23228 A complete re-write of the cubic interpolation code.
The key change is that there is a new layer of abstract,
a Array object that the interpolator depends on.

The Array provides a one dimension or two dimensional
array like interface independent of the underlying representation
of the data.

Also included here is support for vector valued functions.

Change-Id: Ica68f03778cf0d84192db00cd55653f8b4124d51
2015-02-06 22:06:11 -08:00
Sameer Agarwal 264bf456df Lint changes from William Rucklidge.
Change-Id: Ib468fbe7e0e8220870ddf9968ac59295c21f1e43
2015-02-06 14:34:50 -08:00
Sameer Agarwal 307332a36b Make Android.mk threads sensitive.
Make the definition of CERES_NO_THREADS conditional on the presence
of the CERES_HAVE_PTHREADS define.

This allows the user to enable threading in ceres using a combination
of CERES_EXTRA_DEFINES and linker flags which they need to do in
their app.

Change-Id: I43b99fc829001166e2f6dfb0a770768e61470591
2015-02-06 18:39:50 +00:00
Sameer Agarwal c979a4ce04 Clean up fpclassify.h.
Delete code needed by old versions of the NDK. We do not build
with these versions of the NDK and do not use STLPort anymore.

Change-Id: I61092db0aa3980cfae6ff57f3f318482027e627f
2015-02-05 14:47:33 -08:00
Sameer Agarwal eb15489a21 Improve preconditioner documentation.
Change-Id: Ied811fc16f0c1c553e37af6d3111de71baea8462
2015-02-02 22:02:51 -08:00
Sameer Agarwal 3687f9ae4c Lint changes from William Rucklidge
Change-Id: I351bef3bf7969a60d8d715731a9eafab5d612a81
2015-01-30 16:33:40 -08:00
Sameer Agarwal f572d1dd44 Improve the error handling in Conjugte Gradients.
Due to floating point and conditioning issues, a system
matrix which is guaranteed to be PSD in exact arithmetic
can appear indefinite to the ConjugateGradientsSolver.

Previously, x'Ax <= 0, the solver returned with numerical
failure. Which the trust region solver will treat as a failed
solve.

But, more general truncated Newton when they encounter indefiniteness
use the step computed till that point instead of declaring failure.

This changes does this and adds a bit more logging.

Change-Id: I0e0cc56ef7d856f1c54ac6d638327b8353039f70
2015-01-30 14:20:05 -08:00
Sameer Agarwal a2e19f163a Fix example code in the documentation.
The example code for DynamicNumericDiffCostFunction and
DynamicAutoDiffCostFunction in the documentation was
allocating the cost function objects on the stack rather
than the heap.

Thanks to Rodney Hoskinson for reporting this.

Change-Id: I217aee02d1e2c1e9c25b8197451e9f9e0482915d
2015-01-29 19:33:39 -08:00
Sameer Agarwal 940c0032eb Fix a typo in sampled_function.cc
Thanks to Pablo Speciale for reporting this.

Change-Id: Icd526856f91dba98f7abf86b098b210a89556445
2015-01-29 11:53:27 -08:00
Sameer Agarwal 207879a935 Update version history.
Change-Id: I1b6afb1a8509b3b20d3f28887c88bf15d33dbcf7
2015-01-28 19:23:24 +00:00
Sameer Agarwal 2bf6fbcd37 Example code for cubic interpolation.
Example code demonstrates how a sampled function can be
minimized. Also, in the process uncovered some deficiencies
in the CubicInterpolator and BicubicInterpolator interfaces and
fixed them.

Change-Id: I18c8f670fbee076bf1e94d1f45c7477fd71640e8
2015-01-28 07:26:06 -08:00
Sameer Agarwal a2a998ce58 Add BiCubic interpolation.
This bi-cubic interpolation implementation is based
on the cubic convolution algorithm of keys, which allows
us to implement a bi-cubic spline like interpolation scheme
using five one dimensional cubic spline operations.

Change-Id: I116aa8036191c3e654af788323fc8298ae8252a6
2015-01-27 21:40:47 -08:00
Sameer Agarwal 1789fc6d66 Add a one dimensional cubic interpolator.
Add a cubic interpolator based on the Catmull-Rom spline,
with support for automatic differentiation.

Change-Id: I02ae4c4ea37805ff1f717b05ea805989b474bd59
2015-01-26 22:24:53 -08:00
Sameer Agarwal b1f512389a Add covariance related files to the android build.
Change-Id: Ica8bf2b28bcbf6cde338f9ca3c64cd8a7d968a4c
2015-01-26 13:14:43 -08:00
Filippo Basso 1eb927422b Update Ubuntu 14.04 installation instructions.
Change-Id: Ia824f305b638c1263752efe35690fc0e5db9f75a
2015-01-26 11:55:55 +01:00
Sameer Agarwal 57d29a18f4 Fix a broken test.
The previous commit broke levenberg_marquardt_strategy_test due
a change in the logging string being used.

Change-Id: I6ea69c0bba195c3e7d457d509b9a6605458d69b4
2015-01-23 12:02:46 -08:00
Sameer Agarwal 2e1317fd98 Improve logging for linear solver failures.
Change-Id: Idc7dce702e99637f47d7585399ef8da38f0b8111
2015-01-23 11:40:44 -08:00
Sameer Agarwal db1a76d866 Better crash error messages.
When a user requests an operation on a parameter block which has
not been added to the problem, we now display a more helpful
error message with more context.

Change-Id: Ia7e54815111eb6375b31ed0d1cddca5917138ae1
2015-01-16 11:54:28 -08:00
Alex Stewart dfb8c67524 Hide Homebrew related variables in CMake GUI.
- Results of find_program() are by default visible in the CMake GUI
  (cache), but the user has no reason to care in general about the
  location of the Homebrew executable detected.
- Note it is still available in the GUI, but only via toggling to the
  advanced display.

Change-Id: Ifb0e54c00d350cbfb3b2717d889570cab61cce54
2015-01-14 21:09:30 +00:00
Alex Stewart 378b575217 Add SuiteSparse link dependency for compressed_col_sparse_matrix_utils_test.
- Reported by stonier@yujinrobot.com as Issue 153:
  https://code.google.com/p/ceres-solver/issues/detail?id=153

Change-Id: I3f0e67291adf129a6e7857ccc5f4e7e355feceb8
2015-01-14 21:03:18 +00:00
Alex Stewart 0ec02c0a6c Move check for non-standard Eigen installs into FindEigen.cmake
- As part of adding support for detection of non-standard Homebrew
  install on OSX, an Eigen specific search directory was added to the
  search path in the main CMakeLists.  This commit moves that search
  into FindEigen.cmake.

Change-Id: Ia6142211961a0d1fdddeea77b83438e4ef94434f
2015-01-11 12:39:28 +00:00
Alex Stewart 6c677cb9d6 Autodetect Homebrew install prefix on OSX.
- Call through to Homebrew on OSX to determine it's install root
  in case it is not /usr/local and add the result to the CMake
  prefix path that is searched for all find_path/library calls.
- This should allow Ceres to compile even when Homebrew is installed
  in a non-standard location.

Change-Id: I230a5e12aef54617567bdfd20c4fd45c5a04a8bf
2015-01-10 00:46:29 +00:00
Sameer Agarwal 3c8bad8fd3 Add a missing using std::max and std::min.
Thanks to Philipp Bender for reporting this.

Change-Id: I1f2947d378e0e98f6d225126a686d52738df3df0
2015-01-09 07:29:52 -08:00
Sameer Agarwal 74fd412420 Lint changes from William and Jim.
Change-Id: Ida89b67c66b3bc7683d95e63646dfb2f9679d1b1
2015-01-08 11:45:15 -08:00
Sameer Agarwal 05a07ecc77 Remove using std::string from port.h
Change-Id: I7376f5e7eace22ec1fc05a61eaa858594f08682d
2015-01-07 15:10:46 -08:00
Sameer Agarwal bcc865f81c Remove using namespace std;
For historical reasons we had a "using namespace std;" in port.h. This
is generally a bad idea. So removing it and along the way doing a bunch
of cpplint cleanup.

Change-Id: Ia125601a55ae62695e247fb0250df4c6f86c46c6
2015-01-07 14:26:53 -08:00
Alex Stewart 257f6dae46 Add note about glog not currently compiling against gflags 2.1.
- Also fix a typo in pointer to EIGENSPARSE documentation.

Change-Id: I1448fcf3680a65362c6f9b2d8a5ab0259da92364
2015-01-06 20:17:08 +00:00
Alex Stewart 60cc520f63 Add explicit no sparse linear algebra library available option.
- Previously we had no defined default value for
  sparse_linear_algebra_library_type in Solver::Options if Ceres
  was compiled with no sparse library available.  Thus in that case,
  the default value (dependent upon the compiler) would indicate that
  one was available.
- Now we have an explicit option that means no sparse library is
  available, which is now the default value in Solver::Options in this
  case.
- Add a warning in CMake when the user disables all sparse libraries.
- Fix typos in trust_region_preprocessor_test:
  (SUITE/CX)_SPARSE -> (SUITE/CX)SPARSE that induced failures when
  no sparse libraries were available.

Change-Id: I869c399a12d42bfc44220cbb25ce6d6dd80236bd
2015-01-01 18:51:45 +00:00
Sameer Agarwal 9e735d265d Improve some wording in the FAQ.
Thanks to Vasily Vylkov for suggesting the change.

Change-Id: I8e15f5ffdba2da5f55234d65ba4b9b0dadfb6085
2014-12-22 15:38:47 -08:00
Sameer Agarwal 31b1d42ce5 Delete Incomplete LQ Factorization.
This code never got expanded into a full preconditioner. No point
keeping dead code around.

Change-Id: I45badcd9e5f7eb39e8d288a96c65a02f325d76bd
2014-12-15 12:51:58 -08:00
Sameer Agarwal 92e5379c88 Add a pointer to MacPorts.
Thanks to Markus Moll for maintaining the port and pointing me to
it.

Change-Id: Ia28fcbfb4946409de9e6b85d1dc332a25555195b
2014-12-06 15:54:15 -08:00
Sameer Agarwal ba28d3a3db 1.10.0 Final.
Update version history.

Change-Id: I1b73749ba10679396369e2af0a37699181b125fb
1.10.0
2014-12-05 15:45:16 -08:00
Sameer Agarwal 8f6918e2e5 Fix the link to Tal Ben-Nun's MSVC wrapper.
Change-Id: Iec2c6b5b0a2aa2e5e3b76200c5ac91000e41f267
2014-12-04 10:54:52 -08:00
Alessandro Dal Grande 4992b0493e Template specialization <2,3,6>
Change-Id: If7bfaef9dea604b78290ab739e21ae2ec6195ed6
2014-12-02 19:45:11 +00:00
Sameer Agarwal 68222eb819 Lint cleanup from Jim Roseborough
Change-Id: Ic55b8e48110bc651ae942d34fe5402a6e0422fe3
2014-12-01 12:31:46 -08:00
Sameer Agarwal 2bdc0208c0 Get ready for 1.10.0rc2.
Update the version history.

Change-Id: I5de006c7c75b26d8c421bf1eeb525964121d2029
1.10.0rc2
2014-11-30 14:13:03 -08:00
Sameer Agarwal 159815797b Do not try the gradient step if TR step line search fails.
The line search used by the trust region minimizer when enforcing
the bounds constraints starts by using the trust region step
as the line search direction and if that fails, uses the gradient
as the fallback.

The problem with this logic is that the calling code only sees
whether one of the line searches succeeds or not. It does not see
that the fallback happened. So if the fallback line search suceeeds
it still thinks that the line search direction was the trust region
step. This is clearly wrong.

This change, removes the broken fallback logic. This has no effect
on current solution quality as it stands.

Change-Id: Ibc8edd98f77c782ec4708d1e66eaa76d6867b990
2014-11-30 13:51:50 -08:00
Alex Stewart 9631c69354 Fix missing include in libmv_bundle_adjuster on OSX.
- If compiling without glog (but with gflags) on OSX, unistd.h is
  required for close() et al, when using glog this was pulled in
  indirectly.

Change-Id: I8f0807d98479e386921fb48da30683d027d4bc61
2014-11-29 16:38:59 +00:00
Sameer Agarwal 882aea18ae Add more problems from More Garbow Hillstrom.
Also try solving the unconstrained problems from
three different starting points.

Change-Id: I8343a4dd979a3e8733981819915d25d6e9fcf993
2014-11-29 08:38:08 -08:00
Alex Stewart cbe694505e Autodetect gflags namespace.
- At version 2.1, gflags changed from using the google namespace, to
  using gflags by default.  However, it can be configured at build time
  to be something else (which would be google for legacy compatibility
  unless you were evil).
- Ceres previously assumed that gflags was in the google namespace.
- Now, FindGFlags.cmake extracts the namespace when gflags.h is found
  and saves it in GFLAGS_NAMESPACE.
- When building the tests and examples that require gflags,
  CERES_GFLAGS_NAMESPACE is defined to be the detected namespace, and
  all tests/examples now use CERES_GFLAGS_NAMESPACE:: instead of
  google:: when calling gflags functions.

Change-Id: Ia333df7a7e2f08ba9f26bbd339c3a785b88f04c4
2014-11-27 09:56:37 +00:00
Alex Stewart 9ad59a760a Compute & report timing information for line searches.
- We now compute & report the cumulative time spent performing the
  following tasks as part of a line search:
  - Evaluation of the univariate cost function value & gradient.
  - Minimization of the interpolating polynomial.
  - Total time spent performing line searches.
- This information is now reported for all minimizers, although only in
  the case of a constrained problem for the TR minimizer.
- Remove LineSearch::Function abstraction in place of using
  LineSearchFunction implementation directly, and remove virtual
  functions from LineSearchFunction.
-- LineSearch::Function added an unnecessary level of abstraction since
   the user always had to create a LineSearchFunction anyway to use a
   Ceres Evaluator, and it added an unncessary virtual function call.

Change-Id: Ia4e1921d78f351ae119875aa97a3ea5e8b5d9877
2014-11-26 01:00:17 +00:00
Sameer Agarwal 19d7ce97fe Add Tal Ben-Nun's MSVC wrapper.
Change-Id: Ifac9cdf0429c9dadd1ea49338ddcc3b83ac9ec11
2014-11-20 15:23:40 +00:00
Sameer Agarwal c929917e97 Conditionally log evaluation failure warnings.
Logging was happening unconditionally and that is rather jarring
in certain circumstances, e.g., when ceres is being called
inside a RANSAC loop.

Thanks to Bryan Klingner for reporting this.

Change-Id: I97a0b6c48df51f5f7362eb9d46654712ef044a00
2014-11-20 05:45:01 -08:00
Sameer Agarwal d9bb71c733 Runtime uses four digits after the decimal in Summary:FullReport.
Change-Id: I939bb5cf951f572832b0d665831ab2f6015f75f7
2014-11-17 06:53:51 -08:00
Sameer Agarwal 352e4dd182 Stricter options checking breaks nist.cc
Fix the breakage!

Change-Id: Ic263852cd7c8a9615d8d3dab43c6cf7d81fc8d40
2014-11-17 06:50:41 -08:00
Sameer Agarwal b58a877634 Better options checking for TrustRegionMinimizer.
Since the trust region minimizer can use the line search
minimizer when it is solving a box constrained problem,
ensure that the line search options are valid.

Also some minor spacing fixes in the line search code.

Change-Id: Ife04204855cfac389cf980f0a79155d4accc8662
2014-11-14 11:18:25 -08:00