Commit Graph

22 Commits

Author SHA1 Message Date
Sameer Agarwal 5a30cae583 Preparing for 2.2.0rc1
1. Add a version history
2. Update copyright years across the code base
3. Run format_all.sh
4. Update version strings from 2.1.0 to 2.2.0 in the docs and
   elsewhere.

Change-Id: I46d8d479d54bd6002d532785e67342106e73c9ac
2023-09-21 11:23:38 -07:00
Sameer Agarwal caf614a6c1 Modernize code using c++17 constructs
Mostly done using

find . \( -name '*.cc' -o -name '*.h' \) -a -type f -exec clang-tidy -p \
cmake-build -checks='-*,google-*,modernize-*,-modernize-use-nodiscard,-modernize-use-trailing-return-type' {} -fix \;

Change-Id: Ifccbcabe7a1d9a32a09d28ac4f3f8466696c1a50
2022-04-22 06:11:18 -07:00
Sergiu Deitsch f90833f5fa Simplify symbol export
Currently, the logic for exporting symbols is rather complicated: when
tests are enabled internal symbols are exported in addition to the
public symbols. Such logic causes several problems. (1) Test binaries
link against a Ceres build that is different from the final release
since fewer optimizations are applied if more symbols are exported. (2)
Also, some toolchains hide symbols by default breaking the existing
logic eventually causing linker errors.

Since internal symbols are not intended to be used outside of the
project, we can compile them into object files and use exactly the same
binary code both for the final build and the tests without relying on
conditionals.

By default, all symbols are now hidden unless annotated as public.
Internal symbols are explicitly marked as not being exported in case
users chose not to hide symbols by default.

Change-Id: I589dd10be2f6f438508783cf99d141af0120057b
2022-02-14 20:19:08 +01:00
Sameer Agarwal 2b32b32124 Revert "Group specializations into groups of four"
This reverts commit 4ba244cdbc.

Reason for revert: This commit causes CI failures.

Change-Id: I954f2b8f093e39e3b52ca91b331591b73e646554
2021-02-17 18:38:43 +00:00
Tobias Schlüter 4ba244cdbc Group specializations into groups of four
Genrerate the specialization files by grouping the specializations into
five groups, cutting build time by three minutes (roughly 20%) in my
tests.

Change-Id: Ifd6a4523a47346c5e84c1cda15b7abba60d8e953
2021-02-12 19:56:53 +09:00
Sameer Agarwal 6d9e9843d8 Remove inclusion of ceres/eigen.h
The initial reason for this is because of a previous reformatting CL
triggered a macro redefinition warning in the schur eliminator. But
actually it was worse because the reordering had caused the macro
definition to be ignored and caused a performance regression.

This simplifies the generated files, fixes some formatting errors
and recovers the performance.

Change-Id: I9dbeffc38743b3f24b25843feec2e26a73188413
2020-09-28 19:20:24 +00:00
Nikolaus Demmel d3f66d77f4 fix formatting generated files (best effort)
- update file generator scripts / templates so generated files adhere
  to clang-format
- A few exceptions are not fixed, where the file generation results in
  lines of different width. To properly fix this would make the code
  more complicated and it's not that important for generated files
  anyway.
- note that generated files are excluded in ./scripts/format_all.sh

Change-Id: I4f42c83d1fec01242eada5e7ce6c1a5192234d37
2020-09-28 02:24:43 +02:00
Nikolaus Demmel 7b8f675bfd fix formatting for (non-generated) internal source files
- Change formatting standard to Cpp11. Main difference is not having
  the space between two closing >> for nested templates. We don't
  choose c++14, because older versions of clang-format (version 9
  and earlier) don't know this value yet, and it doesn't make a
  difference in the formatting.
- Apply clang-format to all (non generated) internal source files.
- Manually fix some code sections (clang-format on/off) and c-strings
- Exclude some embedded external files with very different formatting
  (gtest/gmock)
- Add script to format all source files

Change-Id: Ic6cea41575ad6e37c9e136dbce176b0d505dc44d
2020-09-21 02:52:07 +02:00
Sameer Agarwal 5a56d522e8 Add the 3,3,3 template specialization.
Change-Id: I32bd528ee5b1c267d6dc7aa3ab58768851748e24
2019-03-07 15:42:28 +00:00
Chris Sweeney 2d703b17b5 Add new Schur specialization for 2, 4, 6.
The row, E, F block pattern 2, 4, 6 is a common one for
bundle adjustment with reprojection error (2 residuals),
homogeneous 3d points (4 params in the E-block), and camera
poses (3 rotation + 3 position = 6 params for the
F-block). This provides a major speedup for BA in the
TheiaSfM library and likely in other applications.

Change-Id: If5df8bfadc7f154856b74c3b38479c14856db47d
2017-08-08 14:55:44 -07:00
Sameer Agarwal 784260d0b8 Fix missing ddd Schur specialization generation code
Change-Id: Ic808565844b0564b5fa5f94cbda69e9a18ac49ee
2017-02-27 11:53:22 -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
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
Alessandro Dal Grande 4992b0493e Template specialization <2,3,6>
Change-Id: If7bfaef9dea604b78290ab739e21ae2ec6195ed6
2014-12-02 19:45:11 +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
Sameer Agarwal 633b50b7af Add the (2,4,8) template specialization.
Change-Id: I058bcebdd1725031d573404133b184d6f27dc005
2014-05-02 22:47:52 -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
Sameer Agarwal 5a161a2b96 Template specializations for PartitionedMatrixView.
This speeds up the matrix vector products in the
IterativeSchurSolver by upto 40%.

Change-Id: Ib5e8d77c7269cf5ffdd2d161893734bb6d38215d
2013-10-30 21:21:31 -07:00
Sameer Agarwal 63bcdffa7d Add the 2_d_d SchurEliminator specialization.
This occurs far too often in bundle adjustment problems to be ignored.

Change-Id: Ib137f1566acf5fffa63e50a55fe8e78ea9eb1c14
2013-10-27 21:34:13 -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
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
Keir Mierle 8ebb073038 Initial commit of Ceres Solver. 2012-04-30 23:09:08 -07:00