42 #ifndef OPENCV_OPTIM_HPP
43 #define OPENCV_OPTIM_HPP
45 #include "opencv2/core.hpp"
69 virtual double calc(
const double*
x)
const = 0;
This is a base class for all more or less complex algorithms in OpenCV.
Definition: core.hpp:3197
This class is used to perform the non-linear non-constrained minimization of a function with known gr...
Definition: optim.hpp:237
static Ptr< ConjGradSolver > create(const Ptr< MinProblemSolver::Function > &f=Ptr< ConjGradSolver::Function >(), TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS, 5000, 0.000001))
This function returns the reference to the ready-to-use ConjGradSolver object.
This class is used to perform the non-linear non-constrained minimization of a function,...
Definition: optim.hpp:156
virtual void getInitStep(OutputArray step) const =0
Returns the initial step that will be used in downhill simplex algorithm.
static Ptr< DownhillSolver > create(const Ptr< MinProblemSolver::Function > &f=Ptr< MinProblemSolver::Function >(), InputArray initStep=Mat_< double >(1, 1, 0.0), TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS, 5000, 0.000001))
This function returns the reference to the ready-to-use DownhillSolver object.
virtual void setInitStep(InputArray step)=0
Sets the initial step that will be used in downhill simplex algorithm.
Template matrix class derived from Mat.
Definition: mat.hpp:2230
Represents function being optimized.
Definition: optim.hpp:64
virtual void getGradient(const double *x, double *grad)
virtual double calc(const double *x) const =0
virtual ~Function()
Definition: optim.hpp:66
virtual double getGradientEps() const
virtual int getDims() const =0
Basic interface for all solvers.
Definition: optim.hpp:59
virtual void setFunction(const Ptr< Function > &f)=0
Setter for the optimized function.
virtual Ptr< Function > getFunction() const =0
Getter for the optimized function.
virtual TermCriteria getTermCriteria() const =0
Getter for the previously set terminal criteria for this algorithm.
virtual void setTermCriteria(const TermCriteria &termcrit)=0
Set terminal criteria for solver.
virtual double minimize(InputOutputArray x)=0
actually runs the algorithm and performs the minimization.
The class defining termination criteria for iterative algorithms.
Definition: types.hpp:886
@ MAX_ITER
ditto
Definition: types.hpp:894
@ EPS
the desired accuracy or change in parameters at which the iterative algorithm stops
Definition: types.hpp:895
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:296
CV__DEBUG_NS_END typedef const _InputArray & InputArray
Definition: mat.hpp:442
void int step
Definition: core_c.h:905
const CvArr CvArr * x
Definition: core_c.h:1195
int CvArr CvTermCriteria termcrit
Definition: core_c.h:1927
CV_EXPORTS_W int solveLP(InputArray Func, InputArray Constr, OutputArray z, double constr_eps)
Solve given (non-integer) linear programming problem using the Simplex Algorithm (Simplex Method).
SolveLPResult
return codes for cv::solveLP() function
Definition: optim.hpp:258
@ SOLVELP_SINGLE
there is only one maximum for target function
Definition: optim.hpp:262
@ SOLVELP_UNBOUNDED
problem is unbounded (target function can achieve arbitrary high values)
Definition: optim.hpp:260
@ SOLVELP_LOST
problem is feasible, but solver lost solution due to floating-point arithmetic errors
Definition: optim.hpp:259
@ SOLVELP_MULTI
there are multiple maxima for target function - the arbitrary one is returned
Definition: optim.hpp:263
@ SOLVELP_UNFEASIBLE
problem is unfeasible (there are no points that satisfy all the constraints imposed)
Definition: optim.hpp:261
#define CV_EXPORTS
Definition: cvdef.h:435
#define CV_EXPORTS_W
Definition: cvdef.h:472
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
Definition: cvstd_wrapper.hpp:74