Skip to main content

FloatingZoneError

Enum FloatingZoneError 

Source
#[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.

Fields

§site: usize

Position of the invalid site.

§

StartingPointLength

The starting point has the wrong number of coordinates.

Fields

§expected: usize

Number of local dimensions.

§actual: usize

Number of supplied coordinates.

§

StartingCoordinate

A starting coordinate is outside its site’s local dimension.

Fields

§site: usize

Position of the invalid site.

§coordinate: usize

Supplied coordinate.

§dimension: usize

Exclusive upper bound for the coordinate.

§

InvalidInitialError

The supplied starting error is negative or nonfinite.

Fields

§value: f64

Supplied starting error.

§

InvalidTolerance

The stopping tolerance is negative or NaN.

Fields

§value: f64

Supplied stopping tolerance; positive infinity is permitted.

§

AllocationSizeOverflow

The coordinate scan’s vector storage cannot be represented.

Fields

§site: usize

Position of the site whose candidate batch is too large.

§

Evaluation(E)

The error-magnitude callback failed.

Trait Implementations§

Source§

impl<E: Debug> Debug for FloatingZoneError<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E> Display for FloatingZoneError<E>
where E: Display,

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E> Error for FloatingZoneError<E>
where E: Error + 'static, Self: Debug + Display,

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<E: PartialEq> PartialEq for FloatingZoneError<E>

Source§

fn eq(&self, other: &FloatingZoneError<E>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where 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 more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V