[][src]Struct dusk_plonk::fft::Polynomial

pub struct Polynomial {
    pub coeffs: Vec<Scalar>,
}

Polynomial represents a polynomial in coeffiient form.

Fields

coeffs: Vec<Scalar>

The coefficient of x^i is stored at location i in self.coeffs.

Implementations

impl Polynomial[src]

pub fn zero() -> Self[src]

Returns the zero polynomial.

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

Checks if the given polynomial is zero.

pub fn from_coefficients_slice(coeffs: &[Scalar]) -> Self[src]

Constructs a new polynomial from a list of coefficients.

pub fn from_coefficients_vec(coeffs: Vec<Scalar>) -> Self[src]

Constructs a new polynomial from a list of coefficients.

Panics

When the length of the coeffs is zero.

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

Returns the degree of the polynomial.

pub fn evaluate(&self, point: &Scalar) -> Scalar[src]

Evaluates self at the given point in the field.

pub fn rand<R: Rng>(d: usize, rng: &mut R) -> Self[src]

Outputs a polynomial of degree d where each coefficient is sampled uniformly at random from the field F.

impl Polynomial[src]

pub fn ruffini(&self, z: Scalar) -> Polynomial[src]

Divides self by x-z using Ruffinis method

Trait Implementations

impl<'a, 'b> Add<&'a Polynomial> for &'b Polynomial[src]

type Output = Polynomial

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Scalar> for &'b Polynomial[src]

Convenience Trait to sub a scalar and polynomial

type Output = Polynomial

The resulting type after applying the + operator.

impl<'a, 'b> AddAssign<&'a Polynomial> for Polynomial[src]

impl<'a, 'b> AddAssign<(Scalar, &'a Polynomial)> for Polynomial[src]

impl Clone for Polynomial[src]

impl Debug for Polynomial[src]

impl Deref for Polynomial[src]

type Target = [Scalar]

The resulting type after dereferencing.

impl DerefMut for Polynomial[src]

impl Eq for Polynomial[src]

impl<'a, 'b> Mul<&'a Polynomial> for &'b Polynomial[src]

Performs O(nlogn) multiplication of polynomials if F is smooth.

type Output = Polynomial

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'a Scalar> for &'b Polynomial[src]

Convenience Trait to multiply a scalar and polynomial

type Output = Polynomial

The resulting type after applying the * operator.

impl Neg for Polynomial[src]

type Output = Polynomial

The resulting type after applying the - operator.

impl PartialEq<Polynomial> for Polynomial[src]

impl StructuralEq for Polynomial[src]

impl StructuralPartialEq for Polynomial[src]

impl<'a, 'b> Sub<&'a Polynomial> for &'b Polynomial[src]

type Output = Polynomial

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'a Scalar> for &'b Polynomial[src]

type Output = Polynomial

The resulting type after applying the - operator.

impl<'a, 'b> SubAssign<&'a Polynomial> for Polynomial[src]

impl Sum<Polynomial> for Polynomial[src]

Auto Trait Implementations

impl RefUnwindSafe for Polynomial

impl Send for Polynomial

impl Sync for Polynomial

impl Unpin for Polynomial

impl UnwindSafe for Polynomial

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> From<T> for T[src]

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

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>,