random-fu-0.2.7.7: Random number generation

Safe HaskellSafe
LanguageHaskell2010

Data.Random.Internal.Find

Synopsis

Documentation

findMax :: (Fractional a, Ord a) => (a -> Bool) -> a Source #

findMin :: (Fractional a, Ord a) => (a -> Bool) -> a Source #

Given an upward-closed predicate on an ordered Fractional type, find the smallest value satisfying the predicate.

findMinFrom :: (Fractional a, Ord a) => a -> a -> (a -> Bool) -> a Source #

Given an upward-closed predicate on an ordered Fractional type, find the smallest value satisfying the predicate. Starts at the specified point with the specified stepsize, performs an exponential search out from there until it finds an interval bracketing the change-point of the predicate, and then performs a bisection search to isolate the change point. Note that infinitely-divisible domains such as Rational cannot be searched by this function because it does not terminate until it reaches a point where further subdivision of the interval has no effect.