Commit Graph

912 Commits

Author SHA1 Message Date
Sameer Agarwal e78a97accb Lint changes from Jim Roseborough.
Change-Id: I4b1e9ac6c1c74e96f51e57e0cbeaa3d3d649f770
2015-04-06 16:23:23 +00:00
Alex Stewart d95f9192dd Add documentation on CMake package installation process.
- A lot of users find the CMake package installation process confusing,
  particularly the use of imported targets when exporting their own
  projects which use Ceres.
- This patch adds a brief description of the overall process and the
  main bear-trap users are ensnared by.

Change-Id: I44c022bbd18a393868bf88ea9ddd807c5e08abc9
2015-04-06 16:22:32 +00:00
Sameer Agarwal e2a716994e Revert a call to SolveUpperTriangularUsingCholesky.
The call to llt in backsubstitute seems to be using one
of the fixed size specializations which is best done with
an inline call to llt/ldlt rather than introducing yet another
variant of the SolverUpperTriangularUsingCholesky and calling it.

Also change the way SolverUpperTriangularUsingCholesky handles
error. It always computes the solution even if it is garbage
and then returns the error code.

This ensures that the previous code that depends on unconditional
computation still works.

Change-Id: Idb1e6efdae9a3775a072e3b87cde02e0bbddb319
2015-04-06 02:16:46 -07:00
Sameer Agarwal 59d7f9842e Use solveInPlace correctly.
When solving a linear system using Eigen's dense Cholesky factorization
if the right hand side of the linear system is the same vector
that will store the solution, call solveInPlace instead of solve.

Change-Id: I3e6d2f21ff420c25217cd87ee5d269fdfabbf19a
2015-04-06 07:41:44 +00:00
Sameer Agarwal 10cbe858f8 Make CERES_EIGEN_VERSION macro independent of CMake.
CERES_EIGEN_VERSION was being defined by the CMakeList.txt file
but it is needed by the android build too. So this change
directly constructs the CERES_EIGEN_VERSION string out of the
raw Eigen version numbers.

Change-Id: I65309805a59076c3082141d9042ab7e0e1b972bc
2015-04-05 23:35:04 -07:00
Sameer Agarwal 81219fff78 Allow using Eigen's LDLT factorization instead of LLT factorization
It seems that Eigen's LLT factorization is broken on ARM.
This patch enables the use of LDLT factorization instead of LLT
factorization. The switch is controlled at compile time using a
preprocessor define - CERES_USE_EIGEN_LDLT.

By default we continue to use LLT factorization though.

To make the switching easier without introducing the Cholesky factorization
based inversion and linear system solve routines have been abstracted into
two new functions.

Android.mk has been updated to enable the LDLT factorization, but
the cmake file has not been updated as I will leave it to Alex's
capable hands to do proper detection of ARM as a target platform.

Change-Id: Iffe3abd2ce894de2a388b454df3da909b482d5e5
2015-04-05 22:50:41 -07:00
Alex Stewart 857c18ace0 Add versions of dependencies used to FullReport().
Change-Id: I0a41e88e0669364d21ef86146f0b572f0f08ece5
2015-04-05 14:25:25 +01:00
Alex Stewart 5b043a9400 Ensure local config.h is used if Ceres is already installed.
- Previously, if Ceres was already installed to the same location as one
  of the depenedencies (e.g. /usr/local) then as the BUILD_DIR/config
  path was necessarily added to the include_directories() list *after*
  the INCLUDE_DIRS for the dependencies, the config.h for the
  *installed* version of Ceres would be used instead of the locally
  configured version, as it would appear first on the path.
- Forcing the location of the locally configured config.h to the front
  of the include_directories() list ensures that it is found first
  (and is thus used) even if an installed version of Ceres also exists
  on the path.

Change-Id: I7b4f97a3ad0120bd11551f9b8eb6bffc66966eb4
2015-04-04 18:20:23 +01:00
Keir Mierle 11d3b9e715 Small messaging and comment updates in CMake
Change-Id: I9d6707bc686b6c74d878d8c36bbe5e95a805c6f7
2015-03-30 19:05:46 -07:00
Alex Stewart 58ee9f7d9b Handle possible presence of library prefixes in MSVC.
- On MSVC, a Ceres dependency such as glog, may be named glog.lib, or
  libglog.lib.  By default, CMake assumes no prefix for libraries on
  MSVC when using find_library(), thus find_library(glog) would fail
  if glog was named libglog.lib.
