Direct Graphical Models  v.1.5.2
DirectGraphicalModels::CPowell Class Reference

The Powell search method class. More...

#include <Powell.h>

Public Member Functions

 CPowell (word nParams)
 Constructor. More...
 
 ~CPowell (void)
 
void reset (void)
 Resets class variables. More...
 
void setInitParams (float *pParam)
 Sets the initial parameters (arguments) for the search algorithm. More...
 
void setDeltas (float *pDelta)
 Sets the searching steps along the parameters (arguments) More...
 
void setMinParams (float *pMinParam)
 Sets the lower boundary for parameters (arguments) search. More...
 
void setMaxParams (float *pMaxParam)
 Sets the upper boundary for parameters (arguments) search. More...
 
void setAcceleration (float acceleration)
 Sets the acceleration coefficient. More...
 
float * getParams (float val)
 Gets the updated parameters (arguments) More...
 
bool isConverged (void)
 Indicates weather the method has converged. More...
 

Detailed Description

The Powell search method class.

The Powell search method is an iterative optimisation algortihm that does not require an estimate for the gradient of the objective function: \( f:\mathbb{R}^n\rightarrow\mathbb{R} \), where \( n \) is the number of parameters (arguments). In order to find the extremum point, one may use the common case:

using namespace DirectGraphicalModels;
const word nParams = 2;
float * pParam;
float initParam[nParams] = {0.0f, 0.0f}; // coordinates of the initial point for the search algorithm
float initDelta[nParams] = {0.1f, 0.1f}; // searching steps along the parameters (arguments)
CPowell *powell = new CPowell(nParams);
powell->setInitParams(initParam);
powell->setDeltas(initDelta);
pParam = initParam;
while(!powell->isConverged()) {
float val = objectiveFunction(pParam);
pParam = powell->getParams(val);
}
Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 39 of file Powell.h.

Constructor & Destructor Documentation

◆ CPowell()

DirectGraphicalModels::CPowell::CPowell ( word  nParams)

Constructor.

Parameters
nParamsNumber of parameters (arguments) of the objective function

Definition at line 7 of file Powell.cpp.

Here is the call graph for this function:

◆ ~CPowell()

DirectGraphicalModels::CPowell::~CPowell ( void  )

Definition at line 19 of file Powell.cpp.

Member Function Documentation

◆ getParams()

float * DirectGraphicalModels::CPowell::getParams ( float  val)

Gets the updated parameters (arguments)

This function updates the parameters (arguments) of the objective function based on its outcome value val and retunrs them (See example code for more details)

Parameters
valThe current value of the objective function
Returns
The pointer to array with the updated parameters

Definition at line 78 of file Powell.cpp.

Here is the call graph for this function:

◆ isConverged()

bool DirectGraphicalModels::CPowell::isConverged ( void  )

Indicates weather the method has converged.

Return values
trueif the method has converged
falseotherwise

Definition at line 168 of file Powell.cpp.

Here is the caller graph for this function:

◆ reset()

void DirectGraphicalModels::CPowell::reset ( void  )

Resets class variables.

Definition at line 23 of file Powell.cpp.

Here is the caller graph for this function:

◆ setAcceleration()

void DirectGraphicalModels::CPowell::setAcceleration ( float  acceleration)

Sets the acceleration coefficient.

Incrasing this parameter may speed-up the convergence of the method, however too large values may affect the calculation stability

Default value is 0.1

Parameters
accelerationThe acceleration coefficient

Definition at line 72 of file Powell.cpp.

◆ setDeltas()

void DirectGraphicalModels::CPowell::setDeltas ( float *  pDelta)

Sets the searching steps along the parameters (arguments)

Default values are 0.1 for all parameters (arguments)

Parameters
pDeltaPointer to an array with the offset values for each parameter (argument)

Definition at line 67 of file Powell.cpp.

◆ setInitParams()

void DirectGraphicalModels::CPowell::setInitParams ( float *  pParam)

Sets the initial parameters (arguments) for the search algorithm.

Default values are 0 for all parameters (arguments)

Parameters
pParamPointer to an array with the initial values for the search algorithm

Definition at line 38 of file Powell.cpp.

◆ setMaxParams()

void DirectGraphicalModels::CPowell::setMaxParams ( float *  pMaxParam)

Sets the upper boundary for parameters (arguments) search.

Default values are \(+\infty\) for all parameters (arguments)

Parameters
pMaxParamPointer to an array with the maximal parameter (argument) values

Definition at line 60 of file Powell.cpp.

◆ setMinParams()

void DirectGraphicalModels::CPowell::setMinParams ( float *  pMinParam)

Sets the lower boundary for parameters (arguments) search.

Default values are \(-\infty\) for all parameters (arguments)

Parameters
pMinParamPointer to an array with the minimal parameter (argument) values

Definition at line 53 of file Powell.cpp.


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