123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- #ifndef CERES_INTERNAL_TRUST_REGION_MINIMIZER_H_
- #define CERES_INTERNAL_TRUST_REGION_MINIMIZER_H_
- #include <memory>
- #include "ceres/internal/disable_warnings.h"
- #include "ceres/internal/eigen.h"
- #include "ceres/internal/export.h"
- #include "ceres/minimizer.h"
- #include "ceres/solver.h"
- #include "ceres/sparse_matrix.h"
- #include "ceres/trust_region_step_evaluator.h"
- #include "ceres/trust_region_strategy.h"
- #include "ceres/types.h"
- namespace ceres::internal {
- class CERES_NO_EXPORT TrustRegionMinimizer final : public Minimizer {
- public:
-
- void Minimize(const Minimizer::Options& options,
- double* parameters,
- Solver::Summary* solver_summary) override;
- private:
- void Init(const Minimizer::Options& options,
- double* parameters,
- Solver::Summary* solver_summary);
- bool IterationZero();
- bool FinalizeIterationAndCheckIfMinimizerCanContinue();
- bool ComputeTrustRegionStep();
- bool EvaluateGradientAndJacobian(bool new_evaluation_point);
- void ComputeCandidatePointAndEvaluateCost();
- void DoLineSearch(const Vector& x,
- const Vector& gradient,
- const double cost,
- Vector* delta);
- void DoInnerIterationsIfNeeded();
- bool ParameterToleranceReached();
- bool FunctionToleranceReached();
- bool GradientToleranceReached();
- bool MaxSolverTimeReached();
- bool MaxSolverIterationsReached();
- bool MinTrustRegionRadiusReached();
- bool IsStepSuccessful();
- bool HandleSuccessfulStep();
- bool HandleInvalidStep();
- Minimizer::Options options_;
-
-
- double* parameters_;
- Solver::Summary* solver_summary_;
- Evaluator* evaluator_;
- SparseMatrix* jacobian_;
- TrustRegionStrategy* strategy_;
- std::unique_ptr<TrustRegionStepEvaluator> step_evaluator_;
- bool is_not_silent_;
- bool inner_iterations_are_enabled_;
- bool inner_iterations_were_useful_;
-
- IterationSummary iteration_summary_;
-
- int num_parameters_;
-
-
- int num_effective_parameters_;
-
- int num_residuals_;
-
- Vector x_;
-
- Vector residuals_;
-
- Vector gradient_;
-
- Vector inner_iteration_x_;
-
- Vector model_residuals_;
- Vector negative_gradient_;
-
-
- Vector projected_gradient_step_;
-
-
- Vector trust_region_step_;
-
-
-
-
-
- Vector delta_;
-
- Vector candidate_x_;
-
- Vector jacobian_scaling_;
-
- double x_cost_;
-
- double minimum_cost_;
-
-
- double model_cost_change_;
-
- double candidate_cost_;
-
- double start_time_in_secs_;
-
- double iteration_start_time_in_secs_;
-
-
- int num_consecutive_invalid_steps_;
- };
- }
- #include "ceres/internal/reenable_warnings.h"
- #endif
|