pub struct RastriginBoxed<P> { /* private fields */ }problems only.Expand description
Rastrigin function with explicit element-wise box bounds, suitable
for solvers that require BoxConstraints (e.g. CMA-ES variants
like MA-LSCh-CMA). Carries the bounds as data on the problem (tenet
4 in crate::core / CONTRIBUTING.md) and routes the cost through the
same raw rastrigin free function as the unconstrained
Rastrigin.
The standard search domain [−5.12, 5.12]ⁿ from Mühlenbein et al.
(1991) is the common case; build it with
RastriginBoxed::with_standard_bounds.
Implementations§
Source§impl RastriginBoxed<DVector<f64>>
impl RastriginBoxed<DVector<f64>>
Sourcepub fn with_standard_bounds(n: usize) -> Self
Available on crate feature nalgebra only.
pub fn with_standard_bounds(n: usize) -> Self
nalgebra only.Build the canonical Rastrigin instance on [−5.12, 5.12]ⁿ
for the requested dimension n.
Source§impl RastriginBoxed<Array1<f64>>
impl RastriginBoxed<Array1<f64>>
Sourcepub fn with_standard_bounds(n: usize) -> Self
Available on crate feature ndarray only.
pub fn with_standard_bounds(n: usize) -> Self
ndarray only.Build the canonical Rastrigin instance on [−5.12, 5.12]ⁿ
for the requested dimension n.
Source§impl RastriginBoxed<Col<f64>>
impl RastriginBoxed<Col<f64>>
Sourcepub fn with_standard_bounds(n: usize) -> Self
Available on crate feature faer only.
pub fn with_standard_bounds(n: usize) -> Self
faer only.Build the canonical Rastrigin instance on [−5.12, 5.12]ⁿ
for the requested dimension n.
Source§impl<P> RastriginBoxed<P>
impl<P> RastriginBoxed<P>
Source§impl RastriginBoxed<Vec<f64>>
impl RastriginBoxed<Vec<f64>>
Sourcepub fn with_standard_bounds(n: usize) -> Self
pub fn with_standard_bounds(n: usize) -> Self
Build the canonical Rastrigin instance on [−5.12, 5.12]ⁿ for
the requested dimension n.
Trait Implementations§
Source§impl BoxConstraints for RastriginBoxed<Vec<f64>>
impl BoxConstraints for RastriginBoxed<Vec<f64>>
Source§impl BoxConstraints for RastriginBoxed<DVector<f64>>
Available on crate feature nalgebra only.
impl BoxConstraints for RastriginBoxed<DVector<f64>>
nalgebra only.Source§impl BoxConstraints for RastriginBoxed<Array1<f64>>
Available on crate feature ndarray only.
impl BoxConstraints for RastriginBoxed<Array1<f64>>
ndarray only.Source§impl BoxConstraints for RastriginBoxed<Col<f64>>
Available on crate feature faer only.
impl BoxConstraints for RastriginBoxed<Col<f64>>
faer only.Source§impl CostFunction for RastriginBoxed<Vec<f64>>
impl CostFunction for RastriginBoxed<Vec<f64>>
Source§type Output = f64
type Output = f64
f64 (see CONTRIBUTING.md’s
provisional choices).Source§type Error = Infallible
type Error = Infallible
std::convert::Infallible when the cost cannot fail — its
niche optimization keeps Result<f64, Infallible> the same
layout as bare f64 on the happy path.Source§impl CostFunction for RastriginBoxed<DVector<f64>>
Available on crate feature nalgebra only.
impl CostFunction for RastriginBoxed<DVector<f64>>
nalgebra only.Source§type Param = Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>
type Param = Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>
Source§type Output = f64
type Output = f64
f64 (see CONTRIBUTING.md’s
provisional choices).Source§type Error = Infallible
type Error = Infallible
std::convert::Infallible when the cost cannot fail — its
niche optimization keeps Result<f64, Infallible> the same
layout as bare f64 on the happy path.Source§impl CostFunction for RastriginBoxed<Array1<f64>>
Available on crate feature ndarray only.
impl CostFunction for RastriginBoxed<Array1<f64>>
ndarray only.Source§type Param = ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
type Param = ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
Source§type Output = f64
type Output = f64
f64 (see CONTRIBUTING.md’s
provisional choices).Source§type Error = Infallible
type Error = Infallible
std::convert::Infallible when the cost cannot fail — its
niche optimization keeps Result<f64, Infallible> the same
layout as bare f64 on the happy path.Source§impl CostFunction for RastriginBoxed<Col<f64>>
Available on crate feature faer only.
impl CostFunction for RastriginBoxed<Col<f64>>
faer only.Source§type Output = f64
type Output = f64
f64 (see CONTRIBUTING.md’s
provisional choices).Source§type Error = Infallible
type Error = Infallible
std::convert::Infallible when the cost cannot fail — its
niche optimization keeps Result<f64, Infallible> the same
layout as bare f64 on the happy path.Source§impl<P> HasSpec for RastriginBoxed<P>
impl<P> HasSpec for RastriginBoxed<P>
Source§const SPEC: &'static ProblemSpec
const SPEC: &'static ProblemSpec
Auto Trait Implementations§
impl<P> Freeze for RastriginBoxed<P>where
P: Freeze,
impl<P> RefUnwindSafe for RastriginBoxed<P>where
P: RefUnwindSafe,
impl<P> Send for RastriginBoxed<P>where
P: Send,
impl<P> Sync for RastriginBoxed<P>where
P: Sync,
impl<P> Unpin for RastriginBoxed<P>where
P: Unpin,
impl<P> UnsafeUnpin for RastriginBoxed<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for RastriginBoxed<P>where
P: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.