Package org.apache.commons.math.optimization.direct

Examples of org.apache.commons.math.optimization.direct.NelderMead.optimize()


    if(method.equals("Nelder-Mead")) {

      NelderMead optimizer = new NelderMead();
      try {
        RealPointValuePair res = optimizer.optimize(g, GoalType.MINIMIZE, par.toDoubleArray());
        ListVector.Builder result = new ListVector.Builder();
        result.add(new DoubleArrayVector(res.getPoint()));
        result.add(new DoubleArrayVector(res.getValue()));
        result.add(new IntArrayVector(IntVector.NA, IntVector.NA));
        result.add(new IntArrayVector(0));
View Full Code Here


    Validate.notNull(function, "function");
    Validate.notNull(startPosition, "start position");
    final MultivariateRealOptimizer optimizer = new NelderMead();
    final MultivariateRealFunction commonsFunction = CommonsMathWrapper.wrapMultivariate(function);
    try {
      return new DoubleMatrix1D(CommonsMathWrapper.unwrap(optimizer.optimize(commonsFunction, MINIMIZER, startPosition.getData())));
    } catch (final ConvergenceException e) {
      throw new MathException(e);
    } catch (final FunctionEvaluationException e) {
      throw new MathException(e);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.