Opt< N, Function, T, Point > Class Template Reference

Base class for optimization methods. More...

#include <Opt.h>

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

List of all members.

Public Member Functions

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_are_checking_function_calls (const bool are_checking)
 Set whether we are checking the number of function calls.

Protected Types

typedef Function function_type
 The function type.
typedef T number_type
 The number type.
typedef Point point_type
 A point in N dimensions.

Protected Member Functions

Constructors etc.

The default constructor, the copy constructor and the assignment operator are not implemented. The implemented constructor and destructor are protected.

 Opt (const function_type &function, const int max_function_calls=10000, const bool are_checking_function_calls=true)
 Construct from the objective function.
virtual ~Opt ()
 Destructor.
Calling the objective function.

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.

Protected Attributes

const function_type_function
 The objective function.
int _max_function_calls
 The maximum allowed number of function calls.
int _num_function_calls
 The number of function calls required to find the minimum.
bool _are_checking_function_calls
 If we are checking the number of function calls.

Accessors.



static int dimension ()
 Return the dimension, N.
const function_typefunction () const
 Return a constant reference to the objective function.
int max_function_calls ()
 Return the maximum allowed number of function calls.
int num_function_calls () const
 Return the number of function calls required to find the minimum.

Detailed Description

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

Base class for optimization methods.

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 Opt< N, Function, T, Point >::evaluate_function ( const point_type x  )  [inline, protected]
template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
void Opt< 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.

Reimplemented in QuasiNewton< N, Function, T, Point >, and QuasiNewton< N, function_with_penalty_type, number_type, point_type >.

template<int N, class Function, typename T = typename Function::result_type, typename Point = typename Function::argument_type>
void Opt< 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.

Reimplemented in QuasiNewton< N, Function, T, Point >, and QuasiNewton< N, function_with_penalty_type, number_type, point_type >.


The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:15:00 2016 for Numerical Algorithms Package by  doxygen 1.6.3