Commit Graph

442 Commits

Author SHA1 Message Date
Pablo Speciale 55b6c966c4 * Fixed the location of the Ceres doc (once installed with 'make install')
* Doing 'make ceres_docs' can be used to create the documentation (if the BUILD_DOCUMENTATION=ON)
* Included the copyright boilerplate for FindSphinx.cmake

Change-Id: Iea21eba9e68384b4fe72c85fa88c76b0ba8a7a1d
2013-03-20 17:56:47 -07:00
Sameer Agarwal a986912555 Update version history
Change-Id: I238279719219a26d0d1bb32e0610f41007d3dcef
2013-03-20 11:58:08 -07:00
Pablo Speciale 16dbf11626 Added CeresConfig.cmake based on this example:
https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/buildsystem/HowToInstallALibrary

Change-Id: I130cac5d43d9fbbf359abc04d3691e25c4e2bb63
2013-03-20 18:38:27 +00:00
Pablo Speciale 015d57f173 Avoiding the Warning: "deprecated conversion from string constant to char*"
Change-Id: Ifa47f9b0724f79c5c695828628c89818ddefd844
2013-03-19 21:22:11 +00:00
Pablo Speciale c51b11c104 Sphinx and CMake, based on this example:
http://ericscottbarr.com/blog/2012/03/sphinx-and-cmake-beautiful-documentation-for-c-projects/

The 'docs/CMakeLists.txt' file was deleted in this commit: 0abfb8f46f

Thanks to Arnaud Gelas, he has passed some links:
   https://github.com/InsightSoftwareConsortium/ITKExamples/blob/master/CMake/FindSphinx.cmake
   https://github.com/InsightSoftwareConsortium/ITKExamples/blob/master/CMakeLists.txt#L120-L154

Change-Id: Ic65e7f8ec5280d1e71a897a144417a21761c5553
2013-03-19 21:05:31 +00:00
Sameer Agarwal 793a339335 Make Android.mk play better with the external consraints
Change-Id: Ia0a1037d97c032a4ba1a9acbf4e04c192d12ee61
2013-03-13 16:19:48 -07:00
Sameer Agarwal 700d50d807 Lint cleanup from William Rucklidge
Change-Id: Iacbf77246109f687708696eee7fb6144d23e7ec5
2013-03-12 16:12:42 -07:00
Sameer Agarwal 8140f0fc97 Modularize the build.
1. Add -DLINE_SEARCH_MINIMIZER to CMake to make the line search
   minimizer optional.
2. Better handling of -DSUITESPARSE/-DCXSPARSE in top level cmake
   file.
3. Disable code which will never be used if SuiteSparse and/or
   CXSparse is not available.
4. Update build docs.
5. Update jni/Android.mk
6. Minor lint cleanup from William Rucklidge.

Change-Id: If60460a858000df82faed7a6bb056dd2bfdde562
2013-03-12 11:11:57 -07:00
Sameer Agarwal c59c1e4472 Propagate ifdefs correctly to improve build efficiency.
With -DRESTRICT_SCHUR_SPECIALIZATIONS, now the various
specializations are empty, decreasing build time and
reducing the size of the static library.

Change-Id: I8ec431279741a9a83516a4167c54a364c4608143
2013-03-11 17:28:38 -07:00
Yuliy Schwartzburg 32874b861f Fix CMake "LIB_SUFFIX" for non-linux installations
Change-Id: Ieb8a2825a4378b388149e7934ecc7b96ba5a29fa
2013-03-11 20:12:00 +00:00
Sameer Agarwal 58b8c68f29 Clean up rotation.h
Change-Id: I3370c9883728cda068c9650a2c2a50641fd8299c
2013-03-09 17:17:43 -08:00
Sameer Agarwal 020d8e1e48 Better error reporting in the modeling API.
More informative error when user passes an
unknown parameter block to Problem methods.

Change-Id: I517360e4b0b55814904ca3e664877d76ad3f59e8
2013-03-06 16:19:26 -08:00
Sameer Agarwal 5e7ce8a950 Fix Problem::Evaluate documentation
Change-Id: I8c70a24743cff2d9cface99ef0f5d34c78f769c6
2013-03-06 11:38:41 -08:00
Taylor Braun-Jones 0a4f5f8f74 Fix operator() signature in several sections of the documentation
Change-Id: I73f9d150a738f7b136fbc1f98fc60b0f306bd7f9
2013-03-06 05:10:57 +00:00
Sameer Agarwal 2c648dbc43 Make examples independent of ceres internals.
Change-Id: I6b6913e067a86fea713646218c8da1439d349d74
2013-03-05 15:37:15 -08:00
Sameer Agarwal e7148795c3 Fix a memory leak in CXSparse::SolveCholesky.
Thanks to Alexander Mordvintsev for reporting this.

