binary_search: binary_search

Description Usage Arguments Value

View source: R/binary_search.R

Description

Generic binary search algo: finding the input.

Usage

1
2
3
4
5
6
7
binary_search(
  target_value,
  monotone_function,
  init_bounds = NULL,
  error_gap = 1e-06,
  max_iters = 100L
)

Arguments

target_value

The value the function should achieve.

monotone_function

The function we want to find the relevant input for.

init_bounds

Default NULL; Bounds on the function being searched.

error_gap

Binary search until the gap between the function on the input and the target value is smaller than this number.

max_iters

Maximum umber of iterations to try.

Value

The input that gives target_value as output.


rzgross/uRbanmatching documentation built on Dec. 22, 2021, 8:20 p.m.