pub enum DEError {
BoundsMismatch {
lower_len: usize,
upper_len: usize,
},
InvalidBounds {
index: usize,
lower: f64,
upper: f64,
},
PopulationTooSmall {
pop_size: usize,
},
InvalidMutationFactor {
factor: f64,
},
InvalidCrossoverRate {
rate: f64,
},
X0DimensionMismatch {
expected: usize,
got: usize,
},
IntegralityDimensionMismatch {
expected: usize,
got: usize,
},
InvalidConfig {
message: String,
},
}Expand description
Errors that can occur during Differential Evolution optimization.
Variants§
BoundsMismatch
Lower and upper bounds have different lengths.
Fields
InvalidBounds
A lower bound exceeds its corresponding upper bound.
Fields
PopulationTooSmall
Population size is too small (must be >= 4).
InvalidMutationFactor
Mutation factor is out of valid range [0, 2].
InvalidCrossoverRate
Crossover rate is out of valid range [0, 1].
X0DimensionMismatch
Initial guess (x0) has wrong dimension.
IntegralityDimensionMismatch
Integrality mask has wrong dimension.
InvalidConfig
Generic invalid optimizer configuration.
Implementations§
Source§impl DEError
impl DEError
Sourcepub fn is_bounds_error(&self) -> bool
pub fn is_bounds_error(&self) -> bool
Returns true if this is a bounds-related error.
This includes BoundsMismatch and InvalidBounds variants.
Sourcepub fn is_config_error(&self) -> bool
pub fn is_config_error(&self) -> bool
Returns true if this is a configuration-related error.
This includes PopulationTooSmall, InvalidMutationFactor,
and InvalidCrossoverRate variants.
Sourcepub fn is_dimension_error(&self) -> bool
pub fn is_dimension_error(&self) -> bool
Returns true if this is a dimension mismatch error.
This includes X0DimensionMismatch and IntegralityDimensionMismatch.
Trait Implementations§
Source§impl Error for DEError
impl Error for DEError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for DEError
impl RefUnwindSafe for DEError
impl Send for DEError
impl Sync for DEError
impl Unpin for DEError
impl UnsafeUnpin for DEError
impl UnwindSafe for DEError
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
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
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.