Change-Id: I5c6be4d3d28f062e83a1ad41cb8089c19362a005
2013-03-04 13:30:09 -08:00
Sameer Agarwal 480f9b8551 Add gerrit instructions to the docs.
Change-Id: Ic98f20273f3ccbaeb8b4ca00c4ce0042a0d262f8
2013-03-03 23:06:48 -08:00
Sameer Agarwal 7c60b5c2c6 version history update
Change-Id: Ia92caeb0f6659667ce1e56eefd0e3c87b3f6e538
2013-03-03 19:31:51 -08:00
Sameer Agarwal a363a7b69c Multithread DENSE_SCHUR
Replace the global lock in BlockRandomAccessDenseMatrix
with a per cell lock.

Change-Id: Iddbe38616157b6e0d3770eede3335a056c3ba18c
2013-03-03 18:23:12 -08:00
Sameer Agarwal 31730ef55d DenseSparseMatrix is now column-major.
1. Introduce new typdefs in eigen.h to allow for column
   major matrices.

2. Clean up old unused typedefs, and the aligned typedefs
   since they do not actually add any real performance.

3. Made eigen.h conform to the google style guide by removing
   the using directives. They were polluting the ceres namespace.

4. Made the template specialization generator work again.

Change-Id: Ic2268c784534b737ebd6e1a043e2a327adaeca37
2013-03-03 17:08:32 -08:00
Sameer Agarwal f8e43f7f27 version history update
Change-Id: Ibd412a9e5beac3b3ac3e15b26fb11aa061956095
2013-02-27 08:55:20 -08:00
Alex Stewart fef82b3a7a Bugfix - commenting-out unused member which results in build error on OS X with latest Xcode.
- Build error due to -Werror,-Wunused-private-field clang args.
- Raised with gtest group (as it also occurs with latest gtest:master but for a different
  variable) with patch, but they don't want to fix for compatibility with legacy compilers/OS
  see here: https://groups.google.com/forum/?fromgroups=#!topic/googletestframework/S1KLl2jkzws

Change-Id: I99984bcd9d07f6eb0e3fac58e27ddf0ac9e54265
2013-02-27 16:50:40 +00:00
Sameer Agarwal 0bc3540b66 Version history update
Change-Id: I6f79dd87e45bedf4bcf821e7b44f8b9553c39a7b
2013-02-27 08:46:48 -08:00
Alex Stewart b59ac43b9d Issue 83 fix: use correct pthread linker flags with clang.
1. -lpthreads was previously added to the CMAKE_CXX_FLAGS which are
not passed to the linker thus linking would fail.
2. Clang would emit a warning about -lpthreads being added to a
build instruction with -c (compile only).

This patch fixes both of these issues by adding -lpthreads to the
linker flags (and removes them from the CXX flags).

Change-Id: I5e54de3ab7eced177aa31f311926893598af5b56
2013-02-27 09:13:41 +00:00
Sameer Agarwal 6fb1024ed5 Fix a small bug in evaluator.h
Change-Id: I2c4b8637e0ac8645721109f8b6bb2396ce8bb37b
2013-02-26 22:20:18 -08:00
Sameer Agarwal 039ff07dd1 Evaluate ResidualBlocks without LossFunction if needed.
1. Add the ability to evaluate the problem without loss function.
2. Remove static Evaluator::Evaluate
3. Refactor the common code from problem_test.cc and
   evaluator_test.cc into evaluator_test_utils.cc

Change-Id: I1aa841580afe91d288fbb65288b0ffdd1e43e827
2013-02-27 05:38:28 +00:00
Taylor Braun-Jones c3fd3b960e Only use cmake28 macro for RHEL6
This makes it possible to use the same spec to build on Fedora. It drops any
chance of building on RHEL5, but I doubt that was possible anyway.

Change-Id: Ia956eb6416504e520962ec2f617e03b40ca18203
2013-02-26 00:30:35 -05:00
Taylor Braun-Jones b73148b9f3 Remove -Wno-return-type-c-linkage option when using gcc
Only use this option when compiling with CLang which supports it.

