template<class A> class NMSimplex

Need to be derived to evaluate the apropiate fuction in each step

Public Methods

[more] NMSimplex()
default constructor (dim=dimension of the problem (default=2) )
[more]virtual ~NMSimplex()
destructor
[more]void SetDimensions(int dim)
This sets the dimensions of all vectorsNS, simplex.
[more]void SetAlpha(double newAlpha)
These functions allow the user to set values of the reflection, contraction, expansion, and shrinking coefficients
[more]void SetBeta(double newBeta)
[more]void SetGamma(double newGamma)
[more]void SetSigma(double newSigma)
[more]void SetMaxCalls(long mcalls)
[more]void ExploratoryMoves()
Use Nelder Mead to find function minimum
[more]void ReplaceSimplexPoint(int index, const VectorND& newPoint)
Replaces simplex point indexed at index with newPoint
[more]void CalculateFunctionValue(int index)
Finds the f(x) value for the simplex point indexed at index and replaces the proper value in simplexValues
[more]bool Stop()
Returns true if the stopping criteria have been satisfied
[more]void InitRegularTriangularSimplex(const VectorND basePoint, const double edgeLength, A &a)
Simplex-altering functions: Initialization
[more]void InitFixedLengthRightSimplex(const VectorND basePoint, const double edgeLength, A &a)
NOTE: basePoint is assumed to be of proper dimension
[more]void InitVariableLengthRightSimplex(const VectorND basePoint, const double* edgeLengths, A &a)
NOTE: basePoint is assumed to be of proper dimension
[more]void InitGeneralSimplex(const MatrixNM* plex)
NOTE: basePoint and edgeLengths are assumed to be of proper dimension
[more]int GetFunctionCalls() const
number of objective function evaluations
[more]int GetVarNo() const
returns the dimension of the problem
[more]int GetTolHit() const
returns toleranceHit
[more]void printSimplex() const
prints out the simplex points by row, their corresponding f(x) values, and the number of function calls thus far
[more]VectorND GetMinPoint() const
simplex point which generates the best objective function value found thus far
[more]double GetMinVal() const
best objective function value found thus far

Protected Fields

[more]A* x
-----------------------------------------------------------

Protected Methods

[more]virtual void fcnCall(VectorND v, double& value, int& flag)
------------ Modify this call of objective function for template design

Private Fields

[more]int dimensions
[more]MatrixNM* simplex
the number of dimensions (the dimension of the problem)
[more]double* simplexValues
the current simplex
[more]double alpha
their corresponding f(x) values
[more]double beta
reflection coefficient
[more]double gamma
contraction coefficient
[more]double sigma
expansion coefficient
[more]int minIndex
shrinking coefficient
[more]int maxIndex
index of point generating min f(x)
[more]VectorND* centroid
index of point generating max f(x)
[more]VectorND* reflectionPt
the current centroid
[more]double reflectionPtValue
the reflection point
[more]VectorND* expansionPt
the value of f(reflectionPt)
[more]double expansionPtValue
the expansion point
[more]VectorND* contractionPt
the value of f(expansionPt)
[more]double contractionPtValue
the contraction point
[more]double maxPrimePtValue
the value of f(contractionPt)
[more]long functionCalls
min(f(maxIndexPoint),reflectionPtValue)
[more]int toleranceHit
tally of number of function calls
[more]int maxPrimePtId
1 if stop due to tolerance, 0 if funcCalls, -1 if not stopped
[more]long MaxCalls
The maxCalls variable is not a hard limit on the number of function evaluations that may be performed by the search.

Private Methods

[more]void FindMinMaxIndices()
sets maxIndex to the simplex index of the point which generates the highest value of f(x)
[more]int SecondHighestPtIndex()
returns simplex index of the point which generates the second highest value of f(x)
[more]void FindCentroid()
finds the centroid of the simplex
[more]void FindReflectionPt()
finds the reflection point and sets its f(x) value
[more]void FindExpansionPt()
finds the expansion point and sets its f(x) value
[more]void FindContractionPt()
finds the contraction point and sets its f(x) value
[more]void ShrinkSimplex()
this function goes through the simplex and reduces the lengths of the edges adjacent to the best vertex


