pub enum Valuation<F>where
F: ValuationRing,{
PosInf,
Finite(F),
}Expand description
Represents valuations of ultrametric numbers
In the digital representation, this is the number of digits between decimal point and first nonzero digit, possibly negative. This struct can also be used to represent certainty. E.g.
let z = ZAdic::new_approx(5, 6, vec![0, 0, 3, 1, 2, 4]);
assert_eq!(Valuation::Finite(2), z.valuation());
assert_eq!(Valuation::Finite(6), z.certainty());
assert_eq!(Valuation::Finite(0), ZAdic::empty(5).valuation());
assert_eq!(Valuation::Finite(0), ZAdic::empty(5).certainty());
assert_eq!(Valuation::PosInf, UAdic::new(5, vec![]).valuation());
assert_eq!(Valuation::PosInf, UAdic::new(5, vec![]).certainty());
assert_eq!(Valuation::Finite(0), QAdic::new(UAdic::new(5, vec![1, 2]), 0).valuation());
assert_eq!(Valuation::Finite(2), QAdic::new(UAdic::new(5, vec![1, 2]), 2).valuation());
assert_eq!(Valuation::Finite(-2), QAdic::new(UAdic::new(5, vec![1, 2]), -2).valuation());
assert_eq!(Valuation::Finite(-1), QAdic::new(UAdic::new(5, vec![0, 2]), -2).valuation());
assert_eq!(Valuation::PosInf, QAdic::new(UAdic::zero(5), -2).valuation());Variants§
Implementations§
Source§impl<F> Valuation<F>where
F: ValuationRing,
impl<F> Valuation<F>where
F: ValuationRing,
Trait Implementations§
Source§impl<F> Add for Valuation<F>where
F: ValuationRing,
impl<F> Add for Valuation<F>where
F: ValuationRing,
impl<F> Copy for Valuation<F>where
F: ValuationRing + Copy,
impl<F> Eq for Valuation<F>where
F: ValuationRing + Eq,
Source§impl<F> From<F> for Valuation<F>where
F: ValuationRing,
impl<F> From<F> for Valuation<F>where
F: ValuationRing,
Source§impl<F> Mul for Valuation<F>where
F: ValuationRing,
impl<F> Mul for Valuation<F>where
F: ValuationRing,
Source§impl<F> Ord for Valuation<F>where
F: ValuationRing,
impl<F> Ord for Valuation<F>where
F: ValuationRing,
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<F> PartialOrd for Valuation<F>where
F: ValuationRing,
impl<F> PartialOrd for Valuation<F>where
F: ValuationRing,
impl<F> StructuralPartialEq for Valuation<F>where
F: ValuationRing + PartialEq,
Source§impl<F> Zero for Valuation<F>where
F: ValuationRing,
impl<F> Zero for Valuation<F>where
F: ValuationRing,
Auto Trait Implementations§
impl<F> Freeze for Valuation<F>where
F: Freeze,
impl<F> RefUnwindSafe for Valuation<F>where
F: RefUnwindSafe,
impl<F> Send for Valuation<F>where
F: Send,
impl<F> Sync for Valuation<F>where
F: Sync,
impl<F> Unpin for Valuation<F>where
F: Unpin,
impl<F> UnsafeUnpin for Valuation<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Valuation<F>where
F: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> LocalZero for Twhere
T: Zero,
impl<T> LocalZero for Twhere
T: Zero,
Source§fn local_zero(&self) -> T
fn local_zero(&self) -> T
Returns a zero local to
selfSource§fn is_local_zero(&self) -> bool
fn is_local_zero(&self) -> bool
Checks whether or not
self is equivalent to its local zeroSource§fn set_local_zero(&mut self)
fn set_local_zero(&mut self)
Sets the object equal to its local zero
Source§impl<A, N> PrimedInto<A> for Nwhere
A: PrimedFrom<N>,
impl<A, N> PrimedInto<A> for Nwhere
A: PrimedFrom<N>,
Source§impl<A, N> TryPrimedInto<A> for Nwhere
A: TryPrimedFrom<N>,
impl<A, N> TryPrimedInto<A> for Nwhere
A: TryPrimedFrom<N>,
Source§type Error = <A as TryPrimedFrom<N>>::Error
type Error = <A as TryPrimedFrom<N>>::Error
The type returned in the event of a conversion error