#include <vnl_cost_function.h>
Inheritance diagram for vnl_cost_function:

It is commonly used to express the interface of a minimizer.
Definition at line 27 of file vnl_cost_function.h.
Public Member Functions | |
| vnl_cost_function () | |
| Default constructor. | |
| vnl_cost_function (int number_of_unknowns) | |
| Construct with a specified number of unknowns. | |
| virtual | ~vnl_cost_function () |
| virtual double | f (vnl_vector< double > const &x) |
| The main function. Given the parameter vector x, compute the value of f(x). | |
| virtual void | gradf (vnl_vector< double > const &x, vnl_vector< double > &gradient) |
| Calculate the gradient of f at parameter vector x. | |
| virtual void | compute (vnl_vector< double > const &x, double *f, vnl_vector< double > *g) |
| Compute one or both of f and g. | |
| int | get_number_of_unknowns () const |
| Return the number of unknowns. | |
| void | fdgradf (vnl_vector< double > const &x, vnl_vector< double > &gradient, double stepsize=1e-5) |
| Compute finite-difference gradient. | |
| virtual double | reported_error (double f_value) |
| Called when error is printed for user. | |
| vnl_vector< double > | gradf (vnl_vector< double > const &x) |
| Conveniences for printing grad, fdgrad. | |
| vnl_vector< double > | fdgradf (vnl_vector< double > const &x) |
| virtual double | get_range_min () const |
| Return bounding cube of range (outputs). | |
| virtual double | get_range_max () const |
| virtual vnl_unary_function< double, vnl_vector< double > > * | Copy () const |
| Copy should allocate a copy of this on the heap and return it. | |
Public Attributes | |
| int | dim |
Protected Member Functions | |
| void | set_number_of_unknowns (int number_of_unknowns) |
| Set number of unknowns. | |
| vnl_cost_function::vnl_cost_function | ( | ) | [inline] |
| vnl_cost_function::vnl_cost_function | ( | int | number_of_unknowns | ) | [inline] |
| virtual vnl_cost_function::~vnl_cost_function | ( | ) | [inline, virtual] |
Definition at line 37 of file vnl_cost_function.h.
| double vnl_cost_function::f | ( | vnl_vector< double > const & | x | ) | [virtual] |
The main function. Given the parameter vector x, compute the value of f(x).
..
Implements vnl_unary_function< double, vnl_vector< double > >.
Reimplemented in vnl_amoeba_LSCF, vnl_powell_1dfun, and vnl_least_squares_cost_function.
Definition at line 23 of file vnl_cost_function.cxx.
| void vnl_cost_function::gradf | ( | vnl_vector< double > const & | x, | |
| vnl_vector< double > & | gradient | |||
| ) | [virtual] |
Calculate the gradient of f at parameter vector x.
Reimplemented in vnl_least_squares_cost_function.
Definition at line 36 of file vnl_cost_function.cxx.
| void vnl_cost_function::compute | ( | vnl_vector< double > const & | x, | |
| double * | f, | |||
| vnl_vector< double > * | g | |||
| ) | [virtual] |
Compute one or both of f and g.
Normally implemented in terms of the above two, but may be faster if specialized. f != 0 => compute f
Definition at line 16 of file vnl_cost_function.cxx.
| int vnl_cost_function::get_number_of_unknowns | ( | ) | const [inline] |
| void vnl_cost_function::fdgradf | ( | vnl_vector< double > const & | x, | |
| vnl_vector< double > & | gradient, | |||
| double | stepsize = 1e-5 | |||
| ) |
| virtual double vnl_cost_function::reported_error | ( | double | f_value | ) | [inline, virtual] |
| vnl_vector< double > vnl_cost_function::gradf | ( | vnl_vector< double > const & | x | ) |
| vnl_vector< double > vnl_cost_function::fdgradf | ( | vnl_vector< double > const & | x | ) |
Definition at line 74 of file vnl_cost_function.cxx.
| void vnl_cost_function::set_number_of_unknowns | ( | int | number_of_unknowns | ) | [inline, protected] |
| virtual double vnl_unary_function< double , vnl_vector< double > >::get_range_min | ( | ) | const [virtual, inherited] |
Return bounding cube of range (outputs).
| virtual double vnl_unary_function< double , vnl_vector< double > >::get_range_max | ( | ) | const [virtual, inherited] |
Return bounding cube of range (outputs).
| virtual vnl_unary_function<double , vnl_vector< double > >* vnl_unary_function< double , vnl_vector< double > >::Copy | ( | ) | const [inline, virtual, inherited] |
Copy should allocate a copy of this on the heap and return it.
If Subclasses do not implement this function, it will return null, but many applications will never call it, so this may not be a problem for you.
Definition at line 46 of file vnl_unary_function.h.
Definition at line 68 of file vnl_cost_function.h.
1.5.1