pub struct Bounds { /* private fields */ }Expand description
An axis-aligned box [lower_i, upper_i] per coordinate.
use evolutionary_planning::operators::{Initializer, real::Bounds};
use evolutionary_planning::SplitMix64;
let bounds = Bounds::uniform(3, -5.0, 5.0);
let x = bounds.clone().initialize(&mut SplitMix64::new(1));
assert!(bounds.contains(&x));Implementations§
Source§impl Bounds
impl Bounds
Sourcepub fn new(lower: Vec<f64>, upper: Vec<f64>) -> Self
pub fn new(lower: Vec<f64>, upper: Vec<f64>) -> Self
Creates a box from per-coordinate bounds.
§Panics
Panics if the lengths differ, a bound is not finite, or lower[i] > upper[i].
Trait Implementations§
impl StructuralPartialEq for Bounds
Auto Trait Implementations§
impl Forget for Bounds
impl Freeze for Bounds
impl Move for Bounds
impl RefUnwindSafe for Bounds
impl Send for Bounds
impl Sync for Bounds
impl Unpin for Bounds
impl UnsafeUnpin for Bounds
impl UnwindSafe for Bounds
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more