Struct ExtendedGcd

pub struct ExtendedGcd<A> { pub gcd: A, pub x: A, pub y: A }

Greatest common divisor and Bézout coefficients

let e = isize::extended_gcd(a, b);
assert_eq!(e.gcd, e.x*a + e.y*b);

Fields

gcd: A
x: A
y: A

Trait Implementations

impl<A: Clone> Clone for ExtendedGcd<A>

fn clone(&self) -> ExtendedGcd<A>

impl<A: Copy> Copy for ExtendedGcd<A>

impl<A: Debug> Debug for ExtendedGcd<A>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<A: Eq> Eq for ExtendedGcd<A>

impl<A: PartialEq> PartialEq for ExtendedGcd<A>

fn eq(&self, other: &ExtendedGcd<A>) -> bool

impl<A: PartialEq> StructuralPartialEq for ExtendedGcd<A>

Auto Trait Implementations

impl<A> Freeze for ExtendedGcd<A> where A: Freeze + Freeze + Freeze,

impl<A> RefUnwindSafe for ExtendedGcd<A> where A: RefUnwindSafe + RefUnwindSafe + RefUnwindSafe,

impl<A> Send for ExtendedGcd<A> where A: Send + Send + Send,

impl<A> Sync for ExtendedGcd<A> where A: Sync + Sync + Sync,

impl<A> Unpin for ExtendedGcd<A> where A: Unpin + Unpin + Unpin,

impl<A> UnsafeUnpin for ExtendedGcd<A> where A: UnsafeUnpin + UnsafeUnpin + UnsafeUnpin,

impl<A> UnwindSafe for ExtendedGcd<A> where A: UnwindSafe + UnwindSafe + UnwindSafe,

Blanket Implementations

impl<T> Any for ExtendedGcd<A> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for ExtendedGcd<A> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for ExtendedGcd<A> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for ExtendedGcd<A> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for ExtendedGcd<A>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for ExtendedGcd<A> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for ExtendedGcd<A> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for ExtendedGcd<A> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for ExtendedGcd<A> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>