Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/libmv/third_party/ceres/internal/ceres/minimizer.h')
-rw-r--r--extern/libmv/third_party/ceres/internal/ceres/minimizer.h35
1 files changed, 16 insertions, 19 deletions
diff --git a/extern/libmv/third_party/ceres/internal/ceres/minimizer.h b/extern/libmv/third_party/ceres/internal/ceres/minimizer.h
index f1da3f704fa..dabf07e583a 100644
--- a/extern/libmv/third_party/ceres/internal/ceres/minimizer.h
+++ b/extern/libmv/third_party/ceres/internal/ceres/minimizer.h
@@ -41,9 +41,10 @@ namespace ceres {
namespace internal {
class Evaluator;
-class LinearSolver;
class SparseMatrix;
class TrustRegionStrategy;
+class CoordinateDescentMinimizer;
+class LinearSolver;
// Interface for non-linear least squares solvers.
class Minimizer {
@@ -107,14 +108,10 @@ class Minimizer {
options.line_search_sufficient_curvature_decrease;
max_line_search_step_expansion =
options.max_line_search_step_expansion;
- is_silent = (options.logging_type == SILENT);
- evaluator = NULL;
- trust_region_strategy = NULL;
- jacobian = NULL;
- callbacks = options.callbacks;
- inner_iteration_minimizer = NULL;
inner_iteration_tolerance = options.inner_iteration_tolerance;
+ is_silent = (options.logging_type == SILENT);
is_constrained = false;
+ callbacks = options.callbacks;
}
int max_num_iterations;
@@ -154,10 +151,14 @@ class Minimizer {
int max_num_line_search_direction_restarts;
double line_search_sufficient_curvature_decrease;
double max_line_search_step_expansion;
+ double inner_iteration_tolerance;
// If true, then all logging is disabled.
bool is_silent;
+ // Use a bounds constrained optimization algorithm.
+ bool is_constrained;
+
// List of callbacks that are executed by the Minimizer at the end
// of each iteration.
//
@@ -165,27 +166,23 @@ class Minimizer {
vector<IterationCallback*> callbacks;
// Object responsible for evaluating the cost, residuals and
- // Jacobian matrix. The Options struct does not own this pointer.
- Evaluator* evaluator;
+ // Jacobian matrix.
+ shared_ptr<Evaluator> evaluator;
// Object responsible for actually computing the trust region
- // step, and sizing the trust region radius. The Options struct
- // does not own this pointer.
- TrustRegionStrategy* trust_region_strategy;
+ // step, and sizing the trust region radius.
+ shared_ptr<TrustRegionStrategy> trust_region_strategy;
// Object holding the Jacobian matrix. It is assumed that the
// sparsity structure of the matrix has already been initialized
// and will remain constant for the life time of the
- // optimization. The Options struct does not own this pointer.
- SparseMatrix* jacobian;
+ // optimization.
+ shared_ptr<SparseMatrix> jacobian;
- Minimizer* inner_iteration_minimizer;
- double inner_iteration_tolerance;
-
- // Use a bounds constrained optimization algorithm.
- bool is_constrained;
+ shared_ptr<CoordinateDescentMinimizer> inner_iteration_minimizer;
};
+ static Minimizer* Create(MinimizerType minimizer_type);
static bool RunCallbacks(const Options& options,
const IterationSummary& iteration_summary,
Solver::Summary* summary);