- This patch caches & updates CMAKE_FIND_LIBRARY_PREFIXES in all of
  Ceres' find_package scripts to include lib & "" (no prefix) on MSVC
  and then returns CMAKE_FIND_LIBRARY_PREFIXES to its original state
  before returning.

Change-Id: Ic82799e3b786cfb7228a51183bc189578b072bbe
2015-03-31 00:47:44 +00:00
Alex Stewart 4a423f9129 Use -O2 not -O3 on MinGW to workaround issue with Eigen.
- MinGW produces code that segfaults when performing matrix
  multiplications in Eigen when compiled with -O3 (see below), as such
  force the use of -O2 which works.
- http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556

Change-Id: I420e965d5033944374a5cc93490546c25e46bce5
2015-03-30 23:13:50 +00:00
Alex Stewart c8eeaf4ad9 Increase tolerance in small_blas test for Cygwin.
- Previous tolerance of 2.0 * std::numeric_limits<double>::epsilon()
  was too tight for Cygwin, worked on all other known platforms.

Change-Id: Ia79ad8961272dbb608d8e8ddd3f6d52e5f0735f4
2015-03-30 19:54:26 +01:00
Jack Feng 9982791969 Fix ios cmake file for cmake 3.0
In cmake 3.0, it is required to use full path for compilers. And it
seems like there's no need to force the compiler. Instead we can just
use set(CMAKE_C_COMPIER clang) so that we don't need to specify full
path of clang and clang++.

Change-Id: I9f6a625068e9d37a4bf5a595bafd82cbc13fdde4
2015-03-25 10:02:11 +00:00
Alex Stewart b611bdea11 Fix missing gflags shlwapi dependency on MinGW.
- Reported by Simeon (s1m3mu3@gmail.com) on Ceres mailing list.

Change-Id: If23491128fb6320d9b643eb3d5db7d9e67ffcf0b
2015-03-24 18:21:07 +00:00
Filippo Basso 26f50e1e72 Add users: OpenPTrack and IAS-Lab@Univ. of Padova
Change-Id: I841aeddb0f0c2b0d905fc0520553f263db7e7959
2015-03-23 11:29:07 +01:00
Alex Stewart 5a21b8b1e9 Add thread dependency & fix namespace detection on Windows for gflags.
- Add missing gflags threading dependency.
- Also add optional gflags Shlwapi dependency on Windows.
- Add check_cxx_source_compiles() with CMAKE_BUILD_TYPE to fix
  namespace test builds on Windows with NMake generators.
- Add namespace regex on gflags.h when check_cxx_source_compiles()
  fails on Windows using Visual Studio generator.

Change-Id: I6570c566e5a29c665d621a54935c16d16bac7117
2015-03-21 17:55:19 +00:00
Sameer Agarwal a6971f6c29 Documentation changes.
1. Add documentation for cubic_interpolation.h
2. Remove the list of publications. It is an incomplete list which is
   a pain to maintain.
3. Add a note about the interaction between manifolds and
   NumericDiffCostFunction.
4. Fix some of the comments in cubic_interpolation.h to better reflect reality.
5. Updated the version history.

Change-Id: I0b4a5a6f3361d3fc85f1b4aec685cd80540934f1
2015-03-21 10:42:29 -07:00
Chris Sweeney 4df3d11397 Bug fix for reversing OrderedGroups.
Reverse() method now handles the case where no groups exist.

Change-Id: Ia1ef08aa3cde01ceb71285b605a2e1f882c3b620
2015-03-21 17:00:40 +00:00
Keir Mierle 3fafa3cd72 Add CERES_ prefix to macros in public headers
Change-Id: Ie4f4311d5a669c03746e8f00426f4d7cbef20ad0
2015-03-21 04:55:20 -07:00
Sameer Agarwal 649f5c22b8 Lint changes from William Rucklidge.
Change-Id: I4c34caa57c48c97df213d6fb44a1a2534a953f0f
2015-03-20 17:05:35 -07:00
Mike Vitus cab2267e40 Add Homogeneous vector parameterization.
Change-Id: I42f68a0665a62e2c7dcc7584e5581a05c9b849b0
2015-03-20 22:08:15 +00:00
Sameer Agarwal 3f2b3779e0 Point the issue tracker link to GitHub.
Change-Id: I88cdedea15cc8d459a37507154a61889d043e8cf
2015-03-17 23:11:53 -07:00
Keir Mierle 7492b0d8de Update copyright headers with new year and URL
Since Ceres is moving to using GitHub for issues, and the Google
Code URL in the current copyright header will soon become invalid,
update all the headers.

