pub struct NonfiniteFlags {
pub has_nan: bool,
pub has_infinity: bool,
}Expand description
Named result of a non-finite scan over stored scalar values.
The two flags are independent: a payload can contain both NaN and infinity,
and Default is the all-finite result. Use it instead of a positional
(has_nan, has_infinity) pair so call sites name the flag they read.
This reports what the scan found; it does not classify, replace, or mask the
values. See Storage::payload_nonfinite_flags for the compact-payload
scan and tensor4all_core for the native-tensor scan over a different
representation.
§Examples
use tensor4all_tensorbackend::NonfiniteFlags;
let finite = NonfiniteFlags::default();
assert!(!finite.has_nan && !finite.has_infinity);
let flags = NonfiniteFlags {
has_nan: true,
has_infinity: false,
};
assert!(flags.has_nan);
assert_ne!(flags, finite);Fields§
§has_nan: boolAt least one scanned real or imaginary component is NaN.
has_infinity: boolAt least one scanned real or imaginary component is infinite.
Trait Implementations§
Source§impl Clone for NonfiniteFlags
impl Clone for NonfiniteFlags
Source§fn clone(&self) -> NonfiniteFlags
fn clone(&self) -> NonfiniteFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NonfiniteFlags
Source§impl Debug for NonfiniteFlags
impl Debug for NonfiniteFlags
Source§impl Default for NonfiniteFlags
impl Default for NonfiniteFlags
Source§fn default() -> NonfiniteFlags
fn default() -> NonfiniteFlags
Returns the “default value” for a type. Read more
impl Eq for NonfiniteFlags
Source§impl PartialEq for NonfiniteFlags
impl PartialEq for NonfiniteFlags
impl StructuralPartialEq for NonfiniteFlags
Auto Trait Implementations§
impl Freeze for NonfiniteFlags
impl RefUnwindSafe for NonfiniteFlags
impl Send for NonfiniteFlags
impl Sync for NonfiniteFlags
impl Unpin for NonfiniteFlags
impl UnsafeUnpin for NonfiniteFlags
impl UnwindSafe for NonfiniteFlags
Blanket Implementations§
impl<T> Boilerplate for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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