Documentation

Need to be derived to evaluate the apropiate fuction in each step
o NMSimplex()
default constructor (dim=dimension of the problem (default=2) )

ovirtual ~NMSimplex()
destructor

ovoid SetDimensions(int dim)
This sets the dimensions of all vectorsNS, simplex. Call always after Construction if dimensions!=2.

ovoid SetAlpha(double newAlpha)
These functions allow the user to set values of the reflection, contraction, expansion, and shrinking coefficients

ovoid SetBeta(double newBeta)

ovoid SetGamma(double newGamma)

ovoid SetSigma(double newSigma)

ovoid SetMaxCalls(long mcalls)

ovoid ExploratoryMoves()
Use Nelder Mead to find function minimum

ovoid ReplaceSimplexPoint(int index, const VectorND& newPoint)
Replaces simplex point indexed at index with newPoint

ovoid CalculateFunctionValue(int index)
Finds the f(x) value for the simplex point indexed at index and replaces the proper value in simplexValues

obool Stop()
Returns true if the stopping criteria have been satisfied

ovoid InitRegularTriangularSimplex(const VectorND basePoint, const double edgeLength, A &a)
Simplex-altering functions: Initialization

ovoid InitFixedLengthRightSimplex(const VectorND basePoint, const double edgeLength, A &a)
NOTE: basePoint is assumed to be of proper dimension

ovoid InitVariableLengthRightSimplex(const VectorND basePoint, const double* edgeLengths, A &a)
NOTE: basePoint is assumed to be of proper dimension

ovoid InitGeneralSimplex(const MatrixNM* plex)
NOTE: basePoint and edgeLengths are assumed to be of proper dimension

oint GetFunctionCalls() const
number of objective function evaluations

oint GetVarNo() const
returns the dimension of the problem

oint GetTolHit() const
returns toleranceHit

ovoid printSimplex() const
prints out the simplex points by row, their corresponding f(x) values, and the number of function calls thus far

oVectorND GetMinPoint() const
simplex point which generates the best objective function value found thus far

odouble GetMinVal() const
best objective function value found thus far

ovirtual void fcnCall(VectorND v, double& value, int& flag)
------------ Modify this call of objective function for template design

oA* x
-----------------------------------------------------------

ovoid FindMinMaxIndices()
sets maxIndex to the simplex index of the point which generates the highest value of f(x)

oint SecondHighestPtIndex()
returns simplex index of the point which generates the second highest value of f(x)

ovoid FindCentroid()
finds the centroid of the simplex

ovoid FindReflectionPt()
finds the reflection point and sets its f(x) value

ovoid FindExpansionPt()
finds the expansion point and sets its f(x) value

ovoid FindContractionPt()
finds the contraction point and sets its f(x) value

ovoid ShrinkSimplex()
this function goes through the simplex and reduces the lengths of the edges adjacent to the best vertex

oint dimensions

oMatrixNM* simplex
the number of dimensions (the dimension of the problem)

odouble* simplexValues
the current simplex

odouble alpha
their corresponding f(x) values

odouble beta
reflection coefficient

odouble gamma
contraction coefficient

odouble sigma
expansion coefficient

oint minIndex
shrinking coefficient

oint maxIndex
index of point generating min f(x)

oVectorND* centroid
index of point generating max f(x)

oVectorND* reflectionPt
the current centroid

odouble reflectionPtValue
the reflection point

oVectorND* expansionPt
the value of f(reflectionPt)

odouble expansionPtValue
the expansion point

oVectorND* contractionPt
the value of f(expansionPt)

odouble contractionPtValue
the contraction point

odouble maxPrimePtValue
the value of f(contractionPt)

olong functionCalls
min(f(maxIndexPoint),reflectionPtValue)

oint toleranceHit
tally of number of function calls

oint maxPrimePtId
1 if stop due to tolerance, 0 if funcCalls, -1 if not stopped

olong MaxCalls
The maxCalls variable is not a hard limit on the number of function evaluations that may be performed by the search. The search should always halt at a point from which none of the trial steps can find improvement to be consistent with the formal theory regarding pattern searches.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.