Deprecate macros.h and fpclassify.h

1. Replace CERES_DISALLOW_* with explicitly deleted constructors.
2. Replace use of CERES_ARRAY_SIZE and stack allocated arrays
   with std::vector.
3. Move CERES_ALIGN_* macros into manual_constructor.h, which is
   the one place they are used and will be deprecated along with that
   file.
4. Introduce isnan,isnormal,isinf and isfinite for Jets.
5. Replace IsNormal,IsFinite,IsNaN and IsInfinite with corresponding
   c++11 function calls.

Change-Id: I04f33a221aae77d247602150988b6d4aa4efeeab
This commit is contained in:
Sameer Agarwal
2018-04-12 20:44:56 -07:00
parent 58c5edae2f
commit 31f24521cc
42 changed files with 141 additions and 337 deletions
+5 -3
View File
@@ -77,7 +77,6 @@
#include <memory>
#include "glog/logging.h"
#include "ceres/internal/macros.h"
#include "ceres/types.h"
#include "ceres/internal/disable_warnings.h"
@@ -331,6 +330,8 @@ class CERES_EXPORT ScaledLoss : public LossFunction {
// ownership parameter.
ScaledLoss(const LossFunction* rho, double a, Ownership ownership) :
rho_(rho), a_(a), ownership_(ownership) { }
ScaledLoss(const ScaledLoss&) = delete;
void operator=(const ScaledLoss&) = delete;
virtual ~ScaledLoss() {
if (ownership_ == DO_NOT_TAKE_OWNERSHIP) {
@@ -343,7 +344,6 @@ class CERES_EXPORT ScaledLoss : public LossFunction {
std::unique_ptr<const LossFunction> rho_;
const double a_;
const Ownership ownership_;
CERES_DISALLOW_COPY_AND_ASSIGN(ScaledLoss);
};
// Sometimes after the optimization problem has been constructed, we
@@ -390,6 +390,9 @@ class CERES_EXPORT LossFunctionWrapper : public LossFunction {
: rho_(rho), ownership_(ownership) {
}
LossFunctionWrapper(const LossFunctionWrapper&) = delete;
void operator=(const LossFunctionWrapper&) = delete;
virtual ~LossFunctionWrapper() {
if (ownership_ == DO_NOT_TAKE_OWNERSHIP) {
rho_.release();
@@ -418,7 +421,6 @@ class CERES_EXPORT LossFunctionWrapper : public LossFunction {
private:
std::unique_ptr<const LossFunction> rho_;
Ownership ownership_;
CERES_DISALLOW_COPY_AND_ASSIGN(LossFunctionWrapper);
};
} // namespace ceres