Commit Graph

691 Commits

Author SHA1 Message Date
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
Sameer Agarwal 082d9e2a1b Add iOS.cmake from the ios-cmake project.
URL: https://github.com/cristeab/ios-cmake
Commit: 86dc085f0d5ed955cd58e2657cc3efc7c1aabbc8

Change-Id: I8fe6023d4cb6655b5a724e8b695fdae87ce3b685
2014-05-13 16:48:25 -07:00
Sameer Agarwal a97056c975 Various documentation fixes from William Rucklidge.
Change-Id: I102e98f41f4b5fe2a84d1224d5ed7517fdfdb022
2014-05-13 16:45:36 -07:00
Alex Stewart 2f8fb218f0 Adding function to update CMake cache variables and preserve help.
- Previously we were replicating the same two lines to update a cache
  variable whilst preserving its help string.
- This commit adds a function which wraps up this common operation into
  a single line.

Change-Id: Ic78a5adf5d59262bbbcec1e353ded7620391e862
2014-05-13 20:57:39 +01:00
Sameer Agarwal 8f4dcb25f1 Documentation update.
Update modeling.rst and solving.rst to reflect
changes to the API.

Change-Id: Id1a8adfed1486f08e5fd67c5af2d29708a26490c
2014-05-13 12:31:30 -07:00
Alex Stewart d48e705022 Configure config.h and include it from the build directory.
- Previously we overwrote the default (empty) config.h in the source
  tree with a configured config.h, generated using the current compile
  options.
- This was undesirable as it could lead to inadvertant commits of the
  generated config.h.

- This patch moves the default config.h to <src>/config/ceres/internal,
  separate from the other headers, thus if Ceres is compiled without
  CMake this directory will now also have to be included.  This
  directory is _not_ added to the CMake include directories for Ceres
  (thus the default config.h is never used when compiling with CMake).
- When using CMake, the generated config.h is now placed in
  <build>/config/ceres/internal, which is in turn added to the include
  directories for Ceres when it is compiled, and the resulting config.h
  is copied to ceres/internal when installed.

Change-Id: Ib1ba45e66e383ade2ebb08603af9165c1df616f2
2014-05-13 20:23:20 +01:00
Sameer Agarwal 11c496164f Fix 80cols violation in local_parameterization.h
Change-Id: I07f59baa9e4aba7c5ae028f0c144ea9ad153d49a
2014-05-09 16:27:03 -07:00
Sameer Agarwal af3154422b Add Alex Stewart as a maintainer.
Update contributing.rst to mention Alex
as one of the people who can be added
as a reviewer.

Change-Id: I30ff3e635e8c419e11e8f20394aaea5f284a10d5
2014-05-09 16:10:55 +00:00
Alex Stewart ea76585068 Adding autogenerated Ceres config.h to #define Ceres compile options.
- Previously we passed all compile options to Ceres via add_definitions
  in CMake.  This was fine for private definitions (used only by Ceres)
  but required additional work for public definitions to ensure they
  were correctly propagated to clients via CMake using
  target_compile_definitions() (>= 2.8.11) or add_definitions().
- A drawback to these approaches is that they did not work for chained
  dependencies on Ceres, as in if in the users project B <- A <- Ceres,
  then although the required Ceres public compile definitions would
  be used when compiling A, they would not be propagated to B.

- This patch replaces the addition of compile definitions via
  add_definitions() with an autogenerated config.h header which
  is installed with Ceres and defines all of the enabled Ceres compile
  options.
- This removes the need for the user to propagate any compile
  definitions in their projects, and additionally allows post-install
  inspect of the options with which Ceres was compiled.

Change-Id: Idbdb6abdad0eb31e7540370e301afe87a07f2260
2014-05-09 10:57:31 +01:00
Björn Piltz cbf955474a Fixes swapped verboselevel and condition.
Change-Id: I296d86e6bbf415be4bfd19d6a0fe0963e3d36d74
2014-05-07 19:02:41 +00:00
Björn Piltz 3209b04574 Fixed warning : 'va_copy' : macro redefinition
MSVC 2013 has got va_copy
Compare
http://msdn.microsoft.com/en-us/library/kb57fad8(v=vs.110).aspx
and
http://msdn.microsoft.com/en-us/library/kb57fad8.aspx.

