/** Compute the underlying function value from an unbounded point. * <p> * This method simply bounds the unbounded point using the mappings * set up at construction and calls the underlying function using * the bounded point. * </p> * @param point unbounded value * @return underlying function value * @see #unboundedToBounded(double[]) */ public double value(double[] point) { return bounded.value(unboundedToBounded(point)); }
/** * Compute the underlying function value from an unbounded point. * <p> * This method simply bounds the unbounded point using the mappings * set up at construction and calls the underlying function using * the bounded point. * </p> * @param point unbounded value * @return underlying function value * @see #unboundedToBounded(double[]) */ public double value(double[] point) { return bounded.value(unboundedToBounded(point)); }
/** * Computes the objective function value. * This method <em>must</em> be called by subclasses to enforce the * evaluation counter limit. * * @param params Point at which the objective function must be evaluated. * @return the objective function value at the specified point. * @throws TooManyEvaluationsException if the maximal number of * evaluations is exceeded. */ public double computeObjectiveValue(double[] params) { super.incrementEvaluationCount(); return function.value(params); } }
return bounded.value(point);
return bounded.value(point);
/** * Evaluate all the non-evaluated points of the simplex. * * @param evaluationFunction Evaluation function. * @param comparator Comparator to use to sort simplex vertices from best to worst. * @throws org.apache.commons.math3.exception.TooManyEvaluationsException * if the maximal number of evaluations is exceeded. */ public void evaluate(final MultivariateFunction evaluationFunction, final Comparator<PointValuePair> comparator) { // Evaluate the objective function at all non-evaluated simplex points. for (int i = 0; i < simplex.length; i++) { final PointValuePair vertex = simplex[i]; final double[] point = vertex.getPointRef(); if (Double.isNaN(vertex.getValue())) { simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false); } } // Sort the simplex from best to worst. Arrays.sort(simplex, comparator); }
/** * Evaluate all the non-evaluated points of the simplex. * * @param evaluationFunction Evaluation function. * @param comparator Comparator to use to sort simplex vertices from best to worst. * @throws org.apache.commons.math3.exception.TooManyEvaluationsException * if the maximal number of evaluations is exceeded. */ public void evaluate(final MultivariateFunction evaluationFunction, final Comparator<PointValuePair> comparator) { // Evaluate the objective function at all non-evaluated simplex points. for (int i = 0; i < simplex.length; i++) { final PointValuePair vertex = simplex[i]; final double[] point = vertex.getPointRef(); if (Double.isNaN(vertex.getValue())) { simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false); } } // Sort the simplex from best to worst. Arrays.sort(simplex, comparator); }
/** * Compute the objective function value. * * @param point Point at which the objective function must be evaluated. * @return the objective function value at the specified point. * @throws TooManyEvaluationsException if the maximal number of * evaluations is exceeded. */ protected double computeObjectiveValue(double[] point) { try { evaluations.incrementCount(); } catch (MaxCountExceededException e) { throw new TooManyEvaluationsException(e.getMax()); } return function.value(point); }
= new PointValuePair(xR, evaluationFunction.value(xR), false); = new PointValuePair(xE, evaluationFunction.value(xE), false); = new PointValuePair(xC, evaluationFunction.value(xC), false); if (comparator.compare(outContracted, reflected) <= 0) { = new PointValuePair(xC, evaluationFunction.value(xC), false);
= new PointValuePair(xR, evaluationFunction.value(xR), false); = new PointValuePair(xE, evaluationFunction.value(xE), false); = new PointValuePair(xC, evaluationFunction.value(xC), false); if (comparator.compare(outContracted, reflected) <= 0) { = new PointValuePair(xC, evaluationFunction.value(xC), false);
public double getValue(double [] point) { return minmax*fn.value(point); }
return bounded.value(point);
/** * Compute the underlying function value from an unbounded point. * <p> * This method simply bounds the unbounded point using the mappings * set up at construction and calls the underlying function using * the bounded point. * </p> * @param point unbounded value * @return underlying function value * @see #unboundedToBounded(double[]) */ public double value(double[] point) { return bounded.value(unboundedToBounded(point)); }
/** Compute the underlying function value from an unbounded point. * <p> * This method simply bounds the unbounded point using the mappings * set up at construction and calls the underlying function using * the bounded point. * </p> * @param point unbounded value * @return underlying function value * @see #unboundedToBounded(double[]) */ public double value(double[] point) { return bounded.value(unboundedToBounded(point)); }
/** * Compute the underlying function value from an unbounded point. * <p> * This method simply bounds the unbounded point using the mappings * set up at construction and calls the underlying function using * the bounded point. * </p> * @param point unbounded value * @return underlying function value * @see #unboundedToBounded(double[]) */ public double value(double[] point) { return bounded.value(unboundedToBounded(point)); }
/** * Computes the objective function value. * This method <em>must</em> be called by subclasses to enforce the * evaluation counter limit. * * @param params Point at which the objective function must be evaluated. * @return the objective function value at the specified point. * @throws TooManyEvaluationsException if the maximal number of * evaluations is exceeded. */ public double computeObjectiveValue(double[] params) { super.incrementEvaluationCount(); return function.value(params); } }
/** * Computes the objective function value. * This method <em>must</em> be called by subclasses to enforce the * evaluation counter limit. * * @param params Point at which the objective function must be evaluated. * @return the objective function value at the specified point. * @throws TooManyEvaluationsException if the maximal number of * evaluations is exceeded. */ public double computeObjectiveValue(double[] params) { super.incrementEvaluationCount(); return function.value(params); } }
return bounded.value(point);
return bounded.value(point);
/** * Evaluate all the non-evaluated points of the simplex. * * @param evaluationFunction Evaluation function. * @param comparator Comparator to use to sort simplex vertices from best to worst. * @throws org.apache.commons.math3.exception.TooManyEvaluationsException * if the maximal number of evaluations is exceeded. */ public void evaluate(final MultivariateFunction evaluationFunction, final Comparator<PointValuePair> comparator) { // Evaluate the objective function at all non-evaluated simplex points. for (int i = 0; i < simplex.length; i++) { final PointValuePair vertex = simplex[i]; final double[] point = vertex.getPointRef(); if (Double.isNaN(vertex.getValue())) { simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false); } } // Sort the simplex from best to worst. Arrays.sort(simplex, comparator); }