Change-Id: I8555c16e82d61302f6a43672d0d63e5d4800c6b6
2013-02-25 22:03:22 +00:00
Keir Mierle ba9442160d Add the number of effective parameters to the final report.
Here is an example report, obtained by running:

  bin/Debug/bundle_adjuster \
  --input=../ceres-solver/data/problem-16-22106-pre.txt \
  --linear_solver=iterative_schur \
  --num_iterations=1 \
  --alsologtostderr \
  --use_local_parameterization \
  --use_quaternions

Note that effective parameters is less than parameters by 16, which is the
number of cameras. In this case the local parameterization has a 3 dimensional
tangent space for the 4-dimensional quaternions.

Ceres Solver Report
-------------------
                                     Original                  Reduced
Parameter blocks                        22138                    22138
Parameters                              66478                    66478
Effective parameters                    66462                    66462
Residual blocks                         83718                    83718
Residual                               167436                   167436

Minimizer                        TRUST_REGION
Trust Region Strategy     LEVENBERG_MARQUARDT

                                        Given                     Used
Linear solver                 ITERATIVE_SCHUR          ITERATIVE_SCHUR
Preconditioner                         JACOBI                   JACOBI
Threads:                                    1                        1
Linear solver threads                       1                        1
Linear solver ordering              AUTOMATIC                22106, 32

Cost:
Initial                          4.185660e+06
Final                            7.221647e+04
Change                           4.113443e+06

Number of iterations:
Successful                                  1
Unsuccessful                                0
Total                                       1

Time (in seconds):
Preprocessor                            0.697

  Residual Evaluations                  0.063
  Jacobian Evaluations                 27.608
  Linear Solver                        13.360
Minimizer                              43.973

Postprocessor                           0.004
Total                                  44.756

Termination:                   NO_CONVERGENCE

Change-Id: I6b6b8ac24f71bd187e67d95651290917642be74f
2013-02-25 12:49:13 -08:00
Sameer Agarwal 36dc14ddf2 Fix a clang warning
Change-Id: I5ef32c6329f1f75efb30b16519b8de146a8339fa
2013-02-25 10:33:10 -08:00
Sameer Agarwal 931c309b27 Cleanup based on comments by William Rucklidge
Change-Id: If269ba8e388965a8ea32260fd6f17a133a19ab9b
2013-02-25 10:13:29 -08:00
Taylor Braun-Jones df36218c95 Add support for the CMake "LIB_SUFFIX" convention
Allows `make install` to work correctly on e.g. 64-bit systems where the
native libraries are installed to /usr/lib64

Change-Id: I71b4fae7b459c003cb5fac981278c668f2e29779
2013-02-25 18:07:19 +00:00
Taylor Braun-Jones 70701745b8 Add RPM .spec file
Tested on RHEL6.1 (with epel repository for dependencies).

make_release checks that that the version string in the .spec file is in
sync with the rest of the project and reminds the user to bump the
release string if necessary and to build/upload the RPM package.

Change-Id: I5f454f2a7301d1e0e120cb3c0e13a68d03bca917
2013-02-25 02:56:17 -05:00
Sameer Agarwal d2a5195b51 Version history update.
Change-Id: I477ec05a78ca4cd735a525253c9b6adfa3bddea7
2013-02-24 15:11:11 -08:00
Sameer Agarwal 2160c5b757 Minor release script fixes.
Change-Id: Ifd0a7f4f584c85d4d9574eca46094b372a8d7aff
2013-02-24 22:20:32 +00:00
Sergey Sharybin b53c9667f5 Solve No Previous Prototype GCC warning
In some cases there were missing includes of own
header files from implementation files.

In other cases moved function which are only used
within single file into an anonymous namespace.

Change-Id: I2c6b411bcfbc521e2a5f21265dc8e009a548b1c8
2013-02-25 01:44:50 +06:00
Sergey Sharybin 267ccc45a3 Fix for MinGW build on Windows
GG_LONGLONG and GG_ULONGLONG shall use LL and ULL suffixes,
since MinGW is actuall a GCC compiler.

Solved by checking whether compilation happens with MinGW
or not using standard MinGW's __MINGW32__ and __MINGW64__
definitions.

Change-Id: I789b34f6342a56ba42f4b280f7242700022ab7a1
2013-02-24 19:11:42 +00:00
Sameer Agarwal 509f68cfe3 Problem::Evaluate implementation.
1. Add Problem::Evaluate and tests.
2. Remove Solver::Summary::initial/final_*
3. Remove Solver::Options::return_* members.
4. Various cpplint cleanups.

