Skip to content

num::bracketable_function

Defined in header <roots/concepts.hpp>

template <class F, class T = real>
concept bracketable_function = scalar_function<F, T> && std::totally_ordered<T>;

Function whose sign can be compared across an interval.

\[ f(a) \, f(b) < 0 \]

A sign change guarantees a root by the intermediate value theorem, which is what makes bisection and Brent's method unconditionally convergent. Whether a given \([a,b]\) brackets a root depends on the values, so it is checked by num::roots::debug::verify_bracket.