[][src]Trait algebraics::polynomial::PolynomialCoefficient

pub trait PolynomialCoefficient: Clone + Eq + Debug + Hash + Add<Output = Self> + Mul<Output = Self> + Sub<Output = Self> + Neg<Output = Self> + AddAssign + MulAssign + SubAssign + for<'a> Add<&'a Self, Output = Self> + for<'a> Sub<&'a Self, Output = Self> + for<'a> Mul<&'a Self, Output = Self> + for<'a> AddAssign<&'a Self> + for<'a> SubAssign<&'a Self> + for<'a> MulAssign<&'a Self> {
    type Element: PolynomialCoefficientElement;
    type Divisor: Clone + Eq + Debug + Hash + Mul<Output = Self::Divisor> + MulAssign + for<'a> Mul<&'a Self::Divisor, Output = Self::Divisor> + for<'a> MulAssign<&'a Self::Divisor> + ExactDiv<Output = Self::Divisor> + ExactDivAssign + for<'a> ExactDiv<&'a Self::Divisor, Output = Self::Divisor> + for<'a> ExactDivAssign<&'a Self::Divisor> + GCD<Output = Self::Divisor> + One;

    const NESTING_DEPTH: usize;

    fn is_element_zero(element: &Self::Element) -> bool;
fn is_element_one(element: &Self::Element) -> bool;
fn is_coefficient_zero(coefficient: &Self) -> bool;
fn is_coefficient_one(coefficient: &Self) -> bool;
fn set_element_zero(element: &mut Self::Element);
fn set_element_one(element: &mut Self::Element);
fn set_coefficient_zero(coefficient: &mut Self);
fn set_coefficient_one(coefficient: &mut Self);
fn mul_element_by_usize(
        element: Cow<Self::Element>,
        multiplier: usize
    ) -> Self::Element;
fn mul_assign_element_by_usize(
        element: &mut Self::Element,
        multiplier: usize
    );
fn divisor_to_element(
        v: Cow<Self::Divisor>,
        other_element: Cow<Self::Element>
    ) -> Self::Element;
fn coefficients_to_elements(
        coefficients: Cow<[Self]>
    ) -> (Vec<Self::Element>, Self::Divisor);
fn make_coefficient(
        element: Cow<Self::Element>,
        divisor: Cow<Self::Divisor>
    ) -> Self;
fn reduce_divisor(
        elements: &mut [Self::Element],
        divisor: &mut Self::Divisor
    );
fn coefficient_to_element(
        coefficient: Cow<Self>
    ) -> (Self::Element, Self::Divisor); fn make_zero_element(element: Cow<Self::Element>) -> Self::Element { ... }
fn make_one_element(element: Cow<Self::Element>) -> Self::Element { ... }
fn make_zero_coefficient_from_element(element: Cow<Self::Element>) -> Self { ... }
fn make_one_coefficient_from_element(element: Cow<Self::Element>) -> Self { ... }
fn make_zero_coefficient_from_coefficient(coefficient: Cow<Self>) -> Self { ... }
fn make_one_coefficient_from_coefficient(coefficient: Cow<Self>) -> Self { ... }
fn negate_element(element: &mut Self::Element) { ... }
fn get_reduced_divisor(
        elements: &[Self::Element],
        divisor: &Self::Divisor
    ) -> (Vec<Self::Element>, Self::Divisor) { ... }
fn divisor_pow_usize(base: Self::Divisor, exponent: usize) -> Self::Divisor { ... }
fn element_pow_usize(base: Self::Element, exponent: usize) -> Self::Element { ... }
fn coefficient_pow_usize(base: Self, exponent: usize) -> Self { ... }
fn from_iterator<I: Iterator<Item = Self>>(iter: I) -> Polynomial<Self> { ... } }

Associated Types

type Element: PolynomialCoefficientElement

type Divisor: Clone + Eq + Debug + Hash + Mul<Output = Self::Divisor> + MulAssign + for<'a> Mul<&'a Self::Divisor, Output = Self::Divisor> + for<'a> MulAssign<&'a Self::Divisor> + ExactDiv<Output = Self::Divisor> + ExactDivAssign + for<'a> ExactDiv<&'a Self::Divisor, Output = Self::Divisor> + for<'a> ExactDivAssign<&'a Self::Divisor> + GCD<Output = Self::Divisor> + One

