bsearch

Function bsearch 

Source
pub fn bsearch<Oracle>(
    omega: &mut Oracle,
    intrvl: &mut (f64, f64),
    options: &Options,
) -> (bool, usize)
where Oracle: OracleBS,
Expand description

The bsearch function performs a binary search to find a feasible solution within a given interval.

Arguments:

  • omega: The parameter omega is an instance of the Oracle trait, which is used to perform assessments on a value x0. The specific implementation of the Oracle trait is not provided in the code snippet, so it could be any type that implements the necessary methods for the binary search
  • intrvl: The intrvl parameter is an interval containing the gamma value x*. It is represented as a mutable reference to a tuple (f64, f64), where the first element is the lower bound of the interval and the second element is the upper bound of the interval.
  • options: The options parameter is a struct that contains various options for the binary search algorithm. It includes properties such as the maximum number of iterations (max_iters) and the error tolerance (``). These options control the termination criteria for the algorithm.

Returns:

The function bsearch returns a tuple of two values: a boolean indicating whether a feasible solution was obtained, and the number of iterations performed.