Optimize a function returning a single numeric value subject to a boolean constraint Utilizes a naive recursive grid search.
sequentialGridSearch(f, constraint, bounds, nEach = 40, shrink = 10,
tol = .Machine$double.eps^0.5, verbose = FALSE, ...)
Function to be minimized: takes a single numeric value and returns a single numeric value.
Function of a single variable returning a single boolean value (must be TRUE to be at the optimum).
A numeric vector of length two which are the upper and lower bounds of the input to try.
Number of points n each round of grid searching to use.
Factor indicating how much (1/shrink) to narrow the search width by each round; highly recommended that shrink is at least half the size of nEach.
The tolerance (epsilon).
Whether to display verbose output.
Arguments to pass along to constraint.
The optimized input value (numeric).