/** * Check whether the function takes opposite signs at the endpoints. * * @param lower Lower endpoint. * @param upper Upper endpoint. * @return {@code true} if the function values have opposite signs at the * given points. */ protected boolean isBracketing(final double lower, final double upper) { return UnivariateSolverUtils.isBracketing(function, lower, upper); }
/** * Check that the endpoints specify an interval and the end points * bracket a root. * * @param function Function. * @param lower Lower endpoint. * @param upper Upper endpoint. * @throws NoBracketingException if the function has the same sign at the * endpoints. * @throws NullArgumentException if {@code function} is {@code null}. */ public static void verifyBracketing(UnivariateFunction function, final double lower, final double upper) throws NullArgumentException, NoBracketingException { if (function == null) { throw new NullArgumentException(LocalizedFormats.FUNCTION); } verifyInterval(lower, upper); if (!isBracketing(function, lower, upper)) { throw new NoBracketingException(lower, upper, function.value(lower), function.value(upper)); } } }
/** * Check whether the function takes opposite signs at the endpoints. * * @param lower Lower endpoint. * @param upper Upper endpoint. * @return {@code true} if the function values have opposite signs at the * given points. */ protected boolean isBracketing(final double lower, final double upper) { return UnivariateSolverUtils.isBracketing(function, lower, upper); }
/** * Check whether the function takes opposite signs at the endpoints. * * @param lower Lower endpoint. * @param upper Upper endpoint. * @return {@code true} if the function values have opposite signs at the * given points. */ protected boolean isBracketing(final double lower, final double upper) { return UnivariateSolverUtils.isBracketing(function, lower, upper); }
/** * Check that the endpoints specify an interval and the end points * bracket a root. * * @param function Function. * @param lower Lower endpoint. * @param upper Upper endpoint. * @throws NoBracketingException if the function has the same sign at the * endpoints. * @throws NullArgumentException if {@code function} is {@code null}. */ public static void verifyBracketing(UnivariateFunction function, final double lower, final double upper) throws NullArgumentException, NoBracketingException { if (function == null) { throw new NullArgumentException(LocalizedFormats.FUNCTION); } verifyInterval(lower, upper); if (!isBracketing(function, lower, upper)) { throw new NoBracketingException(lower, upper, function.value(lower), function.value(upper)); } } }
/** * Check that the endpoints specify an interval and the end points * bracket a root. * * @param function Function. * @param lower Lower endpoint. * @param upper Upper endpoint. * @throws NoBracketingException if the function has the same sign at the * endpoints. * @throws NullArgumentException if {@code function} is {@code null}. */ public static void verifyBracketing(UnivariateFunction function, final double lower, final double upper) throws NullArgumentException, NoBracketingException { if (function == null) { throw new NullArgumentException(LocalizedFormats.FUNCTION); } verifyInterval(lower, upper); if (!isBracketing(function, lower, upper)) { throw new NoBracketingException(lower, upper, function.value(lower), function.value(upper)); } } }