Struct snarkvm_algorithms::fft::polynomial::SparsePolynomial
source · pub struct SparsePolynomial<F: Field> { /* private fields */ }
Expand description
Stores a sparse polynomial in coefficient form.
Implementations§
source§impl<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)>
source§impl<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§
source§impl<'a, F: Field> AddAssign<&'a SparsePolynomial<F>> for DensePolynomial<F>
impl<'a, F: Field> AddAssign<&'a SparsePolynomial<F>> for DensePolynomial<F>
source§fn add_assign(&mut self, other: &'a SparsePolynomial<F>)
fn add_assign(&mut self, other: &'a SparsePolynomial<F>)
Performs the
+=
operation. Read moresource§impl<'a, F: PrimeField> AddAssign<&'a SparsePolynomial<F>> for SparsePolynomial<F>
impl<'a, F: PrimeField> AddAssign<&'a SparsePolynomial<F>> for SparsePolynomial<F>
source§fn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
Performs the
+=
operation. Read moresource§impl<'a, F: PrimeField> AddAssign<(F, &'a SparsePolynomial<F>)> for SparsePolynomial<F>
impl<'a, F: PrimeField> AddAssign<(F, &'a SparsePolynomial<F>)> for SparsePolynomial<F>
source§fn add_assign(&mut self, (f, other): (F, &'a Self))
fn add_assign(&mut self, (f, other): (F, &'a Self))
Performs the
+=
operation. Read moresource§impl<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,
source§impl<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
source§impl<F: Clone + Field> Clone for SparsePolynomial<F>
impl<F: Clone + Field> Clone for SparsePolynomial<F>
source§fn clone(&self) -> SparsePolynomial<F>
fn clone(&self) -> SparsePolynomial<F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<F: Field> Debug for SparsePolynomial<F>
impl<F: Field> Debug for SparsePolynomial<F>
source§impl<F: Default + Field> Default for SparsePolynomial<F>
impl<F: Default + Field> Default for SparsePolynomial<F>
source§fn default() -> SparsePolynomial<F>
fn default() -> SparsePolynomial<F>
Returns the “default value” for a type. Read more
source§impl<'a, F: Field> From<&'a SparsePolynomial<F>> for Polynomial<'a, F>
impl<'a, F: Field> From<&'a SparsePolynomial<F>> for Polynomial<'a, F>
source§fn from(other: &'a SparsePolynomial<F>) -> Self
fn from(other: &'a SparsePolynomial<F>) -> Self
Converts to this type from the input type.
source§impl<F: Field> From<SparsePolynomial<F>> for DensePolynomial<F>
impl<F: Field> From<SparsePolynomial<F>> for DensePolynomial<F>
source§fn from(other: SparsePolynomial<F>) -> Self
fn from(other: SparsePolynomial<F>) -> Self
Converts to this type from the input type.
source§impl<F: Field> From<SparsePolynomial<F>> for Polynomial<'_, F>
impl<F: Field> From<SparsePolynomial<F>> for Polynomial<'_, F>
source§fn from(other: SparsePolynomial<F>) -> Self
fn from(other: SparsePolynomial<F>) -> Self
Converts to this type from the input type.
source§impl<'a, F: PrimeField> Mul<F> for &'a SparsePolynomial<F>
impl<'a, F: PrimeField> Mul<F> for &'a SparsePolynomial<F>
source§impl<F: PrimeField> MulAssign<F> for SparsePolynomial<F>
impl<F: PrimeField> MulAssign<F> for SparsePolynomial<F>
source§fn mul_assign(&mut self, other: F)
fn mul_assign(&mut self, other: F)
Performs the
*=
operation. Read moresource§impl<F: PartialEq + Field> PartialEq<SparsePolynomial<F>> for SparsePolynomial<F>
impl<F: PartialEq + Field> PartialEq<SparsePolynomial<F>> for SparsePolynomial<F>
source§fn eq(&self, other: &SparsePolynomial<F>) -> bool
fn eq(&self, other: &SparsePolynomial<F>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'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.source§impl<F: Field> TryInto<SparsePolynomial<F>> for Polynomial<'_, F>
impl<F: Field> TryInto<SparsePolynomial<F>> for Polynomial<'_, F>
source§impl<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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.