/** Build an instance. * @param name name of the method */ public AbstractIntegrator(final String name) { this.name = name; stepHandlers = new ArrayList<StepHandler>(); stepStart = Double.NaN; stepSize = Double.NaN; eventsStates = new ArrayList<EventState>(); statesInitialized = false; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(Integer.MAX_VALUE); }
/** Build an instance. * @param field field to which the time and state vector elements belong * @param name name of the method */ protected AbstractFieldIntegrator(final Field<T> field, final String name) { this.field = field; this.name = name; stepHandlers = new ArrayList<FieldStepHandler<T>>(); stepStart = null; stepSize = null; eventsStates = new ArrayList<FieldEventState<T>>(); statesInitialized = false; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(Integer.MAX_VALUE); }
/** * Creates a new instance of this class. * * @param maxIterations the maximum number of iterations */ public IterationManager(final int maxIterations) { this.iterations = IntegerSequence.Incrementor.create().withMaximalCount(maxIterations); this.listeners = new CopyOnWriteArrayList<IterationListener>(); }
/** * Create a bracketing interval finder. * * @param growLimit Expanding factor. * @param maxEvaluations Maximum number of evaluations allowed for finding * a bracketing interval. */ public BracketFinder(double growLimit, int maxEvaluations) { if (growLimit <= 0) { throw new NotStrictlyPositiveException(growLimit); } if (maxEvaluations <= 0) { throw new NotStrictlyPositiveException(maxEvaluations); } this.growLimit = growLimit; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(maxEvaluations); }
/** * Create a bracketing interval finder. * * @param growLimit Expanding factor. * @param maxEvaluations Maximum number of evaluations allowed for finding * a bracketing interval. */ public BracketFinder(double growLimit, int maxEvaluations) { if (growLimit <= 0) { throw new NotStrictlyPositiveException(growLimit); } if (maxEvaluations <= 0) { throw new NotStrictlyPositiveException(maxEvaluations); } this.growLimit = growLimit; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(maxEvaluations); }
/** * Construct a solver with given accuracies. * * @param relativeAccuracy Maximum relative error. * @param absoluteAccuracy Maximum absolute error. * @param functionValueAccuracy Maximum function value error. */ protected BaseAbstractUnivariateSolver(final double relativeAccuracy, final double absoluteAccuracy, final double functionValueAccuracy) { this.absoluteAccuracy = absoluteAccuracy; this.relativeAccuracy = relativeAccuracy; this.functionValueAccuracy = functionValueAccuracy; this.evaluations = IntegerSequence.Incrementor.create(); }
/** * Construct a solver with given accuracies. * * @param relativeAccuracy Maximum relative error. * @param absoluteAccuracy Maximum absolute error. * @param functionValueAccuracy Maximum function value error. */ protected BaseAbstractUnivariateSolver(final double relativeAccuracy, final double absoluteAccuracy, final double functionValueAccuracy) { this.absoluteAccuracy = absoluteAccuracy; this.relativeAccuracy = relativeAccuracy; this.functionValueAccuracy = functionValueAccuracy; this.evaluations = IntegerSequence.Incrementor.create(); }
/** Build an instance. * @param field field to which the time and state vector elements belong * @param name name of the method */ protected AbstractFieldIntegrator(final Field<T> field, final String name) { this.field = field; this.name = name; stepHandlers = new ArrayList<FieldStepHandler<T>>(); stepStart = null; stepSize = null; eventsStates = new ArrayList<FieldEventState<T>>(); statesInitialized = false; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(Integer.MAX_VALUE); }
/** * Creates a new instance of this class. * * @param maxIterations the maximum number of iterations * @param callBack the function to be called when the maximum number of * iterations has been reached * @throws org.apache.commons.math3.exception.NullArgumentException if {@code callBack} is {@code null} * @since 3.6 */ public IterationManager(final int maxIterations, final IntegerSequence.Incrementor.MaxCountExceededCallback callBack) { this.iterations = IntegerSequence.Incrementor.create().withMaximalCount(maxIterations).withCallback(callBack); this.listeners = new CopyOnWriteArrayList<IterationListener>(); }
/** {@inheritDoc} */ public Iterator<Integer> iterator() { return Incrementor.create() .withStart(start) .withMaximalCount(max + (step > 0 ? 1 : -1)) .withIncrement(step); } }
/** * Creates a new instance of this class. * * @param maxIterations the maximum number of iterations */ public IterationManager(final int maxIterations) { this.iterations = IntegerSequence.Incrementor.create().withMaximalCount(maxIterations); this.listeners = new CopyOnWriteArrayList<IterationListener>(); }
/** {@inheritDoc} */ public Iterator<Integer> iterator() { return Incrementor.create() .withStart(start) .withMaximalCount(max + (step > 0 ? 1 : -1)) .withIncrement(step); } }
/** Build an instance. * @param name name of the method */ public AbstractIntegrator(final String name) { this.name = name; stepHandlers = new ArrayList<StepHandler>(); stepStart = Double.NaN; stepSize = Double.NaN; eventsStates = new ArrayList<EventState>(); statesInitialized = false; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(Integer.MAX_VALUE); }
/** Build an instance. * @param name name of the method */ public AbstractIntegrator(final String name) { this.name = name; stepHandlers = new ArrayList<StepHandler>(); stepStart = Double.NaN; stepSize = Double.NaN; eventsStates = new ArrayList<EventState>(); statesInitialized = false; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(Integer.MAX_VALUE); }
/** * Construct a solver. * * @param relativeAccuracy Relative accuracy. * @param absoluteAccuracy Absolute accuracy. * @param functionValueAccuracy Function value accuracy. * @param maximalOrder maximal order. * @exception NumberIsTooSmallException if maximal order is lower than 2 */ public FieldBracketingNthOrderBrentSolver(final T relativeAccuracy, final T absoluteAccuracy, final T functionValueAccuracy, final int maximalOrder) throws NumberIsTooSmallException { if (maximalOrder < 2) { throw new NumberIsTooSmallException(maximalOrder, 2, true); } this.field = relativeAccuracy.getField(); this.maximalOrder = maximalOrder; this.absoluteAccuracy = absoluteAccuracy; this.relativeAccuracy = relativeAccuracy; this.functionValueAccuracy = functionValueAccuracy; this.evaluations = IntegerSequence.Incrementor.create(); }
/** * Create a bracketing interval finder. * * @param growLimit Expanding factor. * @param maxEvaluations Maximum number of evaluations allowed for finding * a bracketing interval. */ public BracketFinder(double growLimit, int maxEvaluations) { if (growLimit <= 0) { throw new NotStrictlyPositiveException(growLimit); } if (maxEvaluations <= 0) { throw new NotStrictlyPositiveException(maxEvaluations); } this.growLimit = growLimit; evaluations = IntegerSequence.Incrementor.create().withMaximalCount(maxEvaluations); }
/** * Creates a new instance of this class. * * @param maxIterations the maximum number of iterations * @param callBack the function to be called when the maximum number of * iterations has been reached * @throws org.apache.commons.math3.exception.NullArgumentException if {@code callBack} is {@code null} * @since 3.6 */ public IterationManager(final int maxIterations, final IntegerSequence.Incrementor.MaxCountExceededCallback callBack) { this.iterations = IntegerSequence.Incrementor.create().withMaximalCount(maxIterations).withCallback(callBack); this.listeners = new CopyOnWriteArrayList<IterationListener>(); }
/** * Construct a solver with given accuracies. * * @param relativeAccuracy Maximum relative error. * @param absoluteAccuracy Maximum absolute error. * @param functionValueAccuracy Maximum function value error. */ protected BaseAbstractUnivariateSolver(final double relativeAccuracy, final double absoluteAccuracy, final double functionValueAccuracy) { this.absoluteAccuracy = absoluteAccuracy; this.relativeAccuracy = relativeAccuracy; this.functionValueAccuracy = functionValueAccuracy; this.evaluations = IntegerSequence.Incrementor.create(); }
/** {@inheritDoc} */ public Iterator<Integer> iterator() { return Incrementor.create() .withStart(start) .withMaximalCount(max + (step > 0 ? 1 : -1)) .withIncrement(step); } }