Change-Id: I4266de53489896f72d9c6798c5efde6748d68a47
2013-02-24 19:04:21 +00:00
Keir Mierle d4a0bf86d6 Fix threading build on Windows.
On Windows, including the "windows.h" header defines an enormous number of
symbols; some of which are macros with common names. In particular, "ERROR" and
"min" and "max" get defined. This causes clashes when user code references
these names in a context other than the intended use in windows.h.

To deal with this, the Microsoft engineers added the ability to control the
definition of these symbols by adding extra defines. In particular, including
windows.h in the following way

  #define NOGDI
  #define NOMINMAX

will reduce the number of macros defined. This way they will not conflict with
other uses in Ceres. For example, numeric_limits<double>::max() is impossible
to call without defining NOMINMAX.

Change-Id: I166f5d3bb6dc0e2e4b2ebf800fb19e49206f7874
2013-02-24 10:40:03 -08:00
Sameer Agarwal beb4505311 Minor fixes
Based on William Rucklidge's review, including
a nasty bug in parameter block removal.

Change-Id: I3a692e589f600ff560ecae9fa85bb0b76063d403
2013-02-22 13:37:05 -08:00
Sameer Agarwal 9a88bd7c4b Minor bug fixes
Change-Id: I94e4521adf76a6c77db954c4a8955168e9d37b55
2013-02-19 13:09:12 -08:00
Sameer Agarwal 956ed7e8f2 Various minor fixes.
1. Unused variable warnings and fixes.
2. Minor documentation update.

Change-Id: I815588a5806df1030a7c8750f4fb594c503f8998
2013-02-19 09:13:50 -08:00
Keir Mierle 3e2c4ef9ad Add adapters for column/row-major matrices to rotation.h
This patch introduces a matrix wrapper (MatrixAdapter) that allows to
transparently pass pointers to row-major or column-major matrices
to the conversion functions.

Change-Id: I7f1683a8722088cffcc542f593ce7eb46fca109b
2013-02-19 08:40:09 +00:00
Keir Mierle 04938efe4b Add support for removing parameter and residual blocks.
This adds support for removing parameter and residual blocks.
There are two modes of operation: in the first, removals of
paremeter blocks are expensive, since each remove requires
scanning all residual blocks to find ones that depend on the
removed parameter. In the other, extra memory is sacrificed to
maintain a list of the residuals a parameter block depends on,
removing the need to scan. In both cases, removing residual blocks
is fast.

As a caveat, any removals destroys the ordering of the parameters,
so the residuals or jacobian returned from Solver::Solve() is
meaningless. There is some debate on the best way to handle this;
the details remain for a future change.

This also adds some overhead, even in the case that fast removals
are not requested:

- 1 int32 to each residual, to track its position in the program.
- 1 pointer to each parameter, to store the dependent residuals.

Change-Id: I71dcac8656679329a15ee7fc12c0df07030c12af
2013-02-18 15:00:30 -08:00
Sameer Agarwal fa21df8cd9 Add script for building documentation.
Update make_release

Minor documentation fixes.

Change-Id: I1248ec3f58be66b5929aee6f2aa392c15d53ed83
2013-02-18 09:22:08 -08:00
Sameer Agarwal 290b975d1d Preconditioner refactoring.
1. Added a Preconditioner interface.
2. SCHUR_JACOBI is now its own class and is independent of
SuiteSparse.

Change-Id: Id912ab19cf3736e61d1b90ddaf5bfba33e877ec4
2013-02-17 23:20:41 -08:00
Sameer Agarwal d010de5435 Solver::Summary::FullReport() supports line search now.
Change-Id: Ib08d300198b85d9732cfb5785af4235ca4bd5226
2013-02-16 01:32:44 +00:00
Sameer Agarwal fbbea464d1 Update documentation.
Change-Id: Idb03741fab9facbbbda85d5a82723f0b4c1c6c60
2013-02-15 14:29:51 -08:00
Sameer Agarwal 8e1f83c4c4 Speed up Problem construction and destruction.
Change-Id: I3147b0b60eedf40f8453d5a39ff04a572c445a2f
2013-02-15 09:13:14 -08:00
Sameer Agarwal efb47f39c3 Documentation update
Change-Id: I0fec43bff4fe0ea6cd2d2a8b34dac2330a517da0
2013-02-15 17:10:50 +00:00