org.apache.commons.math3.optim.nonlinear.scalar.noderiv
Class AbstractSimplex
- java.lang.Object
-
- org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex
-
- All Implemented Interfaces:
- OptimizationData
- Direct Known Subclasses:
- MultiDirectionalSimplex, NelderMeadSimplex
public abstract class AbstractSimplex extends java.lang.Object implements OptimizationData
This class implements the simplex concept. It is intended to be used in conjunction withSimplexOptimizer.
The initial configuration of the simplex is set by the constructorsAbstractSimplex(double[])orAbstractSimplex(double[][]). The otherconstructorwill set all steps to 1, thus building a default configuration from a unit hypercube.
Users must call thebuildmethod in order to create the data structure that will be acted on by the other methods of this class.- Since:
- 3.0
- See Also:
SimplexOptimizer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidbuild(double[] startPoint)Build an initial simplex.voidevaluate(MultivariateFunction evaluationFunction, java.util.Comparator<PointValuePair> comparator)Evaluate all the non-evaluated points of the simplex.intgetDimension()Get simplex dimension.PointValuePairgetPoint(int index)Get the simplex point stored at the requestedindex.PointValuePair[]getPoints()Get the points of the simplex.intgetSize()Get simplex size.abstract voiditerate(MultivariateFunction evaluationFunction, java.util.Comparator<PointValuePair> comparator)Compute the next simplex of the algorithm.
-
-
-
Method Detail
-
getDimension
public int getDimension()
Get simplex dimension.- Returns:
- the dimension of the simplex.
-
getSize
public int getSize()
Get simplex size. After calling thebuildmethod, this method will will be equivalent togetDimension() + 1.- Returns:
- the size of the simplex.
-
iterate
public abstract void iterate(MultivariateFunction evaluationFunction, java.util.Comparator<PointValuePair> comparator)
Compute the next simplex of the algorithm.- Parameters:
evaluationFunction- Evaluation function.comparator- Comparator to use to sort simplex vertices from best to worst.- Throws:
TooManyEvaluationsException- if the algorithm fails to converge.
-
build
public void build(double[] startPoint)
Build an initial simplex.- Parameters:
startPoint- First point of the simplex.- Throws:
DimensionMismatchException- if the start point does not match simplex dimension.
-
evaluate
public void evaluate(MultivariateFunction evaluationFunction, java.util.Comparator<PointValuePair> comparator)
Evaluate all the non-evaluated points of the simplex.- Parameters:
evaluationFunction- Evaluation function.comparator- Comparator to use to sort simplex vertices from best to worst.- Throws:
TooManyEvaluationsException- if the maximal number of evaluations is exceeded.
-
getPoints
public PointValuePair[] getPoints()
Get the points of the simplex.- Returns:
- all the simplex points.
-
getPoint
public PointValuePair getPoint(int index)
Get the simplex point stored at the requestedindex.- Parameters:
index- Location.- Returns:
- the point at location
index.
-
-
DMelt 3.0 © DataMelt by jWork.ORG