pub struct ConstructiveGcd { /* private fields */ }Expand description
A constructive GCD computation over the integers using the Euclidean algorithm.
Corresponds to the kernel axiom GCDDomain.
Implementations§
Source§impl ConstructiveGcd
impl ConstructiveGcd
Sourcepub fn gcd(&self, a: i64, b: i64) -> i64
pub fn gcd(&self, a: i64, b: i64) -> i64
Compute gcd(a, b) via the Euclidean algorithm (constructive, terminating).
Sourcepub fn extended_gcd(&self, a: i64, b: i64) -> (i64, i64, i64)
pub fn extended_gcd(&self, a: i64, b: i64) -> (i64, i64, i64)
Extended Euclidean algorithm: returns (g, s, t) with g = gcd(a,b), sa + tb = g.
Trait Implementations§
Source§impl Clone for ConstructiveGcd
impl Clone for ConstructiveGcd
Source§fn clone(&self) -> ConstructiveGcd
fn clone(&self) -> ConstructiveGcd
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstructiveGcd
impl Debug for ConstructiveGcd
Source§impl Default for ConstructiveGcd
impl Default for ConstructiveGcd
Source§impl PartialEq for ConstructiveGcd
impl PartialEq for ConstructiveGcd
impl Copy for ConstructiveGcd
impl Eq for ConstructiveGcd
impl StructuralPartialEq for ConstructiveGcd
Auto Trait Implementations§
impl Freeze for ConstructiveGcd
impl RefUnwindSafe for ConstructiveGcd
impl Send for ConstructiveGcd
impl Sync for ConstructiveGcd
impl Unpin for ConstructiveGcd
impl UnsafeUnpin for ConstructiveGcd
impl UnwindSafe for ConstructiveGcd
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