vtf-logo

numerical::QuasiNewton< N, Function, T, Point > Class Template Reference

The quasi-Newton BFGS method. More...

#include <QuasiNewton.h>

Inheritance diagram for numerical::QuasiNewton< N, Function, T, Point >:

numerical::Opt< N, Function, T, Point > List of all members.

Accessors.

const function_typefunction () const
 Return a constant reference to the objective function.
int num_function_calls () const
 Return the number of function calls required to find the minimum.
number_type x_tolerance () const
 Return the x tolerance for convergence.
number_type gradient_tolerance () const
 Return the gradient tolerance for convergence.
static int dimension ()
 Return the dimension, N.

Public Types

typedef base_type::function_type function_type
 The function type.
typedef base_type::number_type number_type
 The number type.
typedef base_type::point_type point_type
 A point in N dimensions.

Public Member Functions

Constructors etc.
The default constructor, the copy constructor and the assignment operator are not implemented.

 QuasiNewton (const function_type &function, const number_type x_tolerance=4 *std::numeric_limits< number_type >::epsilon(), const number_type gradient_tolerance=4 *std::numeric_limits< number_type >::epsilon(), const int max_function_calls=10000)
 Construct from the objective function.
virtual ~QuasiNewton ()
 Destructor.
Minimization.
void find_minimum (point_type &x, number_type &value, int &num_iterations, number_type max_step=0, const number_type x_tolerance=0, const number_type gradient_tolerance=0)
 Find the minimum.
void find_minimum (point_type &x)
 Find the minimum.
Manipulators.
void set_max_function_calls (const int max_function_calls)
 Set the maximum number of function call allowed per optimization.
void reset_num_function_calls ()
 Reset the number of function calls to zero.
void set_x_tolerance (const number_type x_tolerance)
 Set the x tolerance for convergence.
void set_gradient_tolerance (const number_type gradient_tolerance)
 Set the gradient tolerance for convergence.

Protected Member Functions

Calling the objective function.
Functionality inherited from Opt.

number_type evaluate_function (const point_type &x)
 Evaluate the objective function and return the result.
void evaluate_gradient (const point_type &x, point_type &gradient)
 Evaluate the gradient.
void evaluate_numeric_gradient (const point_type &x, point_type &gradient, const number_type delta=0.0)
 Numerically evaluate the gradient.

Detailed Description

template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
class numerical::QuasiNewton< N, Function, T, Point >

The quasi-Newton BFGS method.

Parameters:
N is the problem dimension.
Function is the functor to minimize.
T is the number type. By default it is Function::result_type;
Point is the point type. By default it is Function::argument_type;


Member Function Documentation

template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
number_type numerical::QuasiNewton< N, Function, T, Point >::evaluate_function ( const point_type x  )  [inline, protected]

Evaluate the objective function and return the result.

Increment the count of the number of function calls.

template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
void numerical::QuasiNewton< N, Function, T, Point >::evaluate_gradient ( const point_type x,
point_type gradient 
) [inline, protected]

Evaluate the gradient.

Increment the count of the number of function calls.

template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
void numerical::QuasiNewton< N, Function, T, Point >::evaluate_numeric_gradient ( const point_type x,
point_type gradient,
const number_type  delta = 0.0 
) [inline, protected]

Numerically evaluate the gradient.

Increment the count of the number of function calls.

template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
void numerical::QuasiNewton< N, Function, T, Point >::find_minimum ( point_type x  )  [inline]

Find the minimum.

Parameters:
x The input value is the starting point. The output value is the minimum point found.

template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
void numerical::QuasiNewton< N, Function, T, Point >::find_minimum ( point_type x,
number_type value,
int &  num_iterations,
number_type  max_step = 0,
const number_type  x_tolerance = 0,
const number_type  gradient_tolerance = 0 
)

Find the minimum.

Parameters:
x The input value is the starting point. The output value is the minimum point found.
value is the value of the objective function at the minimum point.
num_iterations is the number of iterations of the method.
max_step is the maximum step used in the line search.
x_tolerance is the x tolerance for convergence. The function returns if the line search takes a smaller step than this.
gradient_tolerance is the gradient tolerance for convergence. The function returns if the magnitude of the gradient falls below this value.


The documentation for this class was generated from the following file:
Generated on Fri Aug 24 12:56:06 2007 for Numerical Algorithms Package by  doxygen 1.4.7