/// <summary>
        /// Prepare for computation.
        /// Subclasses must call this method if they override any of the
        /// {@code solve} methods.
        /// </summary>
        /// <param name="f"> Function to solve. </param>
        /// <param name="min"> Lower bound for the interval. </param>
        /// <param name="max"> Upper bound for the interval. </param>
        /// <param name="startValue"> Start value to use. </param>
        /// <param name="maxEval"> Maximum number of evaluations. </param>
        /// <exception cref="NullArgumentException"> if f is null </exception>
        protected internal virtual void Setup(int maxEval, FUNC f, double min, double max, double startValue)
        {
            // Checks.
            MyUtils.CheckNotNull(f);

            // Reset.
            this.searchMin   = min;
            this.searchMax   = max;
            this.searchStart = startValue;
            this.function    = f;
            this.evaluations.MaximalCount = maxEval;
            this.evaluations.ResetCount();
        }
        /// <summary>
        /// Prepare for computation.
        /// Subclasses must call this method if they override any of the
        /// {@code solve} methods.
        /// </summary>
        /// <param name="maxEval"> Maximum number of evaluations. </param>
        /// <param name="f"> the integrand function </param>
        /// <param name="lower"> the min bound for the interval </param>
        /// <param name="upper"> the upper bound for the interval </param>
        /// <exception cref="NullArgumentException"> if {@code f} is {@code null}. </exception>
        /// <exception cref="MathIllegalArgumentException"> if {@code min >= max}. </exception>
        protected internal virtual void Setup(int maxEval, UnivariateFunction f, double lower, double upper)
        {
            // Checks.
            MyUtils.CheckNotNull(f);
            UnivariateSolverUtils.VerifyInterval(lower, upper);

            // Reset.
            this.min      = lower;
            this.max      = upper;
            this.function = f;
            this.evaluations.MaximalCount = maxEval;
            this.evaluations.ResetCount();
            this.iterations.ResetCount();
        }