Change-Id: If0937c76e8d250cde4b343844f3d35c980bf0921
2014-05-07 19:02:07 +00:00
Björn Piltz 1df2f0f5d7 Removed MSVC warnings
These are warnings which show up when using Ceres.

Change-Id: Id1f382f46b8a60743f0b12535b5b3cdf46f988e0
2014-05-07 20:56:04 +02:00
Sameer Agarwal eca7e1c635 Remove BlockRandomAccessCRSMatrix.
It is not used anywhere.

Change-Id: I2a8ebbdacf788582f21266825ead3f76646da29e
2014-05-06 10:16:19 -07:00
Sameer Agarwal 7088a08f5d Fix some 80col violations and reflow the comments in cmake.in file.
Change-Id: I4c65c89b794845aeef69159a03350c727e2ee812
2014-05-05 09:02:05 -07:00
Sameer Agarwal 95cce0834d Remove some errant tabs.
Change-Id: Ie1f7051e99bcb15ad068711b68a9d8f317b12ed7
2014-05-05 08:54:50 -07:00
Sameer Agarwal a536ae76df Lazily initialize the bounds arrays in ParameterBlock.
Problems that do not use bounds do not have to pay the
price of storing bounds constraints.

Also replace the raw pointer access to the upper and
lower bounds arrays with accessors which hides the
lazy initialization from the user.

Change-Id: I0325a35de9c29f853559f891e32e7c777686e537
2014-05-05 07:55:12 -07:00
Sameer Agarwal 633b50b7af Add the (2,4,8) template specialization.
Change-Id: I058bcebdd1725031d573404133b184d6f27dc005
2014-05-02 22:47:52 -07:00
Alex Stewart 5ffe06019a Export Ceres compile definitions to targets compiled against Ceres.
- Previously all Ceres compile definitions were private to Ceres, that
  is they were not exported to users via the CMake export mechanism.
- Now that we use compile definitions in public (installed) Ceres
  headers, we need to export the Ceres compile definitions.
- If we did not do this, then the client's code 'see's' a different
  version of the Ceres headers to those which were in fact compiled,
  or in the case of shared_ptr, may not find the required header.

- This patch makes use of the new, in CMake 2.8.11, function:
  target_compile_definitions() to export all of the Ceres compile
  definitions using CMake's export functionality.
- For CMake versions < 2.8.11, we have to use the blunter instrument of
  calling add_definitions() in CeresConfig.cmake (invoked by a call to
  find_package(Ceres)).  This is messy because it ends up adding the
  Ceres compile definitions to any target declared in the user's code
  after the call to find_package(Ceres).  Although this should do no
  harm as all of our defines are prefaced with CERES_, so any
  unintentional name clashes are unlikely.

Change-Id: I5dea80949190eaf4fb08ea4ac568ce28c32dd4e0
2014-05-02 13:33:24 +00:00
Sameer Agarwal 0e811b0881 Fix a bug in Minimizer::RunCallbacks.
Solver::Summary::message was not being updated when the solver
terminated because of a user's iteration callback indicating
success or failure.

Thanks to Sergey Sharybin for reporting this.

Change-Id: I27e6e5eed086920ddf765461b0159417ac79d7b3
2014-05-01 11:39:37 -07:00
Sameer Agarwal 31b5037926 Lint cleanup from William Rucklidge.
Change-Id: If545f114c1a2b07edd660a3c71ecfc16ffa25e43
2014-04-30 15:02:38 -07:00
Sameer Agarwal 15c1210a8b Lint cleanup from Jim Roseborough.
Change-Id: I53f4e0d020602443b397387b8c5908f25649403d
2014-04-30 14:32:16 -07:00
Sameer Agarwal b1668067f1 Variety of changes to documentation and example code.
1. Update version history.
2. Minor changes to the tutorial to reflect the bounds constrained
   problem.
3. Added static factory methods to the SnavelyReprojectionError.
4. Removed relative gradient tolerance from types.h as it is
   not true anymore.

