evaluations.increment(); y[1] = f.value(x[1]); if (Precision.equals(y[1].getReal(), 0.0, 1)) { evaluations.increment(); y[0] = f.value(x[0]); if (Precision.equals(y[0].getReal(), 0.0, 1)) { evaluations.increment(); y[2] = f.value(x[2]); if (Precision.equals(y[2].getReal(), 0.0, 1)) { evaluations.increment(); final T nextY = f.value(nextX); if (Precision.equals(nextY.getReal(), 0.0, 1)) {
/** {@inheritDoc} */ public Integer next() { final int value = count; increment(); return value; }
/** {@inheritDoc} */ @Override public void incrementCount() { super.incrementCount(); delegate.increment(); }
/** {@inheritDoc} */ @Override public void incrementCount() { super.incrementCount(); delegate.increment(); }
/** Increment the number of iterations. * @exception MaxCountExceededException if the number of iterations * exceeds the allowed maximum number */ protected void incrementCount() throws MaxCountExceededException { count.increment(); }
/** * Increments the iteration count by one, and throws an exception if the * maximum number of iterations is reached. This method should be called at * the beginning of a new iteration. * * @throws MaxCountExceededException if the maximum number of iterations is * reached. */ public void incrementIterationCount() throws MaxCountExceededException { iterations.increment(); }
/** Increment the number of iterations. * @exception MaxCountExceededException if the number of iterations * exceeds the allowed maximum number */ protected void incrementCount() throws MaxCountExceededException { count.increment(); }
/** {@inheritDoc} */ public Integer next() { final int value = count; increment(); return value; }
getCounter().increment(starter.getEvaluations());
getEvaluationsCounter().increment(starter.getEvaluations());
/** * Increment the evaluation count by one. * Method {@link #computeObjectiveValue(double)} calls this method internally. * It is provided for subclasses that do not exclusively use * {@code computeObjectiveValue} to solve the function. * See e.g. {@link AbstractUnivariateDifferentiableSolver}. * * @throws TooManyEvaluationsException when the allowed number of function * evaluations has been exhausted. */ protected void incrementEvaluationCount() throws TooManyEvaluationsException { try { evaluations.increment(); } catch (MaxCountExceededException e) { throw new TooManyEvaluationsException(e.getMax()); } } }
/** * Adds the increment value to the current iteration count. * At counter exhaustion, this method will call the * {@link MaxCountExceededCallback#trigger(int) trigger} method of the * callback object passed to the * {@link #withCallback(MaxCountExceededCallback)} method. * If not explicitly set, a default callback is used that will throw * a {@code MaxCountExceededException}. * * @throws MaxCountExceededException at counter exhaustion, unless a * custom {@link MaxCountExceededCallback callback} has been set. * * @see #increment(int) */ public void increment() throws MaxCountExceededException { increment(1); }
/** Compute the derivatives and check the number of evaluations. * @param t current value of the independent <I>time</I> variable * @param y array containing the current value of the state vector * @param yDot placeholder array where to put the time derivative of the state vector * @exception MaxCountExceededException if the number of functions evaluations is exceeded * @exception DimensionMismatchException if arrays dimensions do not match equations settings * @exception NullPointerException if the ODE equations have not been set (i.e. if this method * is called outside of a call to {@link #integrate(ExpandableStatefulODE, double)} or {@link * #integrate(FirstOrderDifferentialEquations, double, double[], double, double[])}) */ public void computeDerivatives(final double t, final double[] y, final double[] yDot) throws MaxCountExceededException, DimensionMismatchException, NullPointerException { evaluations.increment(); expandable.computeDerivatives(t, y, yDot); }
/** * 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); }
/** * @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.increment(); } catch (MaxCountExceededException e) { throw new TooManyEvaluationsException(e.getMax()); } return f.value(x); } }
/** Compute the derivatives and check the number of evaluations. * @param t current value of the independent <I>time</I> variable * @param y array containing the current value of the state vector * @return state completed with derivatives * @exception DimensionMismatchException if arrays dimensions do not match equations settings * @exception MaxCountExceededException if the number of functions evaluations is exceeded * @exception NullPointerException if the ODE equations have not been set (i.e. if this method * is called outside of a call to {@link #integrate(FieldExpandableODE, FieldODEState, * RealFieldElement) integrate} */ public T[] computeDerivatives(final T t, final T[] y) throws DimensionMismatchException, MaxCountExceededException, NullPointerException { evaluations.increment(); return equations.computeDerivatives(t, y); }
/** {@inheritDoc} */ @Override public void incrementCount() { super.incrementCount(); delegate.increment(); }
/** {@inheritDoc} */ public Integer next() { final int value = count; increment(); return value; }
/** Increment the number of iterations. * @exception MaxCountExceededException if the number of iterations * exceeds the allowed maximum number */ protected void incrementCount() throws MaxCountExceededException { count.increment(); }
/** * Increments the iteration count by one, and throws an exception if the * maximum number of iterations is reached. This method should be called at * the beginning of a new iteration. * * @throws MaxCountExceededException if the maximum number of iterations is * reached. */ public void incrementIterationCount() throws MaxCountExceededException { iterations.increment(); }