diff options
Diffstat (limited to 'extern/ceres/include/ceres/gradient_checker.h')
-rw-r--r-- | extern/ceres/include/ceres/gradient_checker.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/extern/ceres/include/ceres/gradient_checker.h b/extern/ceres/include/ceres/gradient_checker.h index 6d285daf1d9..b79cf86b314 100644 --- a/extern/ceres/include/ceres/gradient_checker.h +++ b/extern/ceres/include/ceres/gradient_checker.h @@ -1,5 +1,5 @@ // Ceres Solver - A fast non-linear least squares minimizer -// Copyright 2015 Google Inc. All rights reserved. +// Copyright 2019 Google Inc. All rights reserved. // http://ceres-solver.org/ // // Redistribution and use in source and binary forms, with or without @@ -34,15 +34,14 @@ #ifndef CERES_PUBLIC_GRADIENT_CHECKER_H_ #define CERES_PUBLIC_GRADIENT_CHECKER_H_ -#include <vector> +#include <memory> #include <string> +#include <vector> #include "ceres/cost_function.h" #include "ceres/dynamic_numeric_diff_cost_function.h" #include "ceres/internal/eigen.h" #include "ceres/internal/fixed_array.h" -#include "ceres/internal/macros.h" -#include "ceres/internal/scoped_ptr.h" #include "ceres/local_parameterization.h" #include "glog/logging.h" @@ -64,13 +63,13 @@ namespace ceres { // // How to use: Fill in an array of pointers to parameter blocks for your // CostFunction, and then call Probe(). Check that the return value is 'true'. -class GradientChecker { +class CERES_EXPORT GradientChecker { public: // This will not take ownership of the cost function or local // parameterizations. // // function: The cost function to probe. - // local_parameterization: A vector of local parameterizations for each + // local_parameterizations: A vector of local parameterizations for each // parameter. May be NULL or contain NULL pointers to indicate that the // respective parameter does not have a local parameterization. // options: Options to use for numerical differentiation. @@ -80,7 +79,7 @@ class GradientChecker { const NumericDiffOptions& options); // Contains results from a call to Probe for later inspection. - struct ProbeResults { + struct CERES_EXPORT ProbeResults { // The return value of the cost function. bool return_value; @@ -100,10 +99,10 @@ class GradientChecker { // Derivatives as computed by the cost function in local space. std::vector<Matrix> local_jacobians; - // Derivatives as computed by nuerical differentiation in local space. + // Derivatives as computed by numerical differentiation in local space. std::vector<Matrix> numeric_jacobians; - // Derivatives as computed by nuerical differentiation in local space. + // Derivatives as computed by numerical differentiation in local space. std::vector<Matrix> local_numeric_jacobians; // Contains the maximum relative error found in the local Jacobians. @@ -137,11 +136,13 @@ class GradientChecker { ProbeResults* results) const; private: - CERES_DISALLOW_IMPLICIT_CONSTRUCTORS(GradientChecker); + GradientChecker() = delete; + GradientChecker(const GradientChecker&) = delete; + void operator=(const GradientChecker&) = delete; std::vector<const LocalParameterization*> local_parameterizations_; const CostFunction* function_; - internal::scoped_ptr<CostFunction> finite_diff_cost_function_; + std::unique_ptr<CostFunction> finite_diff_cost_function_; }; } // namespace ceres |