Commit Graph

276 Commits

Author SHA1 Message Date
Keir Mierle 7bdceb46cf Evaluation callback API
This adds a callback mechanism to for users to get notified just
before jacobian and residual evaluations. This will enable
aggressive caching and sharing of compute between cost functions.

Change-Id: I67993726920218edf71ab9ae70c34c204756c71a
2018-03-07 12:41:22 -08:00
Alex Stewart df2d882540 Remove armv7 from target architectures when building for iOS >= 11.
- iOS 11+ requires a 64-bit architecture, so only arm64 is supported.

Change-Id: Ieb2ead13ba8722c6c0777b78f59f667331ad670c
2018-03-04 12:16:27 +00:00
Mike Vitus 4e391c36c1 Corrects the documentation of Problem::AddResidualBlock.
This change is provided on behalf of Steve Hsu.

Tested by compiling and inspecting the documentation.

Change-Id: Ib892bcc3ad76cba1bad133a1fd1d26468d0e6437
2018-03-01 04:09:09 +00:00
Sameer Agarwal 3d933750a7 Deprecate Solver::Options::num_linear_solver_threads
1. Solver::Options::num_threads now controls parallelism in Ceres
   Solver. The user specified value of
   Solver::Options::num_linear_solver_threads is ignored.
2. If the user specifies Solver::Options::num_linear_solver_threads
   and it is different from Solver::Options::num_threads,
   a warning is printed.
3. Solver::Summary:num_linear_solver_threads_given and
   Solver::Summary::num_linear_solver_threads_used are also
   deprecated and are always set to Solver::Summary::num_threads_given
   and Solver::Summary::num_threads_used.

Change-Id: I20b9336d9336e400e6f0a15b63857c0c43eb271c
2018-02-27 20:38:05 -08:00
Sameer Agarwal 2145c10539 Improve ExecutionSummary
1. Replace two maps by 1.
2. Update number of calls and the time for the call at the cost
   of a single map lookup.
3. Add Solver::Summary::num_linear_solves.

Fixes https://github.com/ceres-solver/ceres-solver/issues/340

Change-Id: I71eb9be7fb363a8cb066591c4c1761f256c81677
2018-02-05 16:37:27 -08:00
Sameer Agarwal 0251359830 A bunch of minor changes.
1. Fix a typo in auto_diff_cost_function.h
2. Fix and update Solver::Summary::FullReport() text labels.
3. Add logging of the number of residual and jacobian evaluations
   to the full report. The GradientProblemSolver already does this.

Change-Id: I41059af5f0ebe0417accbbc30b0808a4b04b9edb
2018-02-05 15:51:08 -08:00
Sameer Agarwal 202dd9f3a1 Add GradientProblemSolver::Options::update_state_every_iteration
The non-linear least squares solver had the ability to update the
user's parameters every iteration. Now GradientProblemSolver can
do the same.

Also a few minor Sphinx markup related cleanup to the documentation
which were found in the process of updating Sphinx on my machine
and adding the docs for this feature.

This fixes https://github.com/ceres-solver/ceres-solver/issues/246

Change-Id: Ib6b90ac22be8bfb60b14f25ad52082ba371af164
2018-01-25 21:30:09 -08:00
Sameer Agarwal ef36667a2c Fix the documentation for CostFunction::Evaluate.
The documentation was overly complex and had mismatched
symbols leading to confusion.

Change-Id: I25709e61ff3f9b9775d8f14a9e63f61931256dac
2018-01-09 14:59:44 -08:00
Sameer Agarwal 29eef08be0 Fix a mathematical typo.
Thanks to Rafael Spring for pointing this out.

Change-Id: I37a403160898f1f2617a360ef8909696d6bdbf74
2018-01-08 15:42:54 -08:00
Alex Stewart 488d401ac3 Cleanup import of TBB in CMake.
- Update FindSuiteSparse to use FindTBB.cmake to find TBB.
- Fix logic handling of TBB=ON if TBB is not found to continue with
  build after disabling TBB rather than throwing a fatal error.
- Use TBB_LIBRARIES instead of TBB_tbb_LIBRARY as a Ceres dependency,
  the former also includes the TBB malloc library.
- Add warning message about GPL licensing if TBB version < 2017.
- Add ‘TBB’ & ‘Mulithreading’ component options to find_package(Ceres),
  where ‘Mulithreading’ is equivalent to ‘TBB’ || ‘OpenMP’.

