10ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// Ceres Solver - A fast non-linear least squares minimizer
20ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// Copyright 2010, 2011, 2012 Google Inc. All rights reserved.
30ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// http://code.google.com/p/ceres-solver/
40ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//
50ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// Redistribution and use in source and binary forms, with or without
60ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// modification, are permitted provided that the following conditions are met:
70ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//
80ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// * Redistributions of source code must retain the above copyright notice,
90ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//   this list of conditions and the following disclaimer.
100ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// * Redistributions in binary form must reproduce the above copyright notice,
110ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//   this list of conditions and the following disclaimer in the documentation
120ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//   and/or other materials provided with the distribution.
130ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// * Neither the name of Google Inc. nor the names of its contributors may be
140ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//   used to endorse or promote products derived from this software without
150ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//   specific prior written permission.
160ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//
170ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
180ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
190ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
200ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
210ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
220ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
230ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
240ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
250ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
260ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
270ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// POSSIBILITY OF SUCH DAMAGE.
280ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//
290ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// Author: sameeragarwal@google.com (Sameer Agarwal)
300ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
310ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong#ifndef CERES_INTERNAL_MINIMIZER_H_
320ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong#define CERES_INTERNAL_MINIMIZER_H_
330ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
341d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling#include <string>
350ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong#include <vector>
361d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling#include "ceres/internal/port.h"
370ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong#include "ceres/iteration_callback.h"
381d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling#include "ceres/solver.h"
390ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
400ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongnamespace ceres {
410ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongnamespace internal {
420ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
430ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongclass Evaluator;
440ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongclass LinearSolver;
450ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongclass SparseMatrix;
460ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongclass TrustRegionStrategy;
470ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
480ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// Interface for non-linear least squares solvers.
490ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongclass Minimizer {
500ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong public:
510ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  // Options struct to control the behaviour of the Minimizer. Please
520ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  // see solver.h for detailed information about the meaning and
530ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  // default values of each of these parameters.
540ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  struct Options {
550ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    Options() {
560ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      Init(Solver::Options());
570ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    }
580ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
590ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    explicit Options(const Solver::Options& options) {
600ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      Init(options);
610ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    }
620ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
630ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    void Init(const Solver::Options& options) {
640ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      num_threads = options.num_threads;
650ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      max_num_iterations = options.max_num_iterations;
660ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      max_solver_time_in_seconds = options.max_solver_time_in_seconds;
670ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      max_step_solver_retries = 5;
680ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      gradient_tolerance = options.gradient_tolerance;
690ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      parameter_tolerance = options.parameter_tolerance;
700ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      function_tolerance = options.function_tolerance;
710ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      min_relative_decrease = options.min_relative_decrease;
720ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      eta = options.eta;
730ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      jacobi_scaling = options.jacobi_scaling;
740ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      use_nonmonotonic_steps = options.use_nonmonotonic_steps;
750ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      max_consecutive_nonmonotonic_steps =
760ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong          options.max_consecutive_nonmonotonic_steps;
771d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      trust_region_problem_dump_directory =
781d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.trust_region_problem_dump_directory;
791d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      trust_region_minimizer_iterations_to_dump =
801d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.trust_region_minimizer_iterations_to_dump;
811d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      trust_region_problem_dump_format_type =
821d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.trust_region_problem_dump_format_type;
830ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      max_num_consecutive_invalid_steps =
840ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong          options.max_num_consecutive_invalid_steps;
850ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      min_trust_region_radius = options.min_trust_region_radius;
861d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      line_search_direction_type = options.line_search_direction_type;
871d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      line_search_type = options.line_search_type;
881d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      nonlinear_conjugate_gradient_type =
891d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.nonlinear_conjugate_gradient_type;
901d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      max_lbfgs_rank = options.max_lbfgs_rank;
911d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      use_approximate_eigenvalue_bfgs_scaling =
921d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.use_approximate_eigenvalue_bfgs_scaling;
931d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      line_search_interpolation_type =
941d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.line_search_interpolation_type;
951d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      min_line_search_step_size = options.min_line_search_step_size;
961d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      line_search_sufficient_function_decrease =
971d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.line_search_sufficient_function_decrease;
981d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      max_line_search_step_contraction =
991d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.max_line_search_step_contraction;
1001d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      min_line_search_step_contraction =
1011d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.min_line_search_step_contraction;
1021d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      max_num_line_search_step_size_iterations =
1031d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.max_num_line_search_step_size_iterations;
1041d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      max_num_line_search_direction_restarts =
1051d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.max_num_line_search_direction_restarts;
1061d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      line_search_sufficient_curvature_decrease =
1071d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.line_search_sufficient_curvature_decrease;
1081d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      max_line_search_step_expansion =
1091d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling          options.max_line_search_step_expansion;
11079397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez      is_silent = (options.logging_type == SILENT);
1110ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      evaluator = NULL;
1120ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      trust_region_strategy = NULL;
1130ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      jacobian = NULL;
1140ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      callbacks = options.callbacks;
1150ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong      inner_iteration_minimizer = NULL;
1161d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling      inner_iteration_tolerance = options.inner_iteration_tolerance;
11779397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez      is_constrained = false;
1180ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    }
1190ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1200ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    int max_num_iterations;
1210ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    double max_solver_time_in_seconds;
1221d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    int num_threads;
1230ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1240ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // Number of times the linear solver should be retried in case of
1250ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // numerical failure. The retries are done by exponentially scaling up
1260ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // mu at each retry. This leads to stronger and stronger
1270ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // regularization making the linear least squares problem better
1280ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // conditioned at each retry.
1290ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    int max_step_solver_retries;
1300ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    double gradient_tolerance;
1310ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    double parameter_tolerance;
1320ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    double function_tolerance;
1330ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    double min_relative_decrease;
1340ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    double eta;
1350ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    bool jacobi_scaling;
1360ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    bool use_nonmonotonic_steps;
1370ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    int max_consecutive_nonmonotonic_steps;
1381d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    vector<int> trust_region_minimizer_iterations_to_dump;
1391d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    DumpFormatType trust_region_problem_dump_format_type;
1401d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    string trust_region_problem_dump_directory;
1410ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    int max_num_consecutive_invalid_steps;
1421d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double min_trust_region_radius;
1431d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    LineSearchDirectionType line_search_direction_type;
1441d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    LineSearchType line_search_type;
1451d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    NonlinearConjugateGradientType nonlinear_conjugate_gradient_type;
1461d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    int max_lbfgs_rank;
1471d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    bool use_approximate_eigenvalue_bfgs_scaling;
1481d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    LineSearchInterpolationType line_search_interpolation_type;
1491d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double min_line_search_step_size;
1501d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double line_search_sufficient_function_decrease;
1511d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double max_line_search_step_contraction;
1521d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double min_line_search_step_contraction;
1531d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    int max_num_line_search_step_size_iterations;
1541d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    int max_num_line_search_direction_restarts;
1551d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double line_search_sufficient_curvature_decrease;
1561d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double max_line_search_step_expansion;
1571d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling
15879397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez    // If true, then all logging is disabled.
15979397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez    bool is_silent;
1600ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1610ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // List of callbacks that are executed by the Minimizer at the end
1620ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // of each iteration.
1630ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    //
1640ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // The Options struct does not own these pointers.
1650ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    vector<IterationCallback*> callbacks;
1660ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1670ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // Object responsible for evaluating the cost, residuals and
1680ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // Jacobian matrix. The Options struct does not own this pointer.
1690ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    Evaluator* evaluator;
1700ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1710ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // Object responsible for actually computing the trust region
1720ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // step, and sizing the trust region radius. The Options struct
1730ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // does not own this pointer.
1740ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    TrustRegionStrategy* trust_region_strategy;
1750ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1760ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // Object holding the Jacobian matrix. It is assumed that the
1770ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // sparsity structure of the matrix has already been initialized
1780ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // and will remain constant for the life time of the
1790ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    // optimization. The Options struct does not own this pointer.
1800ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    SparseMatrix* jacobian;
1810ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1820ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong    Minimizer* inner_iteration_minimizer;
1831d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling    double inner_iteration_tolerance;
18479397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez
18579397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez    // Use a bounds constrained optimization algorithm.
18679397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez    bool is_constrained;
1870ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  };
1880ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
18979397c21138f54fcff6ec067b44b847f1f7e0e98Carlos Hernandez  static bool RunCallbacks(const Options& options,
1901d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling                           const IterationSummary& iteration_summary,
1911d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling                           Solver::Summary* summary);
1920ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
1931d2624a10e2c559f8ba9ef89eaa30832c0a83a96Sascha Haeberling  virtual ~Minimizer();
1940ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  // Note: The minimizer is expected to update the state of the
1950ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  // parameters array every iteration. This is required for the
1960ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  // StateUpdatingCallback to work.
1970ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong  virtual void Minimize(const Options& options,
1980ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong                        double* parameters,
1990ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong                        Solver::Summary* summary) = 0;
2000ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong};
2010ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
2020ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong}  // namespace internal
2030ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong}  // namespace ceres
2040ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong
2050ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong#endif  // CERES_INTERNAL_MINIMIZER_H_
206