Change-Id: I8de386e5278a008c84ef2d3290d2c4351417a9f1
2014-04-29 09:09:00 -07:00
Sameer Agarwal 658407dacc Add missing template specializations to the NDK build.
Change-Id: I42bb6c3bd47648050298472af80333aa900e79bf
2014-04-28 13:25:17 -07:00
Björn Piltz 5d7eed87b4 Suppport for MSVC DLLs.
Change-Id: Ibbcc4ba4e59f5bbf1cb91fe81c7d3b9042d03493
2014-04-28 19:56:24 +00:00
Sameer Agarwal c830820a5c Add missing files to Android.mk
Change-Id: Ibdf577c592bcde0fe5c2ce343ed8e9028b82af8f
2014-04-28 10:28:24 -07:00
Sergey Sharybin ceb7a3beaa Fix compilation error when using G++ compiler
This compiler defines shared_ptr in std::tr1 namespace, but
for this <tr1/memory> is to be included. Further, this compiler
also does have <memory> header which confused previous shared
pointer check.

Simplified logic around defines now, so currently we've got:
- CERES_TR1_MEMORY_HEADER defined if <tr1/memory> is to be
  used for shared_ptr, otherwise <memory> is to be used.
- CERES_TR1_SHARED_PTR defined if shared_ptr is defined in
  std::tr1 namespace, otherwise it's defined in std namespace.

All the shared_ptr checks are now moved to own file FindSharedPtr
which simplifies main CMakeLists.

Change-Id: I558a74793baaa0bd088801910a356be4ef17c31b
2014-04-28 15:37:59 +00:00
Sameer Agarwal 02db9414fb Fix the documentation for RandNormal.
As pointed out by Jim Roseborough, this is the Marsaglia Polar
method and not the Box-Muller method.

Change-Id: Id5332bcd4b4c23a3885cc296729b44eaa5edd0a8
2014-04-28 08:32:51 -07:00
Richard Stebbing 32530788d0 Add dynamic_sparsity option.
The standard sparse normal Cholesky solver assumes a fixed
sparsity pattern which is useful for a large number of problems
presented to Ceres. However, some problems are symbolically dense
but numerically sparse i.e. each residual is a function of a
large number of parameters but at any given state the residual
only depends on a sparse subset of them. For these class of
problems it is faster to re-analyse the sparsity pattern of the
jacobian at each iteration of the non-linear optimisation instead
of including all of the zero entries in the step computation.

The proposed solution adds the dynamic_sparsity option which can
be used with SPARSE_NORMAL_CHOLESKY. A
DynamicCompressedRowSparseMatrix type (which extends
CompressedRowSparseMatrix) has been introduced which allows
dynamic addition and removal of elements. A Finalize method is
provided which then consolidates the matrix so that it can be
used in place of a regular CompressedRowSparseMatrix. An
associated jacobian writer has also been provided.

Changes that were required to make this extension were adding the
SetMaxNumNonZeros method to CompressedRowSparseMatrix and adding
a JacobianFinalizer template parameter to the ProgramEvaluator.

Change-Id: Ia5a8a9523fdae8d5b027bc35e70b4611ec2a8d01
2014-04-28 07:13:09 +00:00
Sameer Agarwal 2569076ff0 More NDK fixes.
Fix variable names in port.h and fix fpclassify when
using gnustl. This was tested by switching to gnustl
in the JNI build.

Thanks to Carlos Hernandez for suggesting the gnustl fixes.

Change-Id: I690b73caf495ccc79061f45288e416da1604cc72
2014-04-25 23:55:48 -07:00
Sameer Agarwal e55596f886 Change the defaults for shared_ptr.
By default shared_ptr is now assumed to be
in the standard <memory> header and in the
std namespace.

Previously the way the ifdefs were structured if the appropriate
variable was not defined, it would default to <t1/memory>.

The new defaults are more future proof.

Change-Id: If457806191196be2b6425b8289ea7a3488a27445
2014-04-25 16:17:19 -07:00
Sameer Agarwal bb05be341b Solver::Options uses shared_ptr to handle ownership.
Solver::Options::linear_solver_ordering and
Solver::Options::inner_iteration_ordering
were bare pointers even though Solver::Options took ownership of these
objects.

This lead to buggy user code and the inability to copy Solver::Options
objects around.

With this change, these naked pointers have been replaced by a
shared_ptr object which will managed the lifetime of these objects. This
also leads to simplification of the lifetime handling of these objects
inside the solver.

The Android.mk and Application.mk files have also been updated
to use a newer NDK revision which ships with LLVM's libc++.