Change-Id: I1fce70375d1bcf098591f07b4d8f01a5c1e0789c
2015-03-18 05:43:23 +00:00
Sameer Agarwal 9d916865c3 Replace README.rst with README.md
Change-Id: I3758edd4d488f24ba60b07ef019b175d78190592
2015-03-17 22:40:01 -07:00
Sameer Agarwal e15ec13014 Add Gerrit path to README.rst
Change-Id: I8006be6c484dc1d7a253e4250d9ab1e7d3acae41
2015-03-17 22:21:02 -07:00
Keir Mierle ab5ed5353e Make README indicate that GitHub is only a mirror
Change-Id: I1924021e676f6b007f06548a95410c802f506176
2015-03-17 21:31:37 -07:00
Greg Coombe bca76b5bb5 Disable LAPACK for iOS builds.
Apple annoyingly claims that dsyrk_ is a private API, and rejects
submissions to the Apple Store that include this symbol.

Also change ifdef -> ifndef in blas.cc

Change-Id: I432e9519cfe661fc96a58f36a86389a916b6a8b6
2015-03-17 11:45:06 -07:00
Sameer Agarwal f129b61d6b Hide dsyrk_ if CERES_NO_LAPACK is defined.
This will allow iOS users not to suffer Apple's
idiotic AppStore approval process.

Change-Id: I34ad3f458b0cf8ffb0f89205937233264c3bb63a
2015-03-17 13:06:41 +00:00
Alex Stewart ffa324765e Force use of single-thread in Problem::Evaluate() without OpenMP.
- Ensure that, as in the preprocessor, we force num_threads to be 1
  if Ceres was compiled without OpenMP to prevent a CHECK() failure
  in internal code.

Change-Id: I49d7bdeff81e5bb24aaaa3945018d9d012cd9df9
2015-03-15 22:30:50 +00:00
Chris Sweeney 8db90ca2f6 Less strict check for multithreading.
Removes the CHECK-fail for num_threads > 1 when
OpenMP is not detected

Change-Id: I5c1d48aad66c8b7a1f73c93dae572b73953859a0
2015-03-15 19:13:42 +01:00
Sameer Agarwal e98445e0a6 Update tolerances in small_blas_test.cc
Thanks to Philipp Hubner for reporting this.

Change-Id: Ia4f9dfa84edc164fa0c363381e94c929905f57b6
2015-03-13 06:48:54 -07:00
Steve Hsu a1579be80b Add method to return covariance in tangent space
This CL is required to build Tango.

Inspired by this commit in RedwoodInternal repository:
  commit 09dde53c248e04f432b5eccceea5daeedb706aea
  Author: Mike Vitus <mike@hidof.com>
  Date:   Wed Apr 23 11:05:17 2014 -0700

Change-Id: I328b6634969de4ccdd71947945aa67a49ee9073f
2015-03-12 11:40:18 -07:00
Steve Hsu 2132718029 Documentation corrections
Change-Id: I7aa45cc50e8d8fc4bf0f147c2b16dd428a37e761
2015-03-12 09:24:21 -07:00
Sameer Agarwal 49b815dc84 Add a missing "explicit" to BiCubicInterpolator.
The constructor was missing the explicit keyword.

Change-Id: I283ab15a0d2c4cb90f85926f2aa19fa968086320
2015-03-09 09:35:25 -07:00
Johannes Schönberger d904f36776 Fix MSVC compilation error
MSVC 2013 compiler crashed when not specifying the
template parameter of CubicHermiteSpline explicitly.

Change-Id: I6ab79aea47f55373df5cb7b89e38f8b326ff21c9
2015-03-05 10:11:09 -05:00
Sameer Agarwal afca29c473 Fix a boundary handling but in BiCubicInterpolator.
Thanks to Bernhard Zeisl for reporting this.

Change-Id: I07fb32c187128bc84868b6f0dd4fabb4a85e1302
2015-02-26 21:37:04 -08:00
Richard Stebbing c78ccc6579 Fix minor typo.
Change-Id: I4f83453c6f64a778a27b42b28e08f8e1d05908b7
2015-02-19 18:50:39 +00:00
Sameer Agarwal 822692aa2b Add the ASL at ETH Zurich to the list of users.
Change-Id: I535b954114c028ae7b6c3b6df3213c9fd79f85de
2015-02-18 02:10:43 -08:00
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