Commit Graph

13 Commits

Author SHA1 Message Date
Sergiu Deitsch c14f360e63 Drop trivial special members
Do not define trivial constructors or destructors unless necessary
(e.g., for implementing pimpl) following the rule of zero. Define
virtual base class destructors out-of-line to avoid emitting vtables in
every translation unit.

Change-Id: Iea2d8978e62a8ee5a97b86cbb4e858d56e0fb274
2022-02-09 21:30:14 +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
Sameer Agarwal 57cf20aa5d static const -> static constexpr where we can.
Change-Id: I8a6d26a89c4377dd440fa6dcf23513b7556533fc
2020-04-21 10:13:27 -07:00
Enrique Fernandez 6da364713f Fix Tukey loss function
Since the output of LossFunction::Evaluate is multiplied by 0.5, the
current implementation of the Tukey loss function must be multiplied
by 2.

Change-Id: Ia94753eef1a375fe48cc2e0d2cc61350904c8248
2020-03-17 19:42:03 +00:00
Sameer Agarwal 94712db5c7 Convert calls to CHECK_NOTNULL to CHECK.
CHECK_NOTNULL is being deprecated and removed from the
glog library.

Change-Id: I4a6d1eec6e82a768c7861c8f776bf1f9c0b50c74
2018-08-28 08:14:19 -07:00
Sameer Agarwal 8202edcbb4 Add missing <algorithm> headers.
Thanks to kea@google.com for reporting this.

Change-Id: I9bde5823e9ea89451f476694c9b860080dffdf17
2018-04-05 11:53:48 -07: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
Mike Vitus 7c0ac8f995 Add Tukey loss function.
Change-Id: I7c76f13e01863440fc207e99b3fc7ad3fb6f7d1a
2014-11-13 15:29:37 -08:00
Alex Stewart 54893ba523 Add missing #include of <limits> for loss functions.
Change-Id: Id632451429e03031a1533a9be795270debc70706
2014-08-11 19:04:18 +01:00
Sameer Agarwal 1b17145adf Make canned loss functions more robust.
The loss functions that ship with ceres can sometimes
generate a zero first derivative if the residual is too
large.

In such cases Corrector fails with an ugly undebuggable
crash. This CL is the first in a series of fixes to
take care of this.

We clamp the values of rho' from below by
numeric_limits<double>::min().

Also included here is some minor cleanup where the constants
are treated as doubles rather than integers.

Thanks to Pierre Moulon for reporting this problem.

Change-Id: I3aaf375303ecc2659bbf6fb56a812e7dc3a41106
2014-07-30 10:14:15 -07:00
Sameer Agarwal ad1f7b772e Add ArcTanLoss, TolerantLoss and ComposedLossFunction.
Based on work by James Roseborough.

Change-Id: Idc4e0b099028f67702bfc7fe3e43dbd96b6f9256
2012-08-20 11:11:02 -07:00
Keir Mierle 8ebb073038 Initial commit of Ceres Solver. 2012-04-30 23:09:08 -07:00