Commit Graph

35 Commits

Author SHA1 Message Date
Sameer Agarwal 0a53aa9054 Take abseil as a dependency
1. Add abseil-cpp as a submodule. We are tracking the latest LTS
release, which is lts_2024_01_16.
2. Replace glog/gflags with absl::log and absl::flags.
3. Remove miniglog
4. Also take a whack at making the bazel build work with
   abseil-cpp and gtest.

There are a number of TODOs in this CL that still need to be resolved.

Change-Id: I39355ed7d61375be4ebcbc8596d9cc70acc1c678
2024-07-18 00:24:49 -07:00
Sameer Agarwal e776a6f1a1 Unbreak the Bazel build.
The build was broken because parallel_for.cc was deleted
and new file parallel_vector_ops.cc was added.

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

Change-Id: I5b7a03b97134da55d408e57747634a5943a0e0aa
2024-01-16 16:56:17 -08:00
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
Dmitriy Korchemkin 54ad3dd03c Reorganize ParallelFor source files
Change-Id: Ic4941919e59210b48e447cbb61e539200c8c89df
2023-04-11 00:33:55 +03:00
Alexander Ivanov f1113c08ab Commenting unused parameters for better readibility
Change-Id: Idc285fa68ba787636a69a3ea3350e0282b9f8569
2023-01-12 17:25:42 +00:00
Alexander Ivanov f982d3071d Fixing bazel build
Change-Id: I610c5a1f4f8c46d7ef75dd4861e31e98c2fa825d
2023-01-09 06:19:18 +00:00
Sameer Agarwal 5e877ae69a Fix the Bazel build
Fixes https://github.com/ceres-solver/ceres-solver/issues/893

Change-Id: I95802354bc8a00848573c564fe75c5e87ddf8fae
2022-09-25 20:26:02 -07:00
Sameer Agarwal 68c53bb395 Remove ceres::LocalParameterization
Change-Id: I3bdf2f6a8857db10c984024a27f490eefd23fefa
2022-07-29 22:29:23 +00:00
Sergiu Deitsch 0c88301e66 Provide optional METIS support
* Split `CERES_NO_METIS` into two defines: `CERES_NO_PARTITION` and
  `CERES_NO_METIS`. The former refers to METIS support in SuiteSparse,
  the latter to the Eigen's MetisSupport module. This enables the use of
  sparse matrix reordering independent from SuiteSparse.
* Run Linux, macOS, and macOS Github workflows with METIS enabled
  SuiteSparse.

Fixes #808

Change-Id: I5076b7e1268d32cc3e7e56650edcbaf7fb3b59ce
2022-06-22 16:46:02 +00:00
Sameer Agarwal 2335b5b4b7 Remove support for CXSparse
Eigen provides all the functionality that we need from CXSparse
with a more liberal license.

I will update the documentation in a follow up CL.

Change-Id: I0b9fd8be3c27754cc2986cc0e06595c8b3fdec0b
2022-05-27 09:20:21 -07:00
Sameer Agarwal 30b4d5df35 Fix the ceres.bzl to add missing cc files.
Thanks to nate-thirdwave@ for pointing this out and offering
a fix.

Also add a TODO about an odd loop in covariance_impl.cc which was
revealed as I was testing the bazel build

https: //github.com/ceres-solver/ceres-solver/issues/800
Change-Id: I87d17155ee43ea2a52b8031177d6b3ac5ae1460a
2022-05-19 14:07:15 -07:00
Evan Levine f1414cb5bd Correct spelling in comments and docs.
Change-Id: Iad9a0599d644d3b3cd54244edaf64d408cb1308e
2022-04-24 21:40:13 -07:00
Sameer Agarwal 4ad787ce19 Fix the bazel build
Change-Id: I38c684b816b5e377aa873cf35d13b1181aa152db
2022-02-27 07:50:56 -08:00
Sameer Agarwal 0141ca090c Deprecate LocalParameterizations
Add [[deprecate]] notices to everything LocalParameterization
related.

Make sure that Ceres can be compiled without triggering
deprecation warnings.

Update the documentation:

a. Add deprecation notices.
b. Document interaction between LocalParameterization and Manifold
   coexisting in the Problem.
c. Add documentation for Manifold(s)

Change-Id: Ie4ad48963c83fded86e533c8c60561af402fbaff
2022-02-10 06:36:47 -08:00
Sameer Agarwal e6e6ae0878 Unbreak the bazel build
Change-Id: I456f6441ede61d111550a7cc29663091d743d371
2022-01-24 13:16:00 -08:00
Sameer Agarwal d2b7f337ce Remove split.cc from the bazel sources.
Change-Id: I15eb78eaccabb3c00610b3d8bfcb22a6156105df
2021-12-14 11:58:58 -08:00
Sameer Agarwal bf47e1a368 Fix the Bazel build.
1. Fix the path to eigen, now that it uses gitlab instead of bitbucket.
2. Remove an unrecognized compiler option.
3. Remove an obsolete benchmark.

