Top Description Fields Constructors Methods
org.apache.commons.math3.optimization.direct

public Class NelderMeadSimplex

extends AbstractSimplex
Class Inheritance
Annotations
@Deprecated
Imports
java.util.Comparator, org.apache.commons.math3.optimization.PointValuePair, org.apache.commons.math3.analysis.MultivariateFunction

Deprecated

As of 3.1 (to be removed in 4.0).

This class implements the Nelder-Mead simplex algorithm.
Since
3.0

Field Summary

Modifier and TypeField and Description
private static final double
DEFAULT_GAMMA

Default value for gamma: .

private static final double
DEFAULT_KHI

Default value for khi: .

private static final double
DEFAULT_RHO

Default value for rho: .

private static final double
DEFAULT_SIGMA

Default value for sigma: .

private final double
gamma

Contraction coefficient.

private final double
khi

Expansion coefficient.

private final double
rho

Reflection coefficient.

private final double
sigma

Shrinkage coefficient.

Constructor Summary

AccessConstructor and Description
public
NelderMeadSimplex(final int
Dimension of the simplex.
n
)

Build a Nelder-Mead simplex with default coefficients.

public
NelderMeadSimplex(final int
Dimension of the simplex.
n
,
double
Length of the sides of the default (hypercube) simplex. See AbstractSimplex#AbstractSimplex(int, double).
sideLength
)

Build a Nelder-Mead simplex with default coefficients.

public
NelderMeadSimplex(final int
Dimension of the simplex. See AbstractSimplex#AbstractSimplex(int, double).
n
,
double
Length of the sides of the default (hypercube) simplex. See AbstractSimplex#AbstractSimplex(int, double).
sideLength
,
final double
Reflection coefficient.
rho
,
final double
Expansion coefficient.
khi
,
final double
Contraction coefficient.
gamma
,
final double
Shrinkage coefficient.
sigma
)

Build a Nelder-Mead simplex with specified coefficients.

public
NelderMeadSimplex(final int
Dimension of the simplex. See AbstractSimplex#AbstractSimplex(int).
n
,
final double
Reflection coefficient.
rho
,
final double
Expansion coefficient.
khi
,
final double
Contraction coefficient.
gamma
,
final double
Shrinkage coefficient.
sigma
)

Build a Nelder-Mead simplex with specified coefficients.

public
NelderMeadSimplex(final double[]
Steps along the canonical axes representing box edges. They may be negative but not zero. See
steps
)

Build a Nelder-Mead simplex with default coefficients.

public
NelderMeadSimplex(final double[]
Steps along the canonical axes representing box edges. They may be negative but not zero. See AbstractSimplex#AbstractSimplex(double[]).
steps
,
final double
Reflection coefficient.
rho
,
final double
Expansion coefficient.
khi
,
final double
Contraction coefficient.
gamma
,
final double
Shrinkage coefficient.
sigma
)

Build a Nelder-Mead simplex with specified coefficients.

public
NelderMeadSimplex(final double[][] referenceSimplex)

Build a Nelder-Mead simplex with default coefficients.

public
NelderMeadSimplex(final double[][] referenceSimplex, final double
Reflection coefficient.
rho
,
final double
Expansion coefficient.
khi
,
final double
Contraction coefficient.
gamma
,
final double
Shrinkage coefficient.
sigma
)

Build a Nelder-Mead simplex with specified coefficients.

Method Summary

Modifier and TypeMethod and Description
public void
iterate(final MultivariateFunction
Evaluation function.
evaluationFunction
,
final Comparator<PointValuePair>
Comparator to use to sort simplex vertices from best to worst.
comparator
)

Implements abstract org.apache.commons.math3.optimization.direct.AbstractSimplex.iterate.

Compute the next simplex of the algorithm.

Inherited from org.apache.commons.math3.optimization.direct.AbstractSimplex:
buildevaluategetDimensiongetPointgetPointsgetSizereplaceWorstPointsetPointsetPoints

Field Detail

DEFAULT_GAMMAback to summary
private static final double DEFAULT_GAMMA

Default value for gamma: .

DEFAULT_KHIback to summary
private static final double DEFAULT_KHI

Default value for khi: .

DEFAULT_RHOback to summary
private static final double DEFAULT_RHO

Default value for rho: .

DEFAULT_SIGMAback to summary
private static final double DEFAULT_SIGMA

Default value for sigma: .

gammaback to summary
private final double gamma

Contraction coefficient.

khiback to summary
private final double khi

Expansion coefficient.

