/// Returns the GCD + Bezout's coefficients
Returns the GCD + Bezout's coefficients
Returns the GCD + Bezout ' s coefficients
pub fn extended_gcd(self, other: Polynomial) -> (Polynomial, Polynomial, Polynomial) {
        let (mut x, mut y) = (
            Polynomial::from_coefficients_slice(&[1u8]),
            Polynomial::from_coefficients_slice(&[1u8]),
        );
        let mut a = self.clone();
        let mut b = other.clone();
        if self == Polynomial::zero() {
            return (
                b,
                Polynomial::zero(),
                Polynomial::from_coefficients_slice(&[1u8]),
            );
        };
        let mut res = ((b.clone() / a.clone()).1).extended_gcd(a.clone());
        x = res.2 - ((b / a.clone()).0 * res.1.clone());
        y = res.1;
        (res.0, x, y)
    }
pub fn extended_gcd ( self , other : Polynomial ) -> ( Polynomial , Polynomial , Polynomial ) { let ( mut x , mut y ) = ( Polynomial :: from_coefficients_slice ( & [ 1u8 ] ) , Polynomial :: from_coefficients_slice ( & [ 1u8 ] ) , ) ; let mut a = self . clone ( ) ; let mut b = other . clone ( ) ; if self == Polynomial :: zero ( ) { return ( b , Polynomial :: zero ( ) , Polynomial :: from_coefficients_slice ( & [ 1u8 ] ) , ) ; } ; let mut res = ( ( b . clone ( ) / a . clone ( ) ) . 1 ) . extended_gcd ( a . clone ( ) ) ; x = res . 2 - ( ( b / a . clone ( ) ) . 0 * res . 1 . clone ( ) ) ; y = res . 1 ; ( res . 0 , x , y ) }
Returns the GCD + Bezout's coefficients
Returns the GCD + Bezout ' s coefficients
self
other
Polynomial