Gromacs  2021.5

Description

The simplex for the Nelder-Mead algorithm.

Contains the N+1 simplex N-dimensional coordinates and its function values. Allows for simplex manipulations as needed for the Nelder-Mead algorithm.

Note
Keeps the simplex sorted according to function values with the simplex at the lowest function value first.

Public Member Functions

NelderMeadSimplex (const std::function< real(ArrayRef< const real >)> &f, ArrayRef< const real > initalGuess)
Set up Nelder-Mead simplex from an initial guess. More...

const
RealFunctionvalueAtCoordinate
bestVertex () const
Return the vertex with the lowest function value at any of the simplex vertices.

const
RealFunctionvalueAtCoordinate
worstVertex () const
Return the vertex of the simplex with the highest (worst) function value.

real secondWorstValue () const
Return the second largest function value at any of the simplex vertices.

RealFunctionvalueAtCoordinate evaluateReflectionPoint (const std::function< real(ArrayRef< const real >)> &f) const
Return the reflection point and the evaluated function value at this point.

RealFunctionvalueAtCoordinate evaluateExpansionPoint (const std::function< real(ArrayRef< const real >)> &f) const
Evaluate and return the expansion point and function value.

RealFunctionvalueAtCoordinate evaluateContractionPoint (const std::function< real(ArrayRef< const real >)> &f) const
Evaluate and return the contraction point and function value.

void swapOutWorst (const RealFunctionvalueAtCoordinate &newVertex)
Replace the simplex vertex with the largest function value. More...

void shrinkSimplexPointsExceptBest (const std::function< real(ArrayRef< const real >)> &f)
Shrink the simplex. More...

real orientedLength () const
The oriented length of the vertex. More...

Constructor & Destructor Documentation

 gmx::NelderMeadSimplex::NelderMeadSimplex ( const std::function< real(ArrayRef< const real >)> & f, ArrayRef< const real > initalGuess )

Set up Nelder-Mead simplex from an initial guess.

Note
Triggers N+1 function evaluations at all simplex points.
Parameters
 [in] f the function to be evaluated [in] initalGuess initial guess of the coordinates.

Member Function Documentation

The oriented length of the vertex.

The oriented length of the simplex is defined as the largest distance between the first simplex vertex coordinate (with the lowest, best function value) and any other simplex coordinate.

The oriented length is used as a computationally fast and simple convergence criterion because it is proven that orientedLegnth < simplex_diameter < 2 * orientedLength

 void gmx::NelderMeadSimplex::shrinkSimplexPointsExceptBest ( const std::function< real(ArrayRef< const real >)> & f )

Shrink the simplex.

All points move closer to the best point by a factor .

Replace all point coordinates, except the best, with void gmx::NelderMeadSimplex::swapOutWorst ( const RealFunctionvalueAtCoordinate & newVertex )

Replace the simplex vertex with the largest function value.

Parameters
 [in] newVertex to replace the worst vertex with
Note
keeps the simplex list sorted and reevaluates the reflection point

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