mahf-bmf 0.1.0

A collection of common continuous benchmark functions for MAHF.
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Utility methods.

/// Scales a value from within \[-1, 1\] to the input domain \[min, max\].
pub fn input_domain(value: &f64, min: f64, max: f64) -> f64 {
    (value + 1.0) / 2.0 * (max - min) + min
}

/// Scales a value from within the input domain \[min, max\] to \[-1, 1\].
pub fn normalized_domain(value: &f64, min: f64, max: f64) -> f64 {
    2.0 * (value - min) / (max - min) - 1.0
}