Loading content...

Associated Constants

Loading content...

Required methods

fn is_element_zero(element: &Self::Element) -> bool

fn is_element_one(element: &Self::Element) -> bool

fn is_coefficient_zero(coefficient: &Self) -> bool

fn is_coefficient_one(coefficient: &Self) -> bool

fn set_element_zero(element: &mut Self::Element)

fn set_element_one(element: &mut Self::Element)

fn set_coefficient_zero(coefficient: &mut Self)

fn set_coefficient_one(coefficient: &mut Self)

fn mul_element_by_usize(
    element: Cow<Self::Element>,
    multiplier: usize
) -> Self::Element

fn mul_assign_element_by_usize(element: &mut Self::Element, multiplier: usize)

fn divisor_to_element(
    v: Cow<Self::Divisor>,
    other_element: Cow<Self::Element>
) -> Self::Element

fn coefficients_to_elements(
    coefficients: Cow<[Self]>
) -> (Vec<Self::Element>, Self::Divisor)

fn make_coefficient(
    element: Cow<Self::Element>,
    divisor: Cow<Self::Divisor>
) -> Self

fn reduce_divisor(elements: &mut [Self::Element], divisor: &mut Self::Divisor)

fn coefficient_to_element(
    coefficient: Cow<Self>
) -> (Self::Element, Self::Divisor)

Loading content...

Provided methods

fn make_zero_element(element: Cow<Self::Element>) -> Self::Element

fn make_one_element(element: Cow<Self::Element>) -> Self::Element

fn make_zero_coefficient_from_element(element: Cow<Self::Element>) -> Self

fn make_one_coefficient_from_element(element: Cow<Self::Element>) -> Self

fn make_zero_coefficient_from_coefficient(coefficient: Cow<Self>) -> Self

fn make_one_coefficient_from_coefficient(coefficient: Cow<Self>) -> Self

fn negate_element(element: &mut Self::Element)

fn get_reduced_divisor(
    elements: &[Self::Element],
    divisor: &Self::Divisor
) -> (Vec<Self::Element>, Self::Divisor)

fn divisor_pow_usize(base: Self::Divisor, exponent: usize) -> Self::Divisor

fn element_pow_usize(base: Self::Element, exponent: usize) -> Self::Element

fn coefficient_pow_usize(base: Self, exponent: usize) -> Self

fn from_iterator<I: Iterator<Item = Self>>(iter: I) -> Polynomial<Self>

Loading content...

Implementations on Foreign Types

impl<T: PolynomialCoefficientElement + Integer + for<'a> ExactDivAssign<&'a T> + ExactDivAssign + NumAssign + FromPrimitive + GCD<Output = T>> PolynomialCoefficient for Ratio<T>[src]

type Element = T

type Divisor = T

impl PolynomialCoefficient for i8[src]

type Element = i8

type Divisor = DivisorIsOne

impl PolynomialCoefficient for i16[src]

type Element = i16

type Divisor = DivisorIsOne

impl PolynomialCoefficient for i32[src]

type Element = i32

type Divisor = DivisorIsOne

impl PolynomialCoefficient for i64[src]

type Element = i64

type Divisor = DivisorIsOne

impl PolynomialCoefficient for i128[src]

type Element = i128

type Divisor = DivisorIsOne

impl PolynomialCoefficient for isize[src]

type Element = isize

type Divisor = DivisorIsOne

impl PolynomialCoefficient for BigInt[src]

type Element = BigInt

type Divisor = DivisorIsOne

Loading content...

Implementors

impl<T: PolynomialCoefficient<Divisor = DivisorIsOne, Element = T> + One> PolynomialCoefficient for Polynomial<T> where
    T::Element: Zero + One
[src]

type Element = Polynomial<T>

type Divisor = DivisorIsOne

impl<V, M> PolynomialCoefficient for ModularInteger<V, M> where
    V: ModularReducePow<usize> + Eq + One + Zero + Debug + Hash,
    M: Modulus<V> + Debug + Hash
[src]

type Element = Self

type Divisor = DivisorIsOne

Loading content...