Trait ndarray_stats::MaybeNan
source · pub trait MaybeNan: Sized {
type NotNan;
// Required methods
fn is_nan(&self) -> bool;
fn try_as_not_nan(&self) -> Option<&Self::NotNan>;
fn from_not_nan(_: Self::NotNan) -> Self;
fn from_not_nan_opt(_: Option<Self::NotNan>) -> Self;
fn from_not_nan_ref_opt(_: Option<&Self::NotNan>) -> &Self;
fn remove_nan_mut(
_: ArrayViewMut1<'_, Self>,
) -> ArrayViewMut1<'_, Self::NotNan>;
}
Expand description
A number type that can have not-a-number values.
Required Associated Types§
Required Methods§
sourcefn try_as_not_nan(&self) -> Option<&Self::NotNan>
fn try_as_not_nan(&self) -> Option<&Self::NotNan>
Tries to convert the value to NotNan
.
Returns None
if the value is a NaN value.
sourcefn from_not_nan(_: Self::NotNan) -> Self
fn from_not_nan(_: Self::NotNan) -> Self
Converts the value.
If the value is None
, a NaN value is returned.
sourcefn from_not_nan_opt(_: Option<Self::NotNan>) -> Self
fn from_not_nan_opt(_: Option<Self::NotNan>) -> Self
Converts the value.
If the value is None
, a NaN value is returned.
sourcefn from_not_nan_ref_opt(_: Option<&Self::NotNan>) -> &Self
fn from_not_nan_ref_opt(_: Option<&Self::NotNan>) -> &Self
Converts the value.
If the value is None
, a NaN value is returned.
sourcefn remove_nan_mut(_: ArrayViewMut1<'_, Self>) -> ArrayViewMut1<'_, Self::NotNan>
fn remove_nan_mut(_: ArrayViewMut1<'_, Self>) -> ArrayViewMut1<'_, Self::NotNan>
Returns a view with the NaN values removed.
This modifies the input view by moving elements as necessary. The final order of the elements is unspecified. However, this method is idempotent, and given the same input data, the result is always ordered the same way.
Object Safety§
This trait is not object safe.