Change-Id: Ifc7f1d01b050ba6e2097ad1913b178805df4769a
2017-12-11 10:15:32 +00:00
Alex Stewart aab0193c7b Move discussion of dependency licensing to Sphinx docs.
- Also enable EIGENSPARSE option by default as LGPL licensing
  implications are less severe that SuiteSparse’s GPL implications which
  is enabled by default.

Change-Id: Ic7e4fef5cef614d5ce719eeefcc35bf4b63b8dac
2017-12-08 01:24:48 +00:00
Keir Mierle cb497df619 Add link for CLA in docs; minor fixes
Also fixes a typo in cost_function.h

Change-Id: I45f08fd27fd2f8e5cb5b3f08e0d4f9a3e8822a15
2017-10-24 17:18:02 -07:00
Yury Prokazov 4ffec20a44 Add TBB threading support.
There are platforms where OpenMP is not available. This
patch adds support for Intel Threading Building Blocks (TBB)
as an alternative threading backend.

Change-Id: I94497d7cba0c3cfaccfc992169236f17fe948ae9
2017-09-25 12:43:14 +02:00
Alex Stewart 30885841a5 Add docs explaining how to build Ceres with OpenMP on OS X.
Change-Id: If45c12876dc58a042bbdf017de77003a161dc16c
2017-08-31 10:02:11 +01:00
Alex Stewart cc73c77d50 Update LAPACK option to refer to direct use by Ceres only.
- Previously the LAPACK option meant would Ceres link against LAPACK,
  whether directly or indirectly via SuiteSparse (if SUITESPARSE=ON),
  as such if LAPACK=OFF, the use of SuiteSparse was disabled, even if
  it was found.
- To support the use-case of using a limited LAPACK implementation that
  satisfies SuiteSparse’s requirements, but potentially not Ceres’ we
  now adopt the more conventional terminology whereby the LAPACK option
  refers only to whether Ceres itself will directly call LAPACK
  routines, not whether it or any of its dependencies will.
- This means that the LAPACK and SUITESPARSE options are now
  independent.
- Also unnecessary calls to find_package(BLAS), as find_package(LAPACK)
  already searches for BLAS, and appends the resulting libraries to
  LAPACK_LIBRARIES if they are found.

Change-Id: I9cf5fa5e4cb621812f6f0526db8d16a7a39c9c8f
2017-08-13 18:27:21 +00:00
Sameer Agarwal 19333b0f55 Update version history & installation.rst
Update docs in preparation for 1.13.0.

Change-Id: I3d66f4094fe83c7d29b3ea4003c00ee158c6f9ac
2017-08-03 00:09:36 -07:00
Sameer Agarwal 87f823617e Fix dynamic_sparsity_test.
Skip the test in dynamic_sparsity_test when there are no sparse
linear algebra libraries available.

Also fix a minor typo in version_history.rst

Change-Id: Ie7cc14e655c58b6bd9625ce9f9025f94d0624d2d
2017-07-10 11:32:27 -07:00
Sameer Agarwal b704612888 Update version history.
Update the version history in preparation for 1.13.0RC1 and
also reformat older parts of the version history file.

Change-Id: I133e5966629e8277631ec5d407165ad188efa1e1
2017-07-07 12:14:35 -07:00
Sameer Agarwal 7a6ae54709 Add William Rucklidge to the list of maintainers.
Update contributing.rst.

Change-Id: I4e9712d143f15301abfdc49ca938abc042a29ddd
2017-07-02 07:30:21 +00:00
Sameer Agarwal a9977da3eb Fix and enhance GradientProblemSolver::Summary::FullReport
1. Fix a bug which was causing the cost and gradient evaluation
   time to not be reported.
2. Add the number of times cost and gradients are evaluated to
   the Summary object and to the output of FullReport.

Change-Id: Id0703cd2dafbf437f3e537fbdc30ae81d5f4f540
2017-06-28 06:26:04 -07:00
Keir Mierle aaae5c5f62 Update docs: .netrc --> .gitcookies
Change-Id: Ic1d66a25fe74e33667ab71bcf0b346ac3a632257
2017-04-25 01:32:31 +00:00
Sameer Agarwal 7d1ec64384 Add a missing file.
Change-Id: I4a60a2715d05b6ad158358e150e78226b418cdbd
2017-04-17 15:09:28 -07:00
Sameer Agarwal 14d8297cf9 Refactor Covariance::Options::algorithm_type.
THIS IS AN API BREAKING CHANGE.

