evaluations = evaluations.withMaximalCount(maxEval).withStart(0); T zero = field.getZero(); T nan = zero.add(Double.NaN);
/** * Prepare for computation. * Subclasses must call this method if they override any of the * {@code solve} methods. * * @param maxEval Maximum number of evaluations. * @param f the integrand function * @param lower the min bound for the interval * @param upper the upper bound for the interval * @throws NullArgumentException if {@code f} is {@code null}. * @throws MathIllegalArgumentException if {@code min >= max}. */ protected void setup(final int maxEval, final UnivariateFunction f, final double lower, final double upper) throws NullArgumentException, MathIllegalArgumentException { // Checks. MathUtils.checkNotNull(f); UnivariateSolverUtils.verifyInterval(lower, upper); // Reset. min = lower; max = upper; function = f; evaluations = evaluations.withMaximalCount(maxEval).withStart(0); count = count.withStart(0); }
/** * Prepare for computation. * Subclasses must call this method if they override any of the * {@code solve} methods. * * @param maxEval Maximum number of evaluations. * @param f the integrand function * @param lower the min bound for the interval * @param upper the upper bound for the interval * @throws NullArgumentException if {@code f} is {@code null}. * @throws MathIllegalArgumentException if {@code min >= max}. */ protected void setup(final int maxEval, final UnivariateFunction f, final double lower, final double upper) throws NullArgumentException, MathIllegalArgumentException { // Checks. MathUtils.checkNotNull(f); UnivariateSolverUtils.verifyInterval(lower, upper); // Reset. min = lower; max = upper; function = f; evaluations = evaluations.withMaximalCount(maxEval).withStart(0); count = count.withStart(0); }
/** * Prepare for computation. * Subclasses must call this method if they override any of the * {@code solve} methods. * * @param f Function to solve. * @param min Lower bound for the interval. * @param max Upper bound for the interval. * @param startValue Start value to use. * @param maxEval Maximum number of evaluations. * @exception NullArgumentException if f is null */ protected void setup(int maxEval, FUNC f, double min, double max, double startValue) throws NullArgumentException { // Checks. MathUtils.checkNotNull(f); // Reset. searchMin = min; searchMax = max; searchStart = startValue; function = f; evaluations = evaluations.withMaximalCount(maxEval).withStart(0); }
/** * Prepare for computation. * Subclasses must call this method if they override any of the * {@code solve} methods. * * @param f Function to solve. * @param min Lower bound for the interval. * @param max Upper bound for the interval. * @param startValue Start value to use. * @param maxEval Maximum number of evaluations. * @exception NullArgumentException if f is null */ protected void setup(int maxEval, FUNC f, double min, double max, double startValue) throws NullArgumentException { // Checks. MathUtils.checkNotNull(f); // Reset. searchMin = min; searchMax = max; searchStart = startValue; function = f; evaluations = evaluations.withMaximalCount(maxEval).withStart(0); }
/** Prepare the start of an integration. * @param t0 start value of the independent <i>time</i> variable * @param y0 array containing the start value of the state vector * @param t target time for the integration */ protected void initIntegration(final double t0, final double[] y0, final double t) { evaluations = evaluations.withStart(0); for (final EventState state : eventsStates) { state.setExpandable(expandable); state.getEventHandler().init(t0, y0, t); } for (StepHandler handler : stepHandlers) { handler.init(t0, y0, t); } setStateInitialized(false); }
/** Prepare the start of an integration. * @param t0 start value of the independent <i>time</i> variable * @param y0 array containing the start value of the state vector * @param t target time for the integration */ protected void initIntegration(final double t0, final double[] y0, final double t) { evaluations = evaluations.withStart(0); for (final EventState state : eventsStates) { state.setExpandable(expandable); state.getEventHandler().init(t0, y0, t); } for (StepHandler handler : stepHandlers) { handler.init(t0, y0, t); } setStateInitialized(false); }
/** {@inheritDoc} */ @Override public void resetCount() { super.resetCount(); delegate = delegate.withStart(0); }
/** {@inheritDoc} */ @Override public void resetCount() { super.resetCount(); delegate = delegate.withStart(0); }
/** {@inheritDoc} */ public Iterator<Integer> iterator() { return Incrementor.create() .withStart(start) .withMaximalCount(max + (step > 0 ? 1 : -1)) .withIncrement(step); } }
/** * Sets the iteration count to 0. This method must be called during the * initial phase. */ public void resetIterationCount() { iterations = iterations.withStart(0); } }
/** {@inheritDoc} */ public Iterator<Integer> iterator() { return Incrementor.create() .withStart(start) .withMaximalCount(max + (step > 0 ? 1 : -1)) .withIncrement(step); } }
double xA, double xB) { evaluations = evaluations.withStart(0); final boolean isMinim = goal == GoalType.MINIMIZE;
/** Prepare the start of an integration. * @param eqn equations to integrate * @param t0 start value of the independent <i>time</i> variable * @param y0 array containing the start value of the state vector * @param t target time for the integration * @return initial state with derivatives added */ protected FieldODEStateAndDerivative<T> initIntegration(final FieldExpandableODE<T> eqn, final T t0, final T[] y0, final T t) { this.equations = eqn; evaluations = evaluations.withStart(0); // initialize ODE eqn.init(t0, y0, t); // set up derivatives of initial state final T[] y0Dot = computeDerivatives(t0, y0); final FieldODEStateAndDerivative<T> state0 = new FieldODEStateAndDerivative<T>(t0, y0, y0Dot); // initialize event handlers for (final FieldEventState<T> state : eventsStates) { state.getEventHandler().init(state0, t); } // initialize step handlers for (FieldStepHandler<T> handler : stepHandlers) { handler.init(state0, t); } setStateInitialized(false); return state0; }
/** * Prepare for computation. * Subclasses must call this method if they override any of the * {@code solve} methods. * * @param maxEval Maximum number of evaluations. * @param f the integrand function * @param lower the min bound for the interval * @param upper the upper bound for the interval * @throws NullArgumentException if {@code f} is {@code null}. * @throws MathIllegalArgumentException if {@code min >= max}. */ protected void setup(final int maxEval, final UnivariateFunction f, final double lower, final double upper) throws NullArgumentException, MathIllegalArgumentException { // Checks. MathUtils.checkNotNull(f); UnivariateSolverUtils.verifyInterval(lower, upper); // Reset. min = lower; max = upper; function = f; evaluations = evaluations.withMaximalCount(maxEval).withStart(0); count = count.withStart(0); }
/** * Prepare for computation. * Subclasses must call this method if they override any of the * {@code solve} methods. * * @param f Function to solve. * @param min Lower bound for the interval. * @param max Upper bound for the interval. * @param startValue Start value to use. * @param maxEval Maximum number of evaluations. * @exception NullArgumentException if f is null */ protected void setup(int maxEval, FUNC f, double min, double max, double startValue) throws NullArgumentException { // Checks. MathUtils.checkNotNull(f); // Reset. searchMin = min; searchMax = max; searchStart = startValue; function = f; evaluations = evaluations.withMaximalCount(maxEval).withStart(0); }
/** Prepare the start of an integration. * @param t0 start value of the independent <i>time</i> variable * @param y0 array containing the start value of the state vector * @param t target time for the integration */ protected void initIntegration(final double t0, final double[] y0, final double t) { evaluations = evaluations.withStart(0); for (final EventState state : eventsStates) { state.setExpandable(expandable); state.getEventHandler().init(t0, y0, t); } for (StepHandler handler : stepHandlers) { handler.init(t0, y0, t); } setStateInitialized(false); }
/** {@inheritDoc} */ @Override public void resetCount() { super.resetCount(); delegate = delegate.withStart(0); }
/** * Sets the iteration count to 0. This method must be called during the * initial phase. */ public void resetIterationCount() { iterations = iterations.withStart(0); } }
/** {@inheritDoc} */ public Iterator<Integer> iterator() { return Incrementor.create() .withStart(start) .withMaximalCount(max + (step > 0 ? 1 : -1)) .withIncrement(step); } }