#[non_exhaustive]pub enum FloatingZoneError<E> {
InvalidLocalDimension {
site: usize,
},
StartingPointLength {
expected: usize,
actual: usize,
},
StartingCoordinate {
site: usize,
coordinate: usize,
dimension: usize,
},
InvalidInitialError {
value: f64,
},
InvalidTolerance {
value: f64,
},
AllocationSizeOverflow {
site: usize,
},
Evaluation(E),
}Expand description
Invalid search inputs or an error from a floating-zone evaluator.
floating_zone_walk_with_initial_error validates the supplied starting
residual before evaluating any candidate. Callback failures retain their
original type in Self::Evaluation.
§Examples
use tensor4all_core::{floating_zone_walk_with_initial_error, FloatingZoneError};
let result = floating_zone_walk_with_initial_error::<_, std::convert::Infallible>(
&[2], &vec![], 0.0, 0, 1.0, |_, _| unreachable!(),
);
assert_eq!(result, Err(FloatingZoneError::StartingPointLength {
expected: 1, actual: 0,
}));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidLocalDimension
A site’s local dimension is zero.
StartingPointLength
The starting point has the wrong number of coordinates.
StartingCoordinate
A starting coordinate is outside its site’s local dimension.
Fields
InvalidInitialError
The supplied starting error is negative or nonfinite.
InvalidTolerance
The stopping tolerance is negative or NaN.
AllocationSizeOverflow
The coordinate scan’s vector storage cannot be represented.
Evaluation(E)
The error-magnitude callback failed.
Trait Implementations§
Source§impl<E: Debug> Debug for FloatingZoneError<E>
impl<E: Debug> Debug for FloatingZoneError<E>
Source§impl<E> Display for FloatingZoneError<E>where
E: Display,
impl<E> Display for FloatingZoneError<E>where
E: Display,
Source§impl<E> Error for FloatingZoneError<E>
impl<E> Error for FloatingZoneError<E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl<E: PartialEq> PartialEq for FloatingZoneError<E>
impl<E: PartialEq> PartialEq for FloatingZoneError<E>
impl<E: PartialEq> StructuralPartialEq for FloatingZoneError<E>
Auto Trait Implementations§
impl<E> Freeze for FloatingZoneError<E>where
E: Freeze,
impl<E> RefUnwindSafe for FloatingZoneError<E>where
E: RefUnwindSafe,
impl<E> Send for FloatingZoneError<E>where
E: Send,
impl<E> Sync for FloatingZoneError<E>where
E: Sync,
impl<E> Unpin for FloatingZoneError<E>where
E: Unpin,
impl<E> UnsafeUnpin for FloatingZoneError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for FloatingZoneError<E>where
E: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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<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> ⓘ
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