Struct abstalg::PolynomialAlgebra
source · [−]pub struct PolynomialAlgebra<A> where
A: AbelianGroup, { /* private fields */ }
Expand description
The ring of polynomials over a base ring or field where each element is represented as a vector whose last element, the leading coefficient (if any) must be non-zero. This means that the empty vector is the zero element, and every polynomial has a unique representation. Polynomials can be defined over any abelian group, though only the group operations will be available.
Implementations
sourceimpl<A> PolynomialAlgebra<A> where
A: AbelianGroup,
impl<A> PolynomialAlgebra<A> where
A: AbelianGroup,
Trait Implementations
sourceimpl<A> AbelianGroup for PolynomialAlgebra<A> where
A: AbelianGroup,
impl<A> AbelianGroup for PolynomialAlgebra<A> where
A: AbelianGroup,
sourcefn is_zero(&self, elem: &Self::Elem) -> bool
fn is_zero(&self, elem: &Self::Elem) -> bool
Checks if the given element is the additive identity of the ring.
sourcefn add(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
fn add(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
The additive sum of the given elements
sourcefn times(&self, num: isize, elem: &Self::Elem) -> Self::Elem
fn times(&self, num: isize, elem: &Self::Elem) -> Self::Elem
Returns an integer multiple of the given element.
sourcefn neg_assign(&self, elem: &mut Self::Elem)
fn neg_assign(&self, elem: &mut Self::Elem)
The element is changed to its additive inverse.
sourcefn add_assign(&self, elem1: &mut Self::Elem, elem2: &Self::Elem)
fn add_assign(&self, elem1: &mut Self::Elem, elem2: &Self::Elem)
The second element is added to the first one.
sourcefn sub(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
fn sub(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
The difference of the given elements.
sourcefn sub_assign(&self, elem1: &mut Self::Elem, elem2: &Self::Elem)
fn sub_assign(&self, elem1: &mut Self::Elem, elem2: &Self::Elem)
The second element is subtracted from the first one.
sourceimpl<A: Clone> Clone for PolynomialAlgebra<A> where
A: AbelianGroup,
impl<A: Clone> Clone for PolynomialAlgebra<A> where
A: AbelianGroup,
sourcefn clone(&self) -> PolynomialAlgebra<A>
fn clone(&self) -> PolynomialAlgebra<A>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<A: Debug> Debug for PolynomialAlgebra<A> where
A: AbelianGroup,
impl<A: Debug> Debug for PolynomialAlgebra<A> where
A: AbelianGroup,
sourceimpl<A> Domain for PolynomialAlgebra<A> where
A: AbelianGroup,
impl<A> Domain for PolynomialAlgebra<A> where
A: AbelianGroup,
sourceimpl<A> EuclideanDomain for PolynomialAlgebra<A> where
A: Field,
impl<A> EuclideanDomain for PolynomialAlgebra<A> where
A: Field,
sourcefn quo_rem(
&self,
elem1: &Self::Elem,
elem2: &Self::Elem
) -> (Self::Elem, Self::Elem)
fn quo_rem(
&self,
elem1: &Self::Elem,
elem2: &Self::Elem
) -> (Self::Elem, Self::Elem)
Performs the euclidean division algorithm dividing the first elem with the second one and returning the quotient and the remainder. This method panics if the second element is zero (because there is no unique solution) Read more
sourcefn reduced(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
fn reduced(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
Returns true if the second element is zero or the first element has zero quotient by the second one. These are the representative elements of the factor ring by the principal ideal generated by the second element. Read more
sourcefn gcd(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
fn gcd(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
Calculates the greatest common divisor of two elements using the Euclidean algorithm. Read more
sourcefn lcm(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
fn lcm(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem
Calculates the lest common divisor of the two elements.
sourcefn extended_gcd(
&self,
elem1: &Self::Elem,
elem2: &Self::Elem
) -> (Self::Elem, Self::Elem, Self::Elem)
fn extended_gcd(
&self,
elem1: &Self::Elem,
elem2: &Self::Elem
) -> (Self::Elem, Self::Elem, Self::Elem)
Performs the extended Euclidean algorithm which returns the greatest common divisor, and two elements that multiplied with the inputs gives the greatest common divisor. Read more
sourcefn relative_primes(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
fn relative_primes(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
Checks if the given two elements are relative prime.
sourceimpl<A> IntegralDomain for PolynomialAlgebra<A> where
A: IntegralDomain,
impl<A> IntegralDomain for PolynomialAlgebra<A> where
A: IntegralDomain,
sourcefn try_div(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Option<Self::Elem>
fn try_div(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Option<Self::Elem>
Checks if the second element divides the first one and returns the unique quotient if it exists. This method panics if the second element is zero (because there would be no unique solution). Read more
sourcefn associate_repr(&self, elem: &Self::Elem) -> Self::Elem
fn associate_repr(&self, elem: &Self::Elem) -> Self::Elem
We assume, that among all associates of the given elem there is a well defined unique one (non-negative for integers, zero or monic for polynomials). This method returns that representative element. Read more
sourcefn associate_coef(&self, elem: &Self::Elem) -> Self::Elem
fn associate_coef(&self, elem: &Self::Elem) -> Self::Elem
Returns the unique invertible element which is the quotient of the associate representative and the given element. This method panics if the element is zero. Read more
sourcefn divisible(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
fn divisible(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
Checks if the first element is a multiple of (or divisible by) the second one. Read more
sourcefn associates(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
fn associates(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool
Returns true if the two elements are associates (divide each other)
sourceimpl<A> Monoid for PolynomialAlgebra<A> where
A: AbelianGroup + Monoid,
impl<A> Monoid for PolynomialAlgebra<A> where
A: AbelianGroup + Monoid,
sourcefn is_one(&self, elem: &Self::Elem) -> bool
fn is_one(&self, elem: &Self::Elem) -> bool
Checks if the given element is the multiplicative identity.
sourcefn try_inv(&self, elem: &Self::Elem) -> Option<Self::Elem>
fn try_inv(&self, elem: &Self::Elem) -> Option<Self::Elem>
Calculates the multiplicative inverse of the given element if it exists.
sourcefn invertible(&self, elem: &Self::Elem) -> bool
fn invertible(&self, elem: &Self::Elem) -> bool
Returns true if the given element has a multiplicative inverse.
sourceimpl<A> Semigroup for PolynomialAlgebra<A> where
A: AbelianGroup + Semigroup,
impl<A> Semigroup for PolynomialAlgebra<A> where
A: AbelianGroup + Semigroup,
sourceimpl<A> UnitaryRing for PolynomialAlgebra<A> where
A: UnitaryRing,
impl<A> UnitaryRing for PolynomialAlgebra<A> where
A: UnitaryRing,
Auto Trait Implementations
impl<A> RefUnwindSafe for PolynomialAlgebra<A> where
A: RefUnwindSafe,
impl<A> Send for PolynomialAlgebra<A> where
A: Send,
impl<A> Sync for PolynomialAlgebra<A> where
A: Sync,
impl<A> Unpin for PolynomialAlgebra<A> where
A: Unpin,
impl<A> UnwindSafe for PolynomialAlgebra<A> where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more