This CL only unbreaks the build, it is likely that it is still not
at par with the cmake build.

https://github.com/ceres-solver/ceres-solver/issues/628

Change-Id: I470209cbb48b6a4f499564a86b52436e0c8d98ef
2020-10-13 10:01:57 -07:00
Alex Stewart 7ef83e0759 Update minimum required C++ version for Ceres to C++14
- Removes all workarounds for pre-C++14 versions
- Removes '11' qualifier from C++ threading option and associated
  defines.
- Fix missing inclusion of 'Multithreading' in reported Ceres components
  when C++ threading model is enabled.
- Update Sphinx documentation to specify C++14 as minimum requirement.

Change-Id: I706c8b367b3221e3c4d1a0aaf669a8f9c911e438
2020-05-30 19:15:03 +01:00
NeroBurner a548766d14 Use glfags target
Update the usage of Google Flags (gflags) library the same way Glog
updated it [1]. This pushes the minimum required gflags version to
v2.2.0.

Remove the ceres specific define of CERES_GFLAGS_NAMESPACE and directly
use GFLAGS_NAMESPACE defined in gflags/gflags_declare.h [2].

In CeresConfig.cmake the hard coded paths for gflags are ommited.
Instead we rely on the gflagsConfig file to get closer to a relocatable
CeresConfig.cmake.
Furthermore use the find_dependency() [4] cmake function specifically
created for cmake-config files.

This change builds upon the explicit PUBLIC/PRIVATE link change [3].

[1] https://github.com/google/glog/pull/199
[2] https://github.com/gflags/gflags/blob/d9b184bd0026b16bb4c2fded75d56fb2cce50d66/src/gflags_declare.h.in#L43
[3] https://ceres-solver-review.googlesource.com/c/ceres-solver/+/16220
[4] https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html

Change-Id: I9861a2699f2702bf1a5e99d07863a7e6639b7c39
2019-12-12 14:00:59 +00:00
Keir Mierle 0f57fa82db Update Bazel WORKSPACE for newest Bazel
The latest Bazel releases have deprecated Bazel-native
"http_archive()" directive in favor of a Skylark version.
This updates the WORKSPACE to use the new format, as well
as removing the Eigen BUILD in favor of a string in the
WORKSPACE.

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

Change-Id: I2f7051316dbe0c1f283423c56b7672ab83a30860
2019-04-16 01:04:59 -07:00
Alex Stewart 16f9b34c3b Remove Intel TBB threading support.
- In light of the C++11 threads threading option this is no longer
  necessary for cross-platform threading support and did not offer a
  noticeable performance gain over either the C++11 threads
  implementation or OpenMP.

Change-Id: Icb588d520888c19a1775171795b55bcaffb3d256
2018-07-03 18:05:36 +00:00
Alex Stewart 8f41ca6abc Add Apple's Accelerate framework as a sparse linear algebra library.
- Currently DynamicSparseNormalCholeskySolver is unsupported for
  Accelerate.

Change-Id: I03b5a86bb22fef249c4aecd48947a613e8eff7a5
2018-06-29 09:43:03 +01:00
Sameer Agarwal d0e06760ec Bring the Bazel build in sync with the CMake build.
1. Remove defines which are not used anymore.
2. Enable CXX11 threading.
3. Enable EIGEN_SPARSE by default.

Change-Id: I841ba517367e6b204475e5255c91313f01a5bcdb
2018-04-09 11:42:43 -07:00
Mike Vitus 5d8b494557 Adds a ParallelFor wrapper for no threads and OpenMP.
With the addition of C++11 support we can simplify the parallel for code by
removing the ifdef branching.  Converts coordinate_descent_minimizer.cc to use
the thread_id ParallelFor API.

Tested by building with OpenMP, C++11 threads, TBB, and no threads.  All tests
pass.

Also compared timing via the bundle adjuster.

./bin/bundle_adjuster --input=../problem-744-543562-pre.txt

With OpenMP num_threads=8

Head:
Time (in seconds):
  Residual only evaluation           0.807753 (5)
  Jacobian & residual evaluation     4.489404 (6)
  Linear solver                     41.826481 (5)
Minimizer                           50.745857
Total                               73.294424

CL:
Time (in seconds):
  Residual only evaluation           0.970483 (5)
  Jacobian & residual evaluation     4.647438 (6)
  Linear solver                     41.781892 (5)
Minimizer                           50.848904
Total                               73.089983

