Public Member Functions | Public Attributes | Protected Member Functions | List of all members
vnl_powell_1dfun Class Reference
Inheritance diagram for vnl_powell_1dfun:
Inheritance graph
[legend]

Public Member Functions

 vnl_powell_1dfun (int n, vnl_cost_function *func, vnl_powell *p)
 
void init (vnl_vector< double > const &x0, vnl_vector< double > const &dx)
 
double f (const vnl_vector< double > &x) override
 Apply the function. More...
 
void uninit (double lambda, vnl_vector< double > &out)
 
virtual void gradf (vnl_vector< double > const &x, vnl_vector< double > &gradient)
 Calculate the gradient of f at parameter vector x. More...
 
vnl_vector< double > gradf (vnl_vector< double > const &x)
 Conveniences for printing grad, fdgrad. More...
 
virtual void compute (vnl_vector< double > const &x, double *f, vnl_vector< double > *g)
 Compute one or both of f and g. More...
 
int get_number_of_unknowns () const
 Return the number of unknowns. More...
 
void fdgradf (vnl_vector< double > const &x, vnl_vector< double > &gradient, double stepsize=1e-5)
 Compute finite-difference gradient. More...
 
vnl_vector< double > fdgradf (vnl_vector< double > const &x)
 
virtual double reported_error (double f_value)
 Called when error is printed for user. More...
 
virtual double get_range_min () const
 Return bounding cube of range (outputs). More...
 
virtual double get_range_max () const
 Return bounding cube of range (outputs). More...
 
virtual vnl_unary_function< double, vnl_vector< double > > * Copy () const
 Copy should allocate a copy of this on the heap and return it. More...
 

Public Attributes

vnl_powellpowell_
 
vnl_cost_functionf_
 
unsigned int n_
 
vnl_vector< double > x0_
 
vnl_vector< double > dx_
 
vnl_vector< double > tmpx_
 
int dim
 

Protected Member Functions

void set_number_of_unknowns (int number_of_unknowns)
 Set number of unknowns. More...
 

Detailed Description

Definition at line 24 of file vnl_powell.cxx.

Constructor & Destructor Documentation

◆ vnl_powell_1dfun()

vnl_powell_1dfun::vnl_powell_1dfun ( int  n,
vnl_cost_function func,
vnl_powell p 
)
inline

Definition at line 33 of file vnl_powell.cxx.

Member Function Documentation

◆ compute()

void vnl_cost_function::compute ( vnl_vector< double > const &  x,
double *  f,
vnl_vector< double > *  g 
)
virtualinherited

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 13 of file vnl_cost_function.cxx.

◆ Copy()

virtual vnl_unary_function<double , vnl_vector< double > >* vnl_unary_function< double , vnl_vector< double > >::Copy ( ) const
inlinevirtualinherited

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 44 of file vnl_unary_function.h.

◆ f()

double vnl_powell_1dfun::f ( const vnl_vector< double > &  i)
inlineoverridevirtual

Apply the function.

The name is "f" rather than operator(), as the function will generally be called through a pointer. Note that the function is NOT const when you subclass.

Implements vnl_unary_function< double, vnl_vector< double > >.

Definition at line 44 of file vnl_powell.cxx.

◆ fdgradf() [1/2]

void vnl_cost_function::fdgradf ( vnl_vector< double > const &  x,
vnl_vector< double > &  gradient,
double  stepsize = 1e-5 
)
inherited

Compute finite-difference gradient.

Compute fd gradient.

Definition at line 43 of file vnl_cost_function.cxx.

◆ fdgradf() [2/2]

vnl_vector< double > vnl_cost_function::fdgradf ( vnl_vector< double > const &  x)
inherited

Definition at line 70 of file vnl_cost_function.cxx.

◆ get_number_of_unknowns()

int vnl_cost_function::get_number_of_unknowns ( ) const
inlineinherited

Return the number of unknowns.

Definition at line 48 of file vnl_cost_function.h.

◆ get_range_max()

RETURN vnl_unary_function< RETURN, ARGUMENT >::get_range_max ( ) const
virtualinherited

Return bounding cube of range (outputs).

Definition at line 36 of file vnl_unary_function.hxx.

◆ get_range_min()

RETURN vnl_unary_function< RETURN, ARGUMENT >::get_range_min ( ) const
virtualinherited

Return bounding cube of range (outputs).

Definition at line 29 of file vnl_unary_function.hxx.

◆ gradf() [1/2]

void vnl_cost_function::gradf ( vnl_vector< double > const &  x,
vnl_vector< double > &  gradient 
)
virtualinherited

Calculate the gradient of f at parameter vector x.

Default implementation of gradf is to call compute.

Reimplemented in vnl_least_squares_cost_function.

Definition at line 33 of file vnl_cost_function.cxx.

◆ gradf() [2/2]

vnl_vector< double > vnl_cost_function::gradf ( vnl_vector< double > const &  x)
inherited

Conveniences for printing grad, fdgrad.

Definition at line 63 of file vnl_cost_function.cxx.

◆ init()

void vnl_powell_1dfun::init ( vnl_vector< double > const &  x0,
vnl_vector< double > const &  dx 
)
inline

Definition at line 36 of file vnl_powell.cxx.

◆ reported_error()

virtual double vnl_cost_function::reported_error ( double  f_value)
inlinevirtualinherited

Called when error is printed for user.

Definition at line 54 of file vnl_cost_function.h.

◆ set_number_of_unknowns()

void vnl_cost_function::set_number_of_unknowns ( int  number_of_unknowns)
inlineprotectedinherited

Set number of unknowns.

Definition at line 63 of file vnl_cost_function.h.

◆ uninit()

void vnl_powell_1dfun::uninit ( double  lambda,
vnl_vector< double > &  out 
)
inline

Definition at line 52 of file vnl_powell.cxx.

Member Data Documentation

◆ dim

int vnl_cost_function::dim
inherited

Definition at line 66 of file vnl_cost_function.h.

◆ dx_

vnl_vector<double> vnl_powell_1dfun::dx_

Definition at line 31 of file vnl_powell.cxx.

◆ f_

vnl_cost_function* vnl_powell_1dfun::f_

Definition at line 28 of file vnl_powell.cxx.

◆ n_

unsigned int vnl_powell_1dfun::n_

Definition at line 29 of file vnl_powell.cxx.

◆ powell_

vnl_powell* vnl_powell_1dfun::powell_

Definition at line 27 of file vnl_powell.cxx.

◆ tmpx_

vnl_vector<double> vnl_powell_1dfun::tmpx_

Definition at line 32 of file vnl_powell.cxx.

◆ x0_

vnl_vector<double> vnl_powell_1dfun::x0_

Definition at line 30 of file vnl_powell.cxx.


The documentation for this class was generated from the following file: