Struct pmcore::routines::optimization::d_optimizer::SppOptimizer
source · pub struct SppOptimizer<'a, E: Equation> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl<'a, E: Equation> CostFunction for SppOptimizer<'a, E>
impl<'a, E: Equation> CostFunction for SppOptimizer<'a, E>
§fn bulk_cost<P>(&self, params: &[P]) -> Result<Vec<Self::Output>, Error>where
P: Borrow<Self::Param> + SyncAlias,
Self::Output: SendAlias,
Self: SyncAlias,
fn bulk_cost<P>(&self, params: &[P]) -> Result<Vec<Self::Output>, Error>where
P: Borrow<Self::Param> + SyncAlias,
Self::Output: SendAlias,
Self: SyncAlias,
Compute
cost
in bulk. If the rayon
feature is enabled, multiple calls to cost
will be run in parallel using rayon
, otherwise they will execute sequentially. If the rayon
feature is enabled, parallelization can still be turned off by overwriting parallelize
to return false
. This can be useful in cases where it is preferable to parallelize only certain parts. Note that even if parallelize
is set to false, the parameter vectors and the problem are still required to be Send
and Sync
. Those bounds are linked to the rayon
feature. This method can be overwritten.§fn parallelize(&self) -> bool
fn parallelize(&self) -> bool
Indicates whether to parallelize calls to
cost
when using bulk_cost
. By default returns true, but can be set manually to false
if needed. This allows users to turn off parallelization for certain traits implemented on their problem. Note that parallelization requires the rayon
feature to be enabled, otherwise calls to cost
will be executed sequentially independent of how parallelize
is set.Auto Trait Implementations§
impl<'a, E> Freeze for SppOptimizer<'a, E>
impl<'a, E> RefUnwindSafe for SppOptimizer<'a, E>where
E: RefUnwindSafe,
impl<'a, E> Send for SppOptimizer<'a, E>
impl<'a, E> Sync for SppOptimizer<'a, E>
impl<'a, E> Unpin for SppOptimizer<'a, E>
impl<'a, E> UnwindSafe for SppOptimizer<'a, E>where
E: RefUnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.