Struct snarkvm_algorithms::fft::polynomial::SparsePolynomial
source · [−]Expand description
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
sourceimpl<F: Field> SparsePolynomial<F>
impl<F: Field> SparsePolynomial<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 more
sourceimpl<F: Field> CanonicalDeserialize for SparsePolynomial<F>
impl<F: Field> CanonicalDeserialize for SparsePolynomial<F>
sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
Reads Self
from reader
.
sourcefn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
fn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
Reads Self
from reader
without compression.
sourceimpl<F: Field> CanonicalSerialize for SparsePolynomial<F>
impl<F: Field> CanonicalSerialize for SparsePolynomial<F>
sourcefn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
Serializes self
into writer
.
fn serialized_size(&self) -> usize
sourcefn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
fn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
Serializes self
into writer
without compression.
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 more
sourceimpl<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 DenseOrSparsePolynomial<'a, F>
impl<'a, F: Field> From<&'a SparsePolynomial<F>> for DenseOrSparsePolynomial<'a, F>
sourcefn from(other: &'a SparsePolynomial<F>) -> Self
fn from(other: &'a SparsePolynomial<F>) -> Self
Performs the conversion.
sourceimpl<F: Field> From<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F>
impl<F: Field> From<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F>
sourcefn from(other: SparsePolynomial<F>) -> Self
fn from(other: SparsePolynomial<F>) -> Self
Performs the conversion.
sourceimpl<F: Hash + Field> Hash for SparsePolynomial<F>
impl<F: Hash + Field> Hash for SparsePolynomial<F>
sourceimpl<F: Field> Into<DensePolynomial<F>> for SparsePolynomial<F>
impl<F: Field> Into<DensePolynomial<F>> for SparsePolynomial<F>
sourcefn into(self) -> DensePolynomial<F>
fn into(self) -> DensePolynomial<F>
Performs the conversion.
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 more
sourceimpl<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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SparsePolynomial<F>) -> bool
fn ne(&self, other: &SparsePolynomial<F>) -> bool
This method tests for !=
.
sourceimpl<'a, F: Field> Sub<&'a SparsePolynomial<F>> for DensePolynomial<F>
impl<'a, F: Field> Sub<&'a SparsePolynomial<F>> for DensePolynomial<F>
sourceimpl<F: Field> TryInto<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F>
impl<F: Field> TryInto<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F>
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> where
F: Unpin,
impl<F> UnwindSafe for SparsePolynomial<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more