[][src]Struct amcl_wrapper::univar_poly::UnivarPolynomial

pub struct UnivarPolynomial(pub FieldElementVector);

Univariate polynomial represented with coefficients in a vector. The ith element of the vector is the coefficient of the ith degree term.

Implementations

impl UnivarPolynomial[src]

pub fn new(degree: usize) -> Self[src]

Return a zero polynomial of degree degree

pub fn new_constant(constant: FieldElement) -> Self[src]

Return a constant polynomial

pub fn random(degree: usize) -> Self[src]

Return a randomly chosen polynomial (each coefficient is randomly chosen) of degree degree.

pub fn new_with_roots(roots: &[FieldElement]) -> Self[src]

Create a polynomial with given roots in roots i.e. (x-roots[0])(x-roots[1])(x-roots[2])...(x-roots[last]) given roots

pub fn coefficients(&self) -> &FieldElementVector[src]

pub fn degree(&self) -> usize[src]

pub fn is_zero(&self) -> bool[src]

Polynomial is zero if all coefficients are 0

pub fn eval(&self, x: &FieldElement) -> FieldElement[src]

pub fn long_division(dividend: &Self, divisor: &Self) -> (Self, Self)[src]

Divides 2 polynomials i.e. dividend / divisor using long division. Returns (quotient, remainder)

pub fn multiply(left: &Self, right: &Self) -> Self[src]

Return product of 2 polynomials. left * right

pub fn sum(left: &Self, right: &Self) -> Self[src]

Return sum of 2 polynomials. left + right

pub fn difference(left: &Self, right: &Self) -> Self[src]

Return difference of 2 polynomials. left - right

pub fn multiply_by_constant(&self, constant: &FieldElement) -> UnivarPolynomial[src]

pub fn multiply_by_monic_monomial(
    &self,
    monomial_degree: u64
) -> UnivarPolynomial
[src]

Trait Implementations

impl<'a, '_> Add<&'a UnivarPolynomial> for &'_ UnivarPolynomial[src]

type Output = UnivarPolynomial

The resulting type after applying the + operator.

impl Clone for UnivarPolynomial[src]

impl Debug for UnivarPolynomial[src]

impl<'de> Deserialize<'de> for UnivarPolynomial[src]

impl Eq for UnivarPolynomial[src]

impl Index<usize> for UnivarPolynomial[src]

type Output = FieldElement

The returned type after indexing.

impl IndexMut<usize> for UnivarPolynomial[src]

impl<'a, '_> Mul<&'a UnivarPolynomial> for &'_ UnivarPolynomial[src]

type Output = UnivarPolynomial

The resulting type after applying the * operator.

impl PartialEq<UnivarPolynomial> for UnivarPolynomial[src]

impl Serialize for UnivarPolynomial[src]

impl StructuralPartialEq for UnivarPolynomial[src]

impl<'a, '_> Sub<&'a UnivarPolynomial> for &'_ UnivarPolynomial[src]

type Output = UnivarPolynomial

The resulting type after applying the - operator.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,