rhoback to summary
private final double rho

Reflection coefficient.

sigmaback to summary
private final double sigma

Shrinkage coefficient.

Constructor Detail

NelderMeadSimplexback to summary
public NelderMeadSimplex(final int n)

Build a Nelder-Mead simplex with default coefficients. The default coefficients are 1.0 for rho, 2.0 for khi and 0.5 for both gamma and sigma.

Parameters
n:int

Dimension of the simplex.

NelderMeadSimplexback to summary
public NelderMeadSimplex(final int n, double sideLength)

Build a Nelder-Mead simplex with default coefficients. The default coefficients are 1.0 for rho, 2.0 for khi and 0.5 for both gamma and sigma.

Parameters
n:int

Dimension of the simplex.

sideLength:double

Length of the sides of the default (hypercube) simplex. See AbstractSimplex#AbstractSimplex(int, double).

NelderMeadSimplexback to summary
public NelderMeadSimplex(final int n, double sideLength, final double rho, final double khi, final double gamma, final double sigma)

Build a Nelder-Mead simplex with specified coefficients.

Parameters
n:int

Dimension of the simplex. See AbstractSimplex#AbstractSimplex(int, double).

sideLength:double

Length of the sides of the default (hypercube) simplex. See AbstractSimplex#AbstractSimplex(int, double).

rho:double

Reflection coefficient.

khi:double

Expansion coefficient.

gamma:double

Contraction coefficient.

sigma:double

Shrinkage coefficient.

NelderMeadSimplexback to summary
public NelderMeadSimplex(final int n, final double rho, final double khi, final double gamma, final double sigma)

Build a Nelder-Mead simplex with specified coefficients.

Parameters
n:int

Dimension of the simplex. See AbstractSimplex#AbstractSimplex(int).

rho:double

Reflection coefficient.

khi:double

Expansion coefficient.

gamma:double

Contraction coefficient.

sigma:double

Shrinkage coefficient.

NelderMeadSimplexback to summary
public NelderMeadSimplex(final double[] steps)

Build a Nelder-Mead simplex with default coefficients. The default coefficients are 1.0 for rho, 2.0 for khi and 0.5 for both gamma and sigma.

Parameters
steps:double[]

Steps along the canonical axes representing box edges. They may be negative but not zero. See

NelderMeadSimplexback to summary
public NelderMeadSimplex(final double[] steps, final double rho, final double khi, final double gamma, final double sigma)

Build a Nelder-Mead simplex with specified coefficients.

Parameters
steps:double[]

Steps along the canonical axes representing box edges. They may be negative but not zero. See AbstractSimplex#AbstractSimplex(double[]).

rho:double

Reflection coefficient.

khi:double

Expansion coefficient.

gamma:double

Contraction coefficient.

sigma:double

Shrinkage coefficient.

Exceptions
IllegalArgumentException:
if one of the steps is zero.
NelderMeadSimplexback to summary
public NelderMeadSimplex(final double[][] referenceSimplex)

Build a Nelder-Mead simplex with default coefficients. The default coefficients are 1.0 for rho, 2.0 for khi and 0.5 for both gamma and sigma.

Parameters
referenceSimplex:double[][]

Reference simplex. See AbstractSimplex#AbstractSimplex(double[][]).

NelderMeadSimplexback to summary
public NelderMeadSimplex(final double[][] referenceSimplex, final double rho, final double khi, final double gamma, final double sigma)

Build a Nelder-Mead simplex with specified coefficients.

Parameters
referenceSimplex:double[][]

Reference simplex. See AbstractSimplex#AbstractSimplex(double[][]).

rho:double

Reflection coefficient.

khi:double

Expansion coefficient.

gamma:double

Contraction coefficient.

sigma:double

Shrinkage coefficient.

Exceptions
NotStrictlyPositiveException:
if the reference simplex does not contain at least one point.
DimensionMismatchException:
if there is a dimension mismatch in the reference simplex.

Method Detail

iterateback to summary
public void iterate(final MultivariateFunction evaluationFunction, final Comparator<PointValuePair> comparator)

Implements abstract org.apache.commons.math3.optimization.direct.AbstractSimplex.iterate.

Doc from org.apache.commons.math3.optimization.direct.AbstractSimplex.iterate.

Compute the next simplex of the algorithm.

Parameters
evaluationFunction:MultivariateFunction

Evaluation function.

comparator:Comparator<PointValuePair>

Comparator to use to sort simplex vertices from best to worst.

Annotations
@Override