/** * Solve for a zero in the given interval. * A solver may require that the interval brackets a single zero root. * Solvers that do require bracketing should be able to handle the case * where one of the endpoints is itself a root. * * @param maxEval Maximum number of evaluations. * @param f Function to solve. * @param min Lower bound for the interval. * @param max Upper bound for the interval. * @param allowedSolution The kind of solutions that the root-finding algorithm may * accept as solutions. * @return a value where the function is zero. * @exception NullArgumentException if f is null. * @exception NoBracketingException if root cannot be bracketed */ public T solve(final int maxEval, final RealFieldUnivariateFunction<T> f, final T min, final T max, final AllowedSolution allowedSolution) throws NullArgumentException, NoBracketingException { return solve(maxEval, f, min, max, min.add(max).divide(2), allowedSolution); }
/** * Solve for a zero in the given interval. * A solver may require that the interval brackets a single zero root. * Solvers that do require bracketing should be able to handle the case * where one of the endpoints is itself a root. * * @param maxEval Maximum number of evaluations. * @param f Function to solve. * @param min Lower bound for the interval. * @param max Upper bound for the interval. * @param allowedSolution The kind of solutions that the root-finding algorithm may * accept as solutions. * @return a value where the function is zero. * @exception NullArgumentException if f is null. * @exception NoBracketingException if root cannot be bracketed */ public T solve(final int maxEval, final RealFieldUnivariateFunction<T> f, final T min, final T max, final AllowedSolution allowedSolution) throws NullArgumentException, NoBracketingException { return solve(maxEval, f, min, max, min.add(max).divide(2), allowedSolution); }