Ceres 源码阅读之 TrustRegionMinimizer::Minimize 函数简析

文章目录

  • Part.I Introduction
  • Part.II 源码剖析
    • Chap.I TrustRegionMinimizer 类介绍
    • Chap.II Minimize 函数介绍

Part.I Introduction

Ceres 中求解优化问题的迭代求解方法(minimizer_type)有线性搜索方法(LINEAR_SEARCH)、信赖域方法(TRUST_REGION)等,其中TRUST_REGION 是其默认选项,平时使用比较多,因此本文对TRUST_REGION方法的源码进行简单的剖析,其实主要是对其中的Minimize函数进行解析。

Part.II 源码剖析

首先,所涉及的文件有

  • internal/ceres/solver.cc
  • internal/ceres/trust_region_minimizer.h
  • internal/ceres/trust_region_minimizer.cc

Chap.I TrustRegionMinimizer 类介绍

TrustRegionMinimizer 继承自Minimizer类,Minimizer类是一个基类。

类中的成员变量:

  Minimizer::Options options_;

  // These pointers are shortcuts to objects passed to the
  // TrustRegionMinimizer. The TrustRegionMinimizer does not own them.
  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_;

  // Summary of the current iteration.
  IterationSummary iteration_summary_;

  // Dimensionality of the problem in the ambient space.
  int num_parameters_;
  // Dimensionality of the problem in the tangent space. This is the
  // number of columns in the Jacobian.
  int num_effective_parameters_;
  // Length of the residual vector, also the number of rows in the Jacobian.
  int num_residuals_;

  // Current point.
  Vector x_;
  // Residuals at x_;
  Vector residuals_;
  // Gradient at x_.
  Vector gradient_;
  

你可能感兴趣的:(#,C++,前端,人工智能,算法)