Template Function ADS::exponentialSearch

Function Documentation

template<std::integral I, class P>
I ADS::exponentialSearch(P &&p, I lo = I(0))

exponentialSearch(): the least i >= lo with p( i ), p false and then true from lo; O( log( i - lo + 1 ) ) evaluations of p

Pre:

p( i ) for some i >= lo of the type I

Post:

p( r ), and r == lo or ! p( r - 1 )