Struct snarkvm_algorithms::fft::SparsePolynomial
source · pub struct SparsePolynomial<F: Field> { /* private fields */ }
Expand description
Stores a sparse polynomial in coefficient form.
Implementations
sourceimpl<F: Field> SparsePolynomial<F>
impl<F: Field> SparsePolynomial<F>
sourcepub fn from_coefficients_slice(coeffs: &[(usize, F)]) -> Self
pub fn from_coefficients_slice(coeffs: &[(usize, F)]) -> Self
Constructs a new polynomial from a list of coefficients.
sourcepub fn from_coefficients(coeffs: impl IntoIterator<Item = (usize, F)>) -> Self
pub fn from_coefficients(coeffs: impl IntoIterator<Item = (usize, F)>) -> Self
Constructs a new polynomial from a list of coefficients.
pub fn coeffs(&self) -> impl Iterator<Item = (&usize, &F)>
sourceimpl<F: PrimeField> SparsePolynomial<F>
impl<F: PrimeField> SparsePolynomial<F>
sourcepub fn evaluate_over_domain_by_ref(
&self,
domain: EvaluationDomain<F>
) -> Evaluations<F>
pub fn evaluate_over_domain_by_ref(
&self,
domain: EvaluationDomain<F>
) -> Evaluations<F>
Evaluate self
over domain
.
sourcepub fn evaluate_over_domain(self, domain: EvaluationDomain<F>) -> Evaluations<F>
pub fn evaluate_over_domain(self, domain: EvaluationDomain<F>) -> Evaluations<F>
Evaluate self
over domain
.
Trait Implementations
sourceimpl<'a, F: Field> AddAssign<&'a SparsePolynomial<F>> for DensePolynomial<F>
impl<'a, F: Field> AddAssign<&'a SparsePolynomial<F>> for DensePolynomial<F>
sourcefn add_assign(&mut self, other: &'a SparsePolynomial<F>)
fn add_assign(&mut self, other: &'a SparsePolynomial<F>)
Performs the
+=
operation. Read moresourceimpl<'a, F: PrimeField> AddAssign<&'a SparsePolynomial<F>> for SparsePolynomial<F>
impl<'a, F: PrimeField> AddAssign<&'a SparsePolynomial<F>> for SparsePolynomial<F>
sourcefn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
Performs the
+=
operation. Read moresourceimpl<'a, F: PrimeField> AddAssign<(F, &'a SparsePolynomial<F>)> for SparsePolynomial<F>
impl<'a, F: PrimeField> AddAssign<(F, &'a SparsePolynomial<F>)> for SparsePolynomial<F>
sourcefn add_assign(&mut self, (f, other): (F, &'a Self))
fn add_assign(&mut self, (f, other): (F, &'a Self))
Performs the
+=
operation. Read moresourceimpl<F: Field> CanonicalDeserialize for SparsePolynomial<F>
impl<F: Field> CanonicalDeserialize for SparsePolynomial<F>
fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate
) -> Result<Self, SerializationError>
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
sourceimpl<F: Field> CanonicalSerialize for SparsePolynomial<F>
impl<F: Field> CanonicalSerialize for SparsePolynomial<F>
fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress
) -> Result<(), SerializationError>
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
sourceimpl<F: Clone + Field> Clone for SparsePolynomial<F>
impl<F: Clone + Field> Clone for SparsePolynomial<F>
sourcefn clone(&self) -> SparsePolynomial<F>
fn clone(&self) -> SparsePolynomial<F>
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 moresourceimpl<F: Field> Debug for SparsePolynomial<F>
impl<F: Field> Debug for SparsePolynomial<F>
sourceimpl<F: Default + Field> Default for SparsePolynomial<F>
impl<F: Default + Field> Default for SparsePolynomial<F>
sourcefn default() -> SparsePolynomial<F>
fn default() -> SparsePolynomial<F>
Returns the “default value” for a type. Read more
sourceimpl<'a, F: Field> From<&'a SparsePolynomial<F>> for Polynomial<'a, F>
impl<'a, F: Field> From<&'a SparsePolynomial<F>> for Polynomial<'a, F>
sourcefn from(other: &'a SparsePolynomial<F>) -> Self
fn from(other: &'a SparsePolynomial<F>) -> Self
Converts to this type from the input type.
sourceimpl<F: Field> From<SparsePolynomial<F>> for DensePolynomial<F>
impl<F: Field> From<SparsePolynomial<F>> for DensePolynomial<F>
sourcefn from(other: SparsePolynomial<F>) -> Self
fn from(other: SparsePolynomial<F>) -> Self
Converts to this type from the input type.
sourceimpl<F: Field> From<SparsePolynomial<F>> for Polynomial<'_, F>
impl<F: Field> From<SparsePolynomial<F>> for Polynomial<'_, F>
sourcefn from(other: SparsePolynomial<F>) -> Self
fn from(other: SparsePolynomial<F>) -> Self
Converts to this type from the input type.
sourceimpl<F: Hash + Field> Hash for SparsePolynomial<F>
impl<F: Hash + Field> Hash for SparsePolynomial<F>
sourceimpl<'a, F: PrimeField> Mul<F> for &'a SparsePolynomial<F>
impl<'a, F: PrimeField> Mul<F> for &'a SparsePolynomial<F>
sourceimpl<F: PrimeField> MulAssign<F> for SparsePolynomial<F>
impl<F: PrimeField> MulAssign<F> for SparsePolynomial<F>
sourcefn mul_assign(&mut self, other: F)
fn mul_assign(&mut self, other: F)
Performs the
*=
operation. Read moresourceimpl<F: PartialEq + Field> PartialEq<SparsePolynomial<F>> for SparsePolynomial<F>
impl<F: PartialEq + Field> PartialEq<SparsePolynomial<F>> for SparsePolynomial<F>
sourcefn eq(&self, other: &SparsePolynomial<F>) -> bool
fn eq(&self, other: &SparsePolynomial<F>) -> bool
sourceimpl<'a, F: Field> Sub<&'a SparsePolynomial<F>> for DensePolynomial<F>
impl<'a, F: Field> Sub<&'a SparsePolynomial<F>> for DensePolynomial<F>
type Output = DensePolynomial<F>
type Output = DensePolynomial<F>
The resulting type after applying the
-
operator.sourcefn sub(self, other: &'a SparsePolynomial<F>) -> Self::Output
fn sub(self, other: &'a SparsePolynomial<F>) -> Self::Output
Performs the
-
operation. Read moresourceimpl<F: Field> TryInto<SparsePolynomial<F>> for Polynomial<'_, F>
impl<F: Field> TryInto<SparsePolynomial<F>> for Polynomial<'_, F>
sourceimpl<F: Field> Valid for SparsePolynomial<F>
impl<F: Field> Valid for SparsePolynomial<F>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send
) -> Result<(), SerializationError>where
Self: 'a,
impl<F: Eq + Field> Eq for SparsePolynomial<F>
impl<F: Field> StructuralEq for SparsePolynomial<F>
impl<F: Field> StructuralPartialEq for SparsePolynomial<F>
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>
impl<F> UnwindSafe for SparsePolynomial<F>where
F: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.