GridSearch< functor, real > Class Template Reference

#include <GridSearch.h>

Collaboration diagram for GridSearch< functor, real >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class functor, class real>
class GridSearch< functor, real >

This is an encapsulation of the 1 dimensional grid search algorithm. It is used to find the maximum (or minimum) value of a function, on a grid.

Definition at line 11 of file GridSearch.h.

Public Member Functions

bool get_boundary_max () const
 returns true if maximum is on a boundary
bool get_boundary_min () const
 returns true if miminum is on a boundary
functor & get_functor ()
 this returns a reference to the parent object with the hidden variables
 GridSearch (int Max_Number_Increment, real X0, real dX, functor &obj, real(functor::*f)(real))
 This constructor sets everything needed by the algorithm.
void do_iteration (bool print_results)
 This function does the calculations.
real get_x_max () const
 the value of x, st f(x) is maximum
int get_i_max () const
 integer offset where f( _X + i*_dX)
real get_f_x_max () const
 the maximum value of f on the grid
real get_x_min () const
 the value of x, st f(x) is minimum
int get_i_min () const
 integer offset where f( _X + i*_dX)
real get_f_x_min () const
 the minimum value of f on the grid

Protected Attributes

int _max_number_increment
 the number of iterations of the routine
real _X0
 the first value
real _dX
 the second seed value
real(functor::* _f )(real)
 this is the function which is being maximized / minimized
functor & _obj
 this is the object used to calculate the functions
real _x_max
 the value of x, st f(x) is maximum
int _i_max
 integer offset where f( _X + i*_dX)
real _f_x_max
 the maximum value of f on the grid
real _x_min
 the value of x, st f(x) is minimum
int _i_min
 integer offset where f( _X + i*_dX)
real _f_x_min
 the minimum value of f on the grid
vector< real > _x
 the values of x to be used in the search
vector< real > _F_x
 the sequence of f_x's


The documentation for this class was generated from the following file:
Generated on Thu Sep 10 18:21:50 2009 for public_options by  doxygen 1.5.1