13 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
Sergiu Deitsch 91773746be Simplify instantiation of cost functions and their functors
If arguments are passed to a cost function that can be used to construct
the functor, the latter will be instantiated by the cost function using
std::make_unique to ensure exception safety. This not only avoids static
analysis warnings caused by calling new but also spelling the cost
functor type name multiple times.

Also expand deduction guides for instantiating
Dynamic(Auto|Numeric)DiffCostFunction from std::unique_ptr enabled
constructor overloads.

Finally, make CostFunction default move constructible and assignable but
only through derived classes. This in turn allows derived classes to be
movable without relying on custom implementations of corresponding
operators.

Change-Id: Idee8b9871d862bc9f9f8b5a8d0bedc52863e93c0
2024-01-23 01:34:27 +01:00
Sameer Agarwal 399395c4f1 Miscellaneous ClangTidy fixes
Change-Id: Iba2f8b1dccb77cefde750e5079e609b2b2a3ec95
2023-10-03 11:52:09 -07:00
Sameer Agarwal 3712650941 Cleanup example code
Remove "using ceres:foo" directives from example code. The using
directives actually make the code harder to read unless you already
know the ceres API. By making the namespace explicit it is clear
to the reader that these are functions and objects from the Ceres
API.

Change-Id: I89b1281c754bf71c0f82e39e1607c5e40a148388
2023-09-27 14:46:54 -07: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
Sergiu Deitsch 09ec4997fa Cleanup examples
Remove logic invoked based on obsolete variable definitions. Use new
(explicit) target_link_libraries syntax to link binaries against
dependencies. Do not rely on prior knowledge about the compiler for
specifying flags and system libraries but instead directly test their
presence to be more robust.

Change-Id: I76e0d10fae6eba4b343048e4404f0a9b08c7cb6c
2022-02-18 00:53:44 +01:00
Sameer Agarwal ae65219e04 ClangTidy cleanups
1. NULL -> nullptr
2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>()
3. Missing std library includes & prefixes

Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
2022-02-09 10:06:49 -08: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
Nikolaus Demmel 7b6b2491cc fix formatting for examples
This is mostly just applying the existing clang format config, except:
- Use NOLINT on overlong comment lines.
- Wrap some sections in 'clang-format off' / 'clang format on'.
- Manually split or join some multi-line strings.

Change-Id: Ia1a40eeb92112e12c3a169309afe087af55b2f4f
2020-09-08 17:56:39 +02:00
Alex Stewart b70687fcc8 Add namespace qualified Ceres::ceres CMake target
- This reflects modern CMake style, and also provides a measure of
  protection against missing find_package() imports in downstream
  clients resulting in linker errors when 'ceres' matches the compiled
  library and not the imported target.
- The original 'ceres' target remains, as a local imported interface
  target created by CeresConfig for backwards compatibility.

Change-Id: Ie9ed8de9b7059bc0cae1ae5002bb94d8fe617188
2020-05-25 17:16:27 +00:00
huangqinjin 21d40daa00 Remove UTF-8 chars
Change-Id: I1e98dd7441d2de05e0b3b0937e496103177631f8
2019-03-03 18:53:13 +00:00
Mike Vitus 16980b4fec Delete the remove_definitons command from sampled_functions
CMakeLists.txt because it will be inherited from the top level examples
CMakeLists.txt.

Change-Id: I25593587df0ae84fd8ddddc589bc2a13f3777427
2016-07-15 13:44:56 -07:00
Mike Vitus a04490be97 Add readme for the sampled_function example.
Change-Id: I9468b6a7b9f2ffdd2bf9f0dd1f4e1d5f894e540c
2016-07-14 17:06:38 -07:00