queso-0.53.0
Public Member Functions | Protected Attributes | List of all members
QUESO::BaseOptimizer Class Referenceabstract

A base class for handling optimisation of scalar functions. More...

#include <Optimizer.h>

Inheritance diagram for QUESO::BaseOptimizer:
Inheritance graph
[legend]

Public Member Functions

 BaseOptimizer ()
 Default constructor. More...
 
virtual ~BaseOptimizer ()
 Destructor. More...
 
virtual void minimize (OptimizerMonitor *monitor)=0
 Minimize the objective function, starting at m_initialPoint. More...
 
unsigned int getMaxIterations () const
 Returns the maximum number of iterations the optimizer will do. More...
 
double getTolerance () const
 Returns the tolerance used to test for an extremum in the optimizer. More...
 
double getFiniteDifferenceStepSize () const
 Returns the step size used in the finite difference formula. More...
 
void setMaxIterations (unsigned int maxIterations)
 Sets the maximum number of iterations to be used by the optimizer. More...
 
void setTolerance (double tolerance)
 Sets the tolerance the optimizer will use to test for an extremum. More...
 
void setFiniteDifferenceStepSize (double h)
 Sets the step to use in the finite difference derivative. More...
 

Protected Attributes

unsigned int m_maxIterations
 
double m_tolerance
 
double m_finiteDifferenceStepSize
 

Detailed Description

A base class for handling optimisation of scalar functions.

This class defines the interface every optimizer must adhere to. All optimizers should subclass this class.

Definition at line 44 of file Optimizer.h.

Constructor & Destructor Documentation

QUESO::BaseOptimizer::BaseOptimizer ( )

Default constructor.

Definition at line 29 of file Optimizer.C.

30  : m_maxIterations(100),
31  m_tolerance(1e-3),
33 {
34 }
unsigned int m_maxIterations
Definition: Optimizer.h:87
double m_finiteDifferenceStepSize
Definition: Optimizer.h:89
QUESO::BaseOptimizer::~BaseOptimizer ( )
virtual

Destructor.

Definition at line 36 of file Optimizer.C.

37 {
38 }

Member Function Documentation

double QUESO::BaseOptimizer::getFiniteDifferenceStepSize ( ) const

Returns the step size used in the finite difference formula.

Default value is 1e-4

Definition at line 53 of file Optimizer.C.

References m_finiteDifferenceStepSize.

Referenced by QUESO::c_evaluate_derivative().

54 {
55  return this->m_finiteDifferenceStepSize;
56 }
double m_finiteDifferenceStepSize
Definition: Optimizer.h:89
unsigned int QUESO::BaseOptimizer::getMaxIterations ( ) const

Returns the maximum number of iterations the optimizer will do.

Default value is 100

Definition at line 41 of file Optimizer.C.

References m_maxIterations.

Referenced by QUESO::GslOptimizer::minimize_no_gradient(), and QUESO::GslOptimizer::minimize_with_gradient().

42 {
43  return this->m_maxIterations;
44 }
unsigned int m_maxIterations
Definition: Optimizer.h:87
double QUESO::BaseOptimizer::getTolerance ( ) const

Returns the tolerance used to test for an extremum in the optimizer.

Default value is 1e-3

Definition at line 47 of file Optimizer.C.

References m_tolerance.

Referenced by QUESO::GslOptimizer::minimize_no_gradient().

48 {
49  return this->m_tolerance;
50 }
virtual void QUESO::BaseOptimizer::minimize ( OptimizerMonitor monitor)
pure virtual

Minimize the objective function, starting at m_initialPoint.

m_initialPoint is handled in the derived class

Implemented in QUESO::GslOptimizer.

void QUESO::BaseOptimizer::setFiniteDifferenceStepSize ( double  h)

Sets the step to use in the finite difference derivative.

Definition at line 71 of file Optimizer.C.

References m_finiteDifferenceStepSize.

72 {
74 }
double m_finiteDifferenceStepSize
Definition: Optimizer.h:89
void QUESO::BaseOptimizer::setMaxIterations ( unsigned int  maxIterations)

Sets the maximum number of iterations to be used by the optimizer.

Definition at line 59 of file Optimizer.C.

References m_maxIterations.

60 {
61  this->m_maxIterations = maxIterations;
62 }
unsigned int m_maxIterations
Definition: Optimizer.h:87
void QUESO::BaseOptimizer::setTolerance ( double  tolerance)

Sets the tolerance the optimizer will use to test for an extremum.

Definition at line 65 of file Optimizer.C.

References m_tolerance.

66 {
67  this->m_tolerance = tolerance;
68 }

Member Data Documentation

double QUESO::BaseOptimizer::m_finiteDifferenceStepSize
protected

Definition at line 89 of file Optimizer.h.

Referenced by getFiniteDifferenceStepSize(), and setFiniteDifferenceStepSize().

unsigned int QUESO::BaseOptimizer::m_maxIterations
protected

Definition at line 87 of file Optimizer.h.

Referenced by getMaxIterations(), and setMaxIterations().

double QUESO::BaseOptimizer::m_tolerance
protected

Definition at line 88 of file Optimizer.h.

Referenced by getTolerance(), and setTolerance().


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

Generated on Thu Jun 11 2015 13:52:34 for queso-0.53.0 by  doxygen 1.8.5