## org.apache.commons.math.optimization.direct
Class MultiDirectional

    java.lang.Object
      org.apache.commons.math.optimization.direct.DirectSearchOptimizer
          org.apache.commons.math.optimization.direct.MultiDirectional

All Implemented Interfaces:
  MultivariateRealOptimizer

    public class MultiDirectional

extends DirectSearchOptimizer

This class implements the multi-directional direct search method.

Since:
  1.2
Version:
  $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
See Also:
  `NelderMead`

Field Summary
`private double` `gamma` Contraction coefficient.
`private double` `khi` Expansion coefficient.

Fields inherited from class org.apache.commons.math.optimization.direct.DirectSearchOptimizer
`simplex`

Constructor Summary
`MultiDirectional()` Build a multi-directional optimizer with default coefficients.
`MultiDirectional(double khi, double gamma)` Build a multi-directional optimizer with specified coefficients.

Method Summary
`private RealPointValuePair` `evaluateNewSimplex(RealPointValuePair[] original, double coeff, java.util.Comparator<RealPointValuePair> comparator)` Compute and evaluate a new simplex.
`protected void` `iterateSimplex(java.util.Comparator<RealPointValuePair> comparator)` Compute the next simplex of the algorithm.

Methods inherited from class org.apache.commons.math.optimization.direct.DirectSearchOptimizer
`evaluate, evaluateSimplex, getConvergenceChecker, getEvaluations, getIterations, getMaxEvaluations, getMaxIterations, incrementIterationsCounter, optimize, replaceWorstPoint, setConvergenceChecker, setMaxEvaluations, setMaxIterations, setStartConfiguration, setStartConfiguration`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### khi

    private final double khi

  Expansion coefficient.

### gamma

    private final double gamma

  Contraction coefficient.

Constructor Detail

### MultiDirectional

    public MultiDirectional()

  Build a multi-directional optimizer with default coefficients.

  The default values are 2.0 for khi and 0.5 for gamma.

### MultiDirectional

    public MultiDirectional(double khi,
                            double gamma)

  Build a multi-directional optimizer with specified coefficients.

  Parameters:
    `khi` - expansion coefficient
    `gamma` - contraction coefficient

Method Detail

### iterateSimplex

    protected void iterateSimplex(java.util.Comparator<RealPointValuePair> comparator)
                           throws FunctionEvaluationException,
                                  OptimizationException,
                                  java.lang.IllegalArgumentException

  Compute the next simplex of the algorithm.

  Specified by:
    `iterateSimplex` in class `DirectSearchOptimizer`
  Parameters:
    `comparator` - comparator to use to sort simplex vertices from best to worst
  Throws:
    `FunctionEvaluationException` - if the function cannot be evaluated at some point
    `OptimizationException` - if the algorithm fails to converge
    `java.lang.IllegalArgumentException` - if the start point dimension is wrong

### evaluateNewSimplex

    private RealPointValuePair evaluateNewSimplex(RealPointValuePair[] original,
                                                  double coeff,
                                                  java.util.Comparator<RealPointValuePair> comparator)
                                           throws FunctionEvaluationException,
                                                  OptimizationException

  Compute and evaluate a new simplex.

  Parameters:
    `original` - original simplex (to be preserved)
    `coeff` - linear coefficient
    `comparator` - comparator to use to sort simplex vertices from best to poorest
  Returns:
    best point in the transformed simplex
  Throws:
    `FunctionEvaluationException` - if the function cannot be evaluated at some point
    `OptimizationException` - if the maximal number of evaluations is exceeded

Copyright (c) 2003-2011 Apache Software Foundation