Decouple the algorithm from the sparse linear algebra
library being used to perform the computation.

Before this change

Covariance::AlgorithmType had values

DENSE_SVD
EIGEN_SPARSE_QR
SUITE_SPARSE_QR

This has been replaced by two enums now.

Covariance::Options::sparse_linear_algebra_library_type
which can take values EIGEN_SPARSE, SUITE_SPARSE or CX_SPARSE.
The last one is currently not supported.

And Covariance::Options::algorithm_type takes values

DENSE_SVD
SPARSE_QR

This sets the stage for future extensions of the covariance
computation algorithm.

Also as part of this change, the covariance computation chapter
has been made a top level chapter on its own instead of being
buried deep inside the Solving Non-linear Least Squares problem.

Change-Id: Ibfbf60902d8d17694d9ff585047a5a57d329ab22
2017-04-17 09:43:22 -07:00
Sameer Agarwal 5ee2b356b3 Untabify changes from Jim Roseborough
Change-Id: Ic640b34ba785669b415acfbeb2c931bea768f985
2017-04-13 13:17:29 -07:00
Sameer Agarwal 056d21d948 Fix a bunch of typos in the documentation.
Thanks William Rucklidge.

Change-Id: I3843f90897a61938a2641ef8fb43bcd3ec7796a1
2017-04-10 18:16:57 -07:00
Alex Stewart 0a50cd8244 Fix typo in docs: max_lbfs_rank -> max_lbfgs_rank.
Change-Id: I49ffec85c2b43fe4f51fd214f461c2ec51360270
2017-04-04 16:56:46 +01:00
Alex Stewart c123864372 Use Ceres_[SOURCE/BINARY]_DIR not CMAKE_XXX_DIR to support nesting.
- Using Ceres_[SOURCE/BINARY]_DIR (which are defined by CMake when
  project(Ceres) is called, in favour of CMAKE_[SOURCE/BINARY]_DIR
  enables Ceres to be nested within (and built by) a larger CMake
  project (which also contains other projects).
- CMAKE_[SOURCE/BINARY]_DIR always refers to the top-level source
  and binary directories (i.e. the first encountered), as a result if
  Ceres is a nested project within a larger project, these would not
  correctly identify the source/binary directories for Ceres (as they
  would refer to the root project in which Ceres is nested).
- Using Ceres_[SOURCE/BINARY]_DIR should ensure that Ceres always uses
  the correct source/binary directories, irrespective of whether Ceres
  is nested or not.

Change-Id: I62226ea3f6552b1d7e2bdac1aef02f1f489ae55e
2017-04-03 14:47:29 +01:00
Sameer Agarwal d02b5d7022 Update Problem::EvaluateOptions documentation.
Thanks to Ricardo Martin for reporting this.

Change-Id: Ic3ce60f8de419f1d2cb19c949054049da79fe91a
2017-03-31 19:03:34 +00:00
Sameer Agarwal 7146d16dbf Add an article on interfacing with automatic differentiation.
Doing this also necessitated some re-organization of the derivatives
article into chapters and some minor edits.

Change-Id: Ic08e83af138817173caa80a52a9e72707cd57512
2017-03-26 12:47:57 -07:00
Sameer Agarwal 419f330394 Flatten the table of contents.
Remove the "Guide" and expose the modeling and solving non-linear
least squares in the left hand side navigation bar.

Change-Id: Ibbb4f0f580a5981165a0945570fc0f4c4ea559e9
2017-03-19 16:46:26 -07:00
Sameer Agarwal 5f87f35cec Changes from William Rucklidge
Change-Id: Ia5d724edef947870fe13050a71aa1cba878352a8
2017-02-27 11:09:08 -08:00
Sameer Agarwal 1cfec3c666 Improvements to Schur template specializations
1. Refactor the python code that generates the template specializations
   to remove code duplication.
2. Improved the logic for template specialization selection where
   Eigen::Dynamic now serves as a wildcard.
3. Added schur_templates.h/cc which allows querying the set of available
   template specializations without instantiating a linear solver.
4. Added Solver::Summary::schur_structre_given and
   Solver::Summary::schur_structure_used and expose them in
   Solver::Summary::FullReport for better performance debugging.
5. Updated the templates with newer dates and some minor comments cleanup
   which lead to the the template specializations to be re-generated.

Change-Id: Iaf3c6f714353597899916c300465da01f151c3de
2017-02-23 14:52:59 -08:00
Sameer Agarwal 5dd76f9f00 Corrections from Bjorn Piltz
Change-Id: I2b56eb29db4b90b22c472d36747ca04e3c06b89f
2017-02-22 11:56:38 -08:00
Sameer Agarwal e77813f095 minor corrections to derivatives.rst
Change-Id: I6bb5e3c507113c8873c4c516e9cae3239cca247c
2017-02-16 21:40:34 -08:00
Sameer Agarwal f2a96f0491 Edits to derivatives.rst from William Rucklidge
Change-Id: I21991c4d302d6aa569aedf9157d9628c15cc9ed5
2017-02-16 21:23:41 -08:00
Sameer Agarwal ed379f075d Rename tl;dr to High Level Advice
Thanks Pierre Moulon :)