With OpenMP num_threads=1

HEAD:
Time (in seconds):
  Residual only evaluation           2.990246 (5)
  Jacobian & residual evaluation    14.132090 (6)
  Linear solver                     79.631951 (5)
Minimizer                          100.281847
Total                              122.946267

CL:
Time (in seconds):
  Residual only evaluation           3.075178 (5)
  Jacobian & residual evaluation    13.966451 (6)
  Linear solver                     77.005441 (5)
Minimizer                           97.568712
Total                              120.410454

Change-Id: I1857d7943073be7465b6c6476bf46ab11c5475a3
2018-04-09 10:10:03 -07:00
Sameer Agarwal 86814ab193 Add Iterative Refinement
Add a class IterativeRefiner which implements iterative refinement
for SPD linear systems.

Change-Id: I705d4e96cb7de9226ee35e2a9c11d98ffc0ee239
2018-04-06 16:51:14 -07:00
William Rucklidge 21f519d009 Improve threading in covariance.
Covariance computation wants to do a triangular iteration but as a
single loop. Right now it iterates over a square and does nothing half
the time, which is inefficient and has bad worst-case threading
performance. This adds a utility that allows waste-free linear iteration
over a triangle.

Change-Id: I881d5683c65882f87dc2b5f8449a855d22ace755
2018-03-02 13:33:19 -08:00
Mike Vitus 7b2717582a Adds C++11 parallel for implementation.
Implements ParallelFor using the C++11 based ThreadPool.  The C++11
parallel for is 50-70% faster than single threaded, and 20-30% slower
than TBB.

Tested by compiling with OpenMP, TBB, and C++11 Threading support and
ran the unit tests.  Ran bazel as well.

Change-Id: I7fd6c9037ff9f200ce6999b5f39918995bb6b8ea
2018-02-26 16:12:03 -08:00
Mike Vitus f408f89e8b Adds a Ceres Context structure.
A Ceres Context holds common global state that can be re-used within
Ceres.  The Context current contains a thread pool if compiling with
C++11 threading support.  Threads are expensive to create and destroy so
it is good to maintain across multiple Ceres solves.

Tested by compiling with and without TBB support and ran unit tests. Ran
bazel as well.

Change-Id: I82f598dfae642aa0e81a6039dc174608a5e8dbfb
2018-02-26 10:37:53 -08:00
Keir Mierle a3b1e19c2c Add examples to the Bazel build
Also moves the gflags namespace define
into the ceres_library() target.

Change-Id: Ibb8f3fdd9a8c371fe96b475f752f8320ffe63cdc
2018-02-25 14:55:27 -08:00
Mike Vitus 126e0ef0fe Adds missing source and tests to bazel build.
Change 12060 added parallel_for_tbb.cc and parallel_for_test.cc but did not add
it to the bazel build rule.

Tested by running bazel tests.

Change-Id: I286cf0e191e0353f2c0266911a79e01f09e47343
2018-02-22 11:08:50 -08:00
Mike Vitus 27789c0d96 Adds a ThreadPool and a thread-safe ConcurrentQueue.
This is in preparation for adding support for a C++11 based parallel
for implementation. The code is behind CERES_USE_CXX11_THREADS which
is not exposed to the user yet.

Tested by building with and without CERES_USE_CXX11_THREADS defined
and the tests pass.

Change-Id: I60f5730fa055feeb0ee0fa6c980633aebd8d87b4
2018-02-21 15:40:06 -08:00
Sameer Agarwal 9d02b76dce An implementation of SubsetPreconditioner.
The key idea being, use some subset of the rows of the Jacobian
as the preconditioner.

This CL only implements the preconditioner assuming that the row
selection has already been done. How the rows are selected will be
left to the user based on their knowledge of the problem.

A follow up CL will hook this preconditioner into the rest of the
solver.

Change-Id: I3e18dc57811116534e9ddf35d7b154bcce496d3b
2018-02-21 13:58:45 -08:00
Keir Mierle 1af2747421 Support disabling Schur specializations in Bazel build
Change-Id: If72bcd9f19ba4b44482b267e45fb2355b1a93ff0
2018-02-08 13:38:00 -08:00
Rodrigo Queiro c1075cd313 Create ceres_library() and use to provide :ceres
This doesn't add any configurability to ceres_library() yet, but it
does correctly determine the include path for use with -I, allowing
this to be used as a dependency from other workspaces.

Change-Id: I223b6e63c2ea82ab7f552337f78fffd54f20b0e0
2018-01-15 15:28:13 +01:00
Keir Mierle 3f826ef30e Switch Eigen Bazel to a separate file
Change-Id: I547037460e8ec1fa14438d655c10b261daa39d96
2018-01-12 14:09:02 -08:00