mexopencv
3.4.1
MEX interface for OpenCV library
|
Represents objective function being optimized, implemented as a MATLAB file. More...
Public Member Functions | |
MatlabFunction (int num_dims, const string &func, const string &grad_func="", double h=1e-3) | |
Constructor. More... | |
double | calc (const double *x) const |
Evaluates MATLAB objective function. More... | |
void | getGradient (const double *x, double *grad) |
Evaluates MATLAB gradient function. More... | |
double | getGradientEps () const |
Gradient epsilon. More... | |
int | getDims () const |
Return number of dimensions. More... | |
MxArray | toStruct () const |
Convert object to MxArray. More... | |
Public Member Functions inherited from cv::MinProblemSolver::Function | |
virtual | ~Function () |
Static Public Member Functions | |
static Ptr< MatlabFunction > | create (const MxArray &s) |
Factory function. More... | |
Represents objective function being optimized, implemented as a MATLAB file.
Definition at line 20 of file ConjGradSolver_.cpp.
|
inline |
Constructor.
num_dims | number of variables of the objective function |
func | name of an M-file that computes the objective function |
grad_func | name of an M-file that computes the gradient of the objective function. Can be empty. |
h | gradient epsilon |
Definition at line 30 of file ConjGradSolver_.cpp.
|
inlinevirtual |
Evaluates MATLAB objective function.
[in] | x | input array of length dims |
x
(scalar value)Calculates y = F(x)
, for the scalar-valued multivariate objective function evaluated at the dims
-dimensional point x
Example:
Implements cv::MinProblemSolver::Function.
Definition at line 50 of file ConjGradSolver_.cpp.
|
inlinestatic |
Factory function.
s | input MxArray structure with the following fields:
|
Definition at line 166 of file ConjGradSolver_.cpp.
|
inlinevirtual |
Return number of dimensions.
Implements cv::MinProblemSolver::Function.
Definition at line 140 of file ConjGradSolver_.cpp.
|
inlinevirtual |
Evaluates MATLAB gradient function.
[in] | x | input array of length dims |
[out] | grad | output array of length dims |
Evaluates gradient of multivariate function at the specified point, by computing grad = del F(x)
, where grad_i = dF/dx_i
for i=1:dims
(partial derivatives w.r.t each dimension).
Example:
Reimplemented from cv::MinProblemSolver::Function.
Definition at line 95 of file ConjGradSolver_.cpp.
|
inlinevirtual |
Gradient epsilon.
Reimplemented from cv::MinProblemSolver::Function.
Definition at line 132 of file ConjGradSolver_.cpp.
|
inline |
Convert object to MxArray.
Definition at line 148 of file ConjGradSolver_.cpp.