/** {@inheritDoc} */ public double value(double x) { double r = x; for (int i = f.length - 1; i >= 0; i--) { r = f[i].value(r); } return r; } };
/** {@inheritDoc} */ @Override public ArrayRealVector mapToSelf(UnivariateFunction function) { for (int i = 0; i < data.length; i++) { data[i] = function.value(data[i]); } return this; }
/** {@inheritDoc} */ public double value() { final double result = f.value(arg); arg += inc; return result; } };
/** {@inheritDoc} */ public double boundedToUnbounded(final double x) { return unboundingFunction.value(x); } }
/** {@inheritDoc} */ public double unboundedToBounded(final double y) { return boundingFunction.value(y); }
/** {@inheritDoc} */ public double value(final double x) throws MathIllegalArgumentException { return function.value(x); }
/** {@inheritDoc} */ public double unboundedToBounded(final double y) { return boundingFunction.value(y); }
/** {@inheritDoc} */ public double boundedToUnbounded(final double x) { return unboundingFunction.value(x); }
/** {@inheritDoc} */ public double value(final double x) throws MathIllegalArgumentException { return f.value(MathUtils.reduce(x, period, offset)); } };
/** * Compute the objective function value. * * @param point Point at which the objective function must be evaluated. * @return the objective function value at specified point. * @throws TooManyEvaluationsException if the maximal number of evaluations is exceeded. */ protected double computeDerivativeObjectiveValue(double point) throws TooManyEvaluationsException { incrementEvaluationCount(); return functionDerivative.value(point); }
/** * Compute the objective function value. * * @param point Point at which the objective function must be evaluated. * @return the objective function value at specified point. * @throws TooManyEvaluationsException if the maximal number of evaluations * is exceeded. */ protected double computeObjectiveValue(double point) throws TooManyEvaluationsException { incrementEvaluationCount(); return function.value(point); }
/** * Computes the objective function value. * This method <em>must</em> be called by subclasses to enforce the * evaluation counter limit. * * @param x 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 x) { super.incrementEvaluationCount(); return function.value(x); } }
/** * @param f Function. * @param x Argument. * @return {@code f(x)} * @throws TooManyEvaluationsException if the maximal number of evaluations is * exceeded. */ private double eval(UnivariateFunction f, double x) { try { evaluations.incrementCount(); } catch (MaxCountExceededException e) { throw new TooManyEvaluationsException(e.getMax()); } return f.value(x); } }
/** * Compute the objective function value. * * @param point Point at which the objective function must be evaluated. * @return the objective function value at 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); }
/** * Compute the objective function value. * * @param point Point at which the objective function must be evaluated. * @return the objective function value at specified point. * @throws TooManyEvaluationsException if the maximal number of function * evaluations is exceeded. */ protected double computeObjectiveValue(final double point) throws TooManyEvaluationsException { try { evaluations.increment(); } catch (MaxCountExceededException e) { throw new TooManyEvaluationsException(e.getMax()); } return function.value(point); }
/** {@inheritDoc} */ public DerivativeStructure value(final DerivativeStructure t) throws MathIllegalArgumentException { // check we can achieve the requested derivation order with the sample if (t.getOrder() >= nbPoints) { throw new NumberIsTooLargeException(t.getOrder(), nbPoints, false); } // compute sample position, trying to be centered if possible final double t0 = FastMath.max(FastMath.min(t.getValue(), tMax), tMin) - halfSampleSpan; // compute sample points final double[] y = new double[nbPoints]; for (int i = 0; i < nbPoints; ++i) { y[i] = function.value(t0 + i * stepSize); } // evaluate derivatives return evaluate(t, t0, y); }