Trait ndarray_stats::MaybeNan[][src]

pub trait MaybeNan: Sized {
    type NotNan;
    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>; }

A number type that can have not-a-number values.

Associated Types

type NotNan[src]

A type that is guaranteed not to be a NaN value.

Loading content...

Required methods

fn is_nan(&self) -> bool[src]

Returns true if the value is a NaN value.

fn try_as_not_nan(&self) -> Option<&Self::NotNan>[src]

Tries to convert the value to NotNan.

Returns None if the value is a NaN value.

fn from_not_nan(_: Self::NotNan) -> Self[src]

Converts the value.

If the value is None, a NaN value is returned.

fn from_not_nan_opt(_: Option<Self::NotNan>) -> Self[src]

Converts the value.

If the value is None, a NaN value is returned.

fn from_not_nan_ref_opt(_: Option<&Self::NotNan>) -> &Self[src]

Converts the value.

If the value is None, a NaN value is returned.

fn remove_nan_mut(_: ArrayViewMut1<'_, Self>) -> ArrayViewMut1<'_, Self::NotNan>[src]

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.

Loading content...

Implementations on Foreign Types

impl MaybeNan for f32[src]

type NotNan = N32

impl MaybeNan for f64[src]

type NotNan = N64

impl MaybeNan for Option<u8>[src]

type NotNan = NotNone<u8>

impl MaybeNan for Option<u16>[src]

type NotNan = NotNone<u16>

impl MaybeNan for Option<u32>[src]

type NotNan = NotNone<u32>

impl MaybeNan for Option<u64>[src]

type NotNan = NotNone<u64>

impl MaybeNan for Option<u128>[src]

type NotNan = NotNone<u128>

impl MaybeNan for Option<i8>[src]

type NotNan = NotNone<i8>

impl MaybeNan for Option<i16>[src]

type NotNan = NotNone<i16>

impl MaybeNan for Option<i32>[src]

type NotNan = NotNone<i32>

impl MaybeNan for Option<i64>[src]

type NotNan = NotNone<i64>

impl MaybeNan for Option<i128>[src]

type NotNan = NotNone<i128>

impl MaybeNan for Option<N32>[src]

type NotNan = NotNone<N32>

impl MaybeNan for Option<N64>[src]

type NotNan = NotNone<N64>

Loading content...

Implementors

Loading content...