pub struct Sphere { /* private fields */ }Expand description
n-dimensional Sphere function.
It is continuous, convex and unimodal:
f(x) = ∑ᵢ xᵢ²
Global minimum: f(0,...,0) = 0
Implementations§
Trait Implementations§
Source§impl Problem for Sphere
impl Problem for Sphere
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Returns the dimensionality of the input domain.
Source§fn domain(&self) -> Vec<(f64, f64)>
fn domain(&self) -> Vec<(f64, f64)>
Returns the input domain of the function in terms of upper and lower,
respectively, for each input dimension.
Source§fn minimum(&self) -> (Vec<f64>, f64)
fn minimum(&self) -> (Vec<f64>, f64)
Returns the position as well as the value of the global minimum.
Source§fn random_start(&self) -> Vec<f64>
fn random_start(&self) -> Vec<f64>
Generates a random and feasible position to start a minimization.
Source§fn is_legal_position(&self, position: &[f64]) -> bool
fn is_legal_position(&self, position: &[f64]) -> bool
Tests whether the supplied position is legal for this function.
impl Copy for Sphere
Auto Trait Implementations§
impl Freeze for Sphere
impl RefUnwindSafe for Sphere
impl Send for Sphere
impl Sync for Sphere
impl Unpin for Sphere
impl UnwindSafe for Sphere
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