/** {@inheritDoc} */ @Override public void setMaximalCount(int max) { super.setMaximalCount(max); delegate = delegate.withMaximalCount(max); }
/** * Scans the list of (required and optional) optimization data that * characterize the problem. * * @param optData Optimization data. * The following data will be looked for: * <ul> * <li>{@link MaxEval}</li> * <li>{@link MaxIter}</li> * </ul> */ protected void parseOptimizationData(OptimizationData... optData) { // The existing values (as set by the previous call) are reused if // not provided in the argument list. for (OptimizationData data : optData) { if (data instanceof MaxEval) { evaluations.setMaximalCount(((MaxEval) data).getMaxEval()); continue; } if (data instanceof MaxIter) { iterations.setMaximalCount(((MaxIter) data).getMaxIter()); continue; } } }
/** * 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.setMaximalCount(maxEvaluations); }
/** {@inheritDoc} */ public UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max, double startValue) { // Checks. if (f == null) { throw new NullArgumentException(); } if (goalType == null) { throw new NullArgumentException(); } // Reset. searchMin = min; searchMax = max; searchStart = startValue; goal = goalType; function = f; evaluations.setMaximalCount(maxEval); evaluations.resetCount(); // Perform computation. return doOptimize(); }
super.setMaximalCount(delegate.getMaximalCount()); super.incrementCount(delegate.getCount());
throws TooManyEvaluationsException { evaluations.setMaximalCount(maxEval); evaluations.resetCount(); function = f;
DimensionMismatchException { evaluations.setMaximalCount(maxEval); evaluations.resetCount(); function = f;
/** {@inheritDoc} */ @Override public void setMaximalCount(int max) { super.setMaximalCount(max); delegate = delegate.withMaximalCount(max); }
/** {@inheritDoc} */ @Override public void setMaximalCount(int max) { super.setMaximalCount(max); delegate = delegate.withMaximalCount(max); }
/** * Scans the list of (required and optional) optimization data that * characterize the problem. * * @param optData Optimization data. * The following data will be looked for: * <ul> * <li>{@link MaxEval}</li> * <li>{@link MaxIter}</li> * </ul> */ protected void parseOptimizationData(OptimizationData... optData) { // The existing values (as set by the previous call) are reused if // not provided in the argument list. for (OptimizationData data : optData) { if (data instanceof MaxEval) { evaluations.setMaximalCount(((MaxEval) data).getMaxEval()); continue; } if (data instanceof MaxIter) { iterations.setMaximalCount(((MaxIter) data).getMaxIter()); continue; } } }
/** * Scans the list of (required and optional) optimization data that * characterize the problem. * * @param optData Optimization data. * The following data will be looked for: * <ul> * <li>{@link MaxEval}</li> * <li>{@link MaxIter}</li> * </ul> */ protected void parseOptimizationData(OptimizationData... optData) { // The existing values (as set by the previous call) are reused if // not provided in the argument list. for (OptimizationData data : optData) { if (data instanceof MaxEval) { evaluations.setMaximalCount(((MaxEval) data).getMaxEval()); continue; } if (data instanceof MaxIter) { iterations.setMaximalCount(((MaxIter) data).getMaxIter()); continue; } } }
/** * 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.setMaximalCount(maxEvaluations); }
iterations.setAccessible(true); final Incrementor incrementor = (Incrementor) iterations.get(solver); incrementor.setMaximalCount(2147483647); LOG.info(String.format("Max iterations: %d", solver.getMaxIterations())); final PointValuePair solved = solver.optimize(
iterations.setAccessible(true); final Incrementor incrementor = (Incrementor) iterations.get(solver); incrementor.setMaximalCount(2147483647); LOG.info(String.format("Max iterations: %d", solver.getMaxIterations())); final PointValuePair solved = solver.optimize(
super.setMaximalCount(delegate.getMaximalCount()); super.incrementCount(delegate.getCount());
/** {@inheritDoc} */ public UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max, double startValue) { // Checks. if (f == null) { throw new NullArgumentException(); } if (goalType == null) { throw new NullArgumentException(); } // Reset. searchMin = min; searchMax = max; searchStart = startValue; goal = goalType; function = f; evaluations.setMaximalCount(maxEval); evaluations.resetCount(); // Perform computation. return doOptimize(); }
super.setMaximalCount(delegate.getMaximalCount()); super.incrementCount(delegate.getCount());
throws TooManyEvaluationsException { evaluations.setMaximalCount(maxEval); evaluations.resetCount(); function = f;
DimensionMismatchException { evaluations.setMaximalCount(maxEval); evaluations.resetCount(); function = f;