Change-Id: I25161fb3ddf737be0b3e5dfd8e7a0039b22548cd
2014-04-25 15:54:39 -07:00
Joydeep Biswas 8e0991381e Added a simplified robotics example for DynamicAutoDiffCostFunction.
Change-Id: I9520e0a9a8d9743285c5114523fbafa6ffa5b0bd
2014-04-25 08:49:27 -04:00
Sameer Agarwal cc9d3bba10 Remove a comment from conf.py
Change-Id: I675f7e8fc5dd2143eab74901bc7241e02e37285f
2014-04-18 22:58:09 -07:00
Sameer Agarwal c4cd29dd7c Merge landing page with introduction.
The existing introduction was a bit redundant and also
was not really an introduction. Also updated the build
instructions to reflect the new reality on Mac OSX.

Also updated the beginning of the tutorial to be a bit
gentler and updated the history to be more consistent

Change-Id: Ife38c1949252cf9f4c6301856957f2d38365f313
2014-04-16 23:40:12 -07:00
Sameer Agarwal 46ccfb376a Cleanup block_structure.h/cc
1. Remove obsolete Proto conversion functions.
2. Fix a strict weak ordering bug.

Change-Id: I1ce6d4b06e29cf475df1d5bd37c79f66f20f8d93
2014-04-12 21:58:11 -07:00
Sameer Agarwal 7d489fdb07 Refactor the landing page to be a bit more compact.
Also minor changes to the introduction.

Change-Id: Iaa71f576b95c869f075d6837dbb60ba4bb608ee7
2014-04-07 11:45:53 -07:00
Keir Mierle 406ac78167 Rework Ceres documentation as new website
This reworks the Ceres Sphinx documentation such that it can
function as the main Ceres website, now hosted at
ceres-solver.org. This also changes to the theme sphinx_rtd_theme
used by Read The Docs; this theme has strong mobile support and is
well enough designed.

Change-Id: I63232d985859a6dac94ff58f08bf81eb2b9e7f99
2014-04-07 15:28:21 +00:00
Richard Bowen 3e60a998ac Added support and tests: row and column blocks for sparse matrix
transpose.

Change-Id: Ife641b08a9e86826478521a405f21ba60667f0e8
2014-04-04 17:56:49 -07:00
Sameer Agarwal 5ecb1c3f1d Add Problem::IsParameterBlockPresent.
This allows the user to query the Problem to see if a
parameter block is already present or not.

Change-Id: If786f6c008cc644f3398597901d718d12a6d865d
2014-04-01 10:04:12 -07:00
Sameer Agarwal 75e2232b29 Fix spacing in building.rst
Change-Id: I4c68d732c80d7ff2bdbc812bf0b7c7fb98c43957
2014-03-28 11:21:02 -07:00
Richard Bowen b555b489b8 Changes documentation to reflect changes in output format.
Change-Id: Ic0ba234283e791edcad29aec067905dcb2130813
2014-03-27 15:51:58 -07:00
Sameer Agarwal 1cfb600bfc Add the (2,4,9) template specialization for PartitionedMatrixView
and SchurEliminator.

Also update the comment inside generate_partitioned_matrix_view_specializations.py

Change-Id: I99a7ab4256091b1da48553da3076e5996a5757ed
2014-03-26 12:59:32 -07:00
Alex Stewart 195e49351b Check validity of residual block before removal in RemoveResidualBlock.
- Breaking change: Problem::Options::enable_fast_parameter_block_removal
  is now Problem::Options::enable_fast_removal, as it now controls
  the behaviour for both parameter and residual blocks.

- Previously we did not check that the specified residual block to
  remove in RemoveResidualBlock actually represented a valid residual
  for the problem.
- This meant that Ceres would die unexpectedly if the user passed an
  uninitialised residual_block, or more likely attempted to remove a
  residual block that had already been removed automatically after
  the user removed a parameter block upon on which it was dependent.
- RemoveResidualBlock now verifies the validity of the given
  residual_block to remove.  Either by checking against a hash set of
  all residuals maintained in ProblemImpl iff enable_fast_removal
  is enabled.  Or by a full scan of the residual blocks if not.

Change-Id: I9ab178e2f68a74135f0a8e20905b16405c77a62b
2014-03-26 17:49:36 +00:00