Struct snarkvm_algorithms::fft::SparsePolynomial[][src]

pub struct SparsePolynomial<F: Field> {
    pub coeffs: Vec<(usize, F)>,
}

Stores a sparse polynomial in coefficient form.

Fields

coeffs: Vec<(usize, F)>

The coefficient a_i of x^i is stored as (i, a_i) in self.coeffs. the entries in self.coeffs are sorted in increasing order of i.

Implementations

impl<F: Field> SparsePolynomial<F>[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: &[(usize, F)]) -> Self[src]

Constructs a new polynomial from a list of coefficients.

pub fn from_coefficients_vec(coeffs: Vec<(usize, F)>) -> Self[src]

Constructs a new polynomial from a list of coefficients.

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

Returns the degree of the polynomial.

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

Evaluates self at the given point in the field.

pub fn mul(&self, other: &Self) -> Self[src]

Perform a naive n^2 multiplicatoin of self by other.

impl<F: PrimeField> SparsePolynomial<F>[src]

pub fn evaluate_over_domain_by_ref(
    &self,
    domain: EvaluationDomain<F>
) -> Evaluations<F>
[src]

Evaluate self over domain.

pub fn evaluate_over_domain(self, domain: EvaluationDomain<F>) -> Evaluations<F>[src]

Evaluate self over domain.

Trait Implementations

impl<F: Field> CanonicalDeserialize for SparsePolynomial<F>[src]

impl<F: Field> CanonicalSerialize for SparsePolynomial<F>[src]

impl<F: Clone + Field> Clone for SparsePolynomial<F>[src]

impl<F: Field> Debug for SparsePolynomial<F>[src]

impl<F: Default + Field> Default for SparsePolynomial<F>[src]

impl<F: Eq + Field> Eq for SparsePolynomial<F>[src]

impl<'a, F: Field> From<&'a SparsePolynomial<F>> for DenseOrSparsePolynomial<'a, F>[src]

impl<F: Field> From<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F>[src]

impl<F: Hash + Field> Hash for SparsePolynomial<F>[src]

impl<F: Field> Into<DensePolynomial<F>> for SparsePolynomial<F>[src]

impl<F: PartialEq + Field> PartialEq<SparsePolynomial<F>> for SparsePolynomial<F>[src]

impl<F: Field> StructuralEq for SparsePolynomial<F>[src]

impl<F: Field> StructuralPartialEq for SparsePolynomial<F>[src]

impl<F: Field> TryInto<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F>[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<F> RefUnwindSafe for SparsePolynomial<F> where
    F: RefUnwindSafe

impl<F> Send for SparsePolynomial<F>

impl<F> Sync for SparsePolynomial<F>

impl<F> Unpin for SparsePolynomial<F> where
    F: Unpin

impl<F> UnwindSafe for SparsePolynomial<F> where
    F: UnwindSafe

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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