Struct snarkvm_wasm::SparsePolynomial [−][src]
Expand description
Stores a sparse polynomial in coefficient form.
Fields
coeffs: Vec<(usize, F), Global>
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> SparsePolynomial<F> where
F: Field,
[src]
impl<F> SparsePolynomial<F> where
F: Field,
[src]pub fn zero() -> SparsePolynomial<F>
[src]
pub fn zero() -> SparsePolynomial<F>
[src]Returns the zero polynomial.
pub fn from_coefficients_slice(coeffs: &[(usize, F)]) -> SparsePolynomial<F>
[src]
pub fn from_coefficients_slice(coeffs: &[(usize, F)]) -> SparsePolynomial<F>
[src]Constructs a new polynomial from a list of coefficients.
pub fn from_coefficients_vec(
coeffs: Vec<(usize, F), Global>
) -> SparsePolynomial<F>
[src]
pub fn from_coefficients_vec(
coeffs: Vec<(usize, F), Global>
) -> SparsePolynomial<F>
[src]Constructs a new polynomial from a list of coefficients.
pub fn mul(&self, other: &SparsePolynomial<F>) -> SparsePolynomial<F>
[src]
pub fn mul(&self, other: &SparsePolynomial<F>) -> SparsePolynomial<F>
[src]Perform a naive n^2 multiplicatoin of self
by other
.
impl<F> SparsePolynomial<F> where
F: PrimeField,
[src]
impl<F> SparsePolynomial<F> where
F: PrimeField,
[src]pub fn evaluate_over_domain_by_ref(
&self,
domain: EvaluationDomain<F>
) -> Evaluations<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]
pub fn evaluate_over_domain(self, domain: EvaluationDomain<F>) -> Evaluations<F>
[src]Evaluate self
over domain
.
Trait Implementations
impl<F> CanonicalDeserialize for SparsePolynomial<F> where
F: Field,
[src]
impl<F> CanonicalDeserialize for SparsePolynomial<F> where
F: Field,
[src]pub fn deserialize<R>(
reader: &mut R
) -> Result<SparsePolynomial<F>, SerializationError> where
R: Read,
[src]
pub fn deserialize<R>(
reader: &mut R
) -> Result<SparsePolynomial<F>, SerializationError> where
R: Read,
[src]Reads Self
from reader
.
pub fn deserialize_uncompressed<R>(
reader: &mut R
) -> Result<SparsePolynomial<F>, SerializationError> where
R: Read,
[src]
pub fn deserialize_uncompressed<R>(
reader: &mut R
) -> Result<SparsePolynomial<F>, SerializationError> where
R: Read,
[src]Reads Self
from reader
without compression.
impl<F> CanonicalSerialize for SparsePolynomial<F> where
F: Field,
[src]
impl<F> CanonicalSerialize for SparsePolynomial<F> where
F: Field,
[src]pub fn serialize<W>(&self, writer: &mut W) -> Result<(), SerializationError> where
W: Write,
[src]
pub fn serialize<W>(&self, writer: &mut W) -> Result<(), SerializationError> where
W: Write,
[src]Serializes self
into writer
.
pub fn serialized_size(&self) -> usize
[src]
pub fn serialize_uncompressed<W>(
&self,
writer: &mut W
) -> Result<(), SerializationError> where
W: Write,
[src]
pub fn serialize_uncompressed<W>(
&self,
writer: &mut W
) -> Result<(), SerializationError> where
W: Write,
[src]Serializes self
into writer
without compression.
pub fn uncompressed_size(&self) -> usize
[src]
impl<F> Clone for SparsePolynomial<F> where
F: Clone + Field,
[src]
impl<F> Clone for SparsePolynomial<F> where
F: Clone + Field,
[src]pub fn clone(&self) -> SparsePolynomial<F>
[src]
pub fn clone(&self) -> SparsePolynomial<F>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<F> Debug for SparsePolynomial<F> where
F: Field,
[src]
impl<F> Debug for SparsePolynomial<F> where
F: Field,
[src]impl<F> Default for SparsePolynomial<F> where
F: Default + Field,
[src]
impl<F> Default for SparsePolynomial<F> where
F: Default + Field,
[src]pub fn default() -> SparsePolynomial<F>
[src]
pub fn default() -> SparsePolynomial<F>
[src]Returns the “default value” for a type. Read more
impl<'a, F> From<&'a SparsePolynomial<F>> for DenseOrSparsePolynomial<'a, F> where
F: Field,
[src]
impl<'a, F> From<&'a SparsePolynomial<F>> for DenseOrSparsePolynomial<'a, F> where
F: Field,
[src]pub fn from(other: &'a SparsePolynomial<F>) -> DenseOrSparsePolynomial<'a, F>
[src]
pub fn from(other: &'a SparsePolynomial<F>) -> DenseOrSparsePolynomial<'a, F>
[src]Performs the conversion.
impl<'_, F> From<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F> where
F: Field,
[src]
impl<'_, F> From<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F> where
F: Field,
[src]pub fn from(other: SparsePolynomial<F>) -> DenseOrSparsePolynomial<'_, F>
[src]
pub fn from(other: SparsePolynomial<F>) -> DenseOrSparsePolynomial<'_, F>
[src]Performs the conversion.
impl<F> Hash for SparsePolynomial<F> where
F: Hash + Field,
[src]
impl<F> Hash for SparsePolynomial<F> where
F: Hash + Field,
[src]impl<F> Into<DensePolynomial<F>> for SparsePolynomial<F> where
F: Field,
[src]
impl<F> Into<DensePolynomial<F>> for SparsePolynomial<F> where
F: Field,
[src]pub fn into(self) -> DensePolynomial<F>
[src]
pub fn into(self) -> DensePolynomial<F>
[src]Performs the conversion.
impl<F> PartialEq<SparsePolynomial<F>> for SparsePolynomial<F> where
F: PartialEq<F> + Field,
[src]
impl<F> PartialEq<SparsePolynomial<F>> for SparsePolynomial<F> where
F: PartialEq<F> + Field,
[src]pub fn eq(&self, other: &SparsePolynomial<F>) -> bool
[src]
pub fn eq(&self, other: &SparsePolynomial<F>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &SparsePolynomial<F>) -> bool
[src]
pub fn ne(&self, other: &SparsePolynomial<F>) -> bool
[src]This method tests for !=
.
impl<'_, F> TryInto<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F> where
F: Field,
[src]
impl<'_, F> TryInto<SparsePolynomial<F>> for DenseOrSparsePolynomial<'_, F> where
F: Field,
[src]impl<F> Eq for SparsePolynomial<F> where
F: Eq + Field,
[src]
F: Eq + Field,
impl<F> StructuralEq for SparsePolynomial<F> where
F: Field,
[src]
F: Field,
impl<F> StructuralPartialEq for SparsePolynomial<F> where
F: Field,
[src]
F: Field,
Auto Trait Implementations
impl<F> RefUnwindSafe for SparsePolynomial<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for SparsePolynomial<F>
impl<F> Sync for SparsePolynomial<F>
impl<F> Unpin for SparsePolynomial<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for SparsePolynomial<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,