pub struct Adelic<F: Finite> { /* private fields */ }Expand description
A value carried at the finite places (F) and the infinite place (Ball).
Implementations§
Source§impl<F: Finite> Adelic<F>
impl<F: Finite> Adelic<F>
Sourcepub fn from_parts(finite: F, infinite: Ball) -> Self
pub fn from_parts(finite: F, infinite: Ball) -> Self
Assemble from a finite component and its real enclosure.
Sourcepub fn sign(&self) -> Option<Sign>
pub fn sign(&self) -> Option<Sign>
Sign, from the infinite place (the only place that can see it).
Sourcepub fn cmp(&self, other: &Self) -> Option<Ordering>
pub fn cmp(&self, other: &Self) -> Option<Ordering>
Ordering, from the infinite place (None ⇒ refine).
Sourcepub fn with_basis(&self, basis: Basis) -> Self
pub fn with_basis(&self, basis: Basis) -> Self
Re-encode the finite part over a (possibly larger) basis. Requires the infinite place to pin the exact value (true for all integer values and for any width-0 ball).
Source§impl Adelic<RnsInt>
impl Adelic<RnsInt>
Sourcepub fn from_bigint(n: &BigInt, basis: Basis) -> Self
pub fn from_bigint(n: &BigInt, basis: Basis) -> Self
From an exact BigInt over basis (the infinite place pins the value).
Sourcepub fn try_exact(&self) -> Result<BigInt, RangeError>
pub fn try_exact(&self) -> Result<BigInt, RangeError>
The exact integer, or RangeError::ReconstructionFailed if the finite
reconstruction disagrees with the infinite place (basis too small).
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Adelic<F>where
F: Freeze,
impl<F> RefUnwindSafe for Adelic<F>where
F: RefUnwindSafe,
impl<F> Send for Adelic<F>where
F: Send,
impl<F> Sync for Adelic<F>where
F: Sync,
impl<F> Unpin for Adelic<F>where
F: Unpin,
impl<F> UnsafeUnpin for Adelic<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Adelic<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 more