pub enum Precision<T> {
Exact(T),
Inexact(T),
}Expand description
A statistic has a precision Exact or Inexact. This represents uncertainty in that value.
Exact values are computed, where can inexact values are likely inferred from compute functions.
Inexact statistics form a range of possible values that the statistic could be. This is statistic specific, for max this will be an upper bound. Meaning that the actual max in an array is guaranteed to be less than or equal to the inexact value, but equal to the exact value.
Variants§
Implementations§
Source§impl<T> Precision<T>
impl<T> Precision<T>
Sourcepub fn into_inexact(self) -> Self
pub fn into_inexact(self) -> Self
Converts self into an inexact bound
Sourcepub fn as_exact(self) -> Option<T>
pub fn as_exact(self) -> Option<T>
Returns the exact value from the bound, if that value is inexact, otherwise None.
Sourcepub fn as_inexact(self) -> Option<T>
pub fn as_inexact(self) -> Option<T>
Returns the exact value from the bound, if that value is inexact, otherwise None.
Sourcepub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Precision<U>
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Precision<U>
Map the value of either precision value
Sourcepub fn zip<U>(self, other: Precision<U>) -> Precision<(T, U)>
pub fn zip<U>(self, other: Precision<U>) -> Precision<(T, U)>
Zip two Precision values into a tuple, keeping the inexactness if any.
Sourcepub fn try_map<U, F: FnOnce(T) -> VortexResult<U>>(
self,
f: F,
) -> VortexResult<Precision<U>>
pub fn try_map<U, F: FnOnce(T) -> VortexResult<U>>( self, f: F, ) -> VortexResult<Precision<U>>
Similar to map but handles fucntions that can fail.
Source§impl Precision<ScalarValue>
impl Precision<ScalarValue>
pub fn into_scalar(self, dtype: DType) -> Precision<Scalar>
Source§impl Precision<&ScalarValue>
impl Precision<&ScalarValue>
pub fn into_scalar(self, dtype: DType) -> Precision<Scalar>
Trait Implementations§
Source§impl<T: PartialOrd + Clone> StatBound<T> for Precision<T>
impl<T: PartialOrd + Clone> StatBound<T> for Precision<T>
Source§fn into_value(self) -> Precision<T>
fn into_value(self) -> Precision<T>
Self back to Precision<T>, inverse of lift.Source§fn union(&self, other: &Self) -> Option<Self>
fn union(&self, other: &Self) -> Option<Self>
meet of the bound.Source§fn intersection(&self, other: &Self) -> Option<IntersectionResult<Self>>
fn intersection(&self, other: &Self) -> Option<IntersectionResult<Self>>
None.
e.g. Precision::Inexact(5) and Precision::Exact(6) would result in Precision::Inexact(5).
A.k.a. the join of the bound.impl<T: Eq> Eq for Precision<T>
impl<T> StructuralPartialEq for Precision<T>
Auto Trait Implementations§
impl<T> Freeze for Precision<T>where
T: Freeze,
impl<T> RefUnwindSafe for Precision<T>where
T: RefUnwindSafe,
impl<T> Send for Precision<T>where
T: Send,
impl<T> Sync for Precision<T>where
T: Sync,
impl<T> Unpin for Precision<T>where
T: Unpin,
impl<T> UnwindSafe for Precision<T>where
T: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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