Function cmaes::cmaes_loop::cmaes_loop [] [src]

pub fn cmaes_loop<T>(object: &T, options: CMAESOptions) -> Option<(Vec<f64>, f64)> where T: 'static + FitnessFunction + Clone + Send + Sync

Minimizes a function. Takes as an argument a type that implements the FitnessFunction trait and an instance of the CMAESOptions struct. Returns a solution with as small a fitness as possible, along with the fitness value of the solution.

Panics

Panics if the fitness function panics or returns NaN or infinite, or if threads is 0. There are some checks to make sure invalid values do not show up anywhere. If the function returns None, please open an issue on the repository and include reproduction steps.