Change-Id: I7e1948efc2fe27d9ddac46f8902ac39677e26eb4
2017-02-16 15:29:58 -08:00
Sameer Agarwal 9ba2d46d37 Add an article on derivatives
Change-Id: I4d3efbc38dc068035f30ff808dfdc7970408a010
2017-02-16 13:01:45 -08:00
Sameer Agarwal 62a70bc74c Lint cleanup from William Rucklidge
Change-Id: I11ebf9bdb09cfd465a32a61e0a9a045ab650deac
2017-02-15 11:01:27 -08:00
Sameer Agarwal d05515b3eb Remove spurious conversion from doubles to Jets.
Binary operations between Jets and doubles are well defined
and should not require an explicit conversion to Jets to work.
This was an oversight earlier and lead to overzealous conversions
all over our in our example code.

Change-Id: I1799770818e136edfc0a5802d86037ce9aec4923
2017-02-10 11:36:58 -08:00
Sameer Agarwal 541968497a Fix an error in the tutorial code for NumericDiffCostFunction
Thanks to Gohteu Nuetah for pointing it out.

Change-Id: Ibfeb9ab9dfbdb259f35b1b8f6b85d30a363db7d4
2017-02-09 14:43:24 +00:00
Sameer Agarwal e857c1b5a7 Fix a latex bug.
Change-Id: I4e4ba9dc51d2929d88201b4d83c434ca1ecfbf7a
2016-12-22 02:10:54 -08:00
Sameer Agarwal d55fa69292 Fix a minor typographical error in the version history.
Change-Id: I9648aaf218321f9e144de20ef5e512385a6cfe34
2016-12-05 08:06:54 -08:00
Sameer Agarwal 029799d757 Update Version History
Change-Id: I385fa095c86232f2b58f9d0a1a5f9d959aeade49
2016-12-05 07:42:48 -08:00
Sameer Agarwal d1e954d246 Minor changes to the documentation.
1. Section title changes.
2. Moving the glog discussion into installation.rst
3. Re-working the faqs into two separate chapters.

Change-Id: I95dd25bace50f0f9077ef114504999190686963e
2016-11-27 15:12:11 -08:00
Sameer Agarwal 0aa945cf48 Fix versioning in the documentation
Change-Id: I0b8b599972cc32839b6aefe6b9e96861cfd522f8
2016-11-24 21:21:36 -08:00
Sameer Agarwal 7cb5d9cca3 Update changelog
Change-Id: Ib284990fd819c71411617c3d995178181af9fc4d
2016-11-21 06:24:28 -08:00
Sameer Agarwal 0f80f018ff Update changelog
Change-Id: I36db7e705ad520321335ff2f438cba54d914bb5c
2016-11-20 12:13:56 -08:00
Sameer Agarwal 717417512b Update changelog
Change-Id: I1c8bef059adc57476b5e75310fd7d983b8229bf7
2016-11-11 10:48:51 -08:00
Sameer Agarwal 7ed9e2fb7f Occured -> Occurred.
Thanks to Phillip Huebner for reporting this.

Change-Id: I9cddfbb373aeb496961d08e434fe661bff4abd29
2016-10-19 04:45:23 -07:00
Sameer Agarwal 5690b447de Fix documentation source for templated functions in rotation.h
Change-Id: Ic1b2e6f0e6eb9914f419fd0bb5af77b66252e57c
2016-10-13 09:52:02 -07:00