Struct snarkvm_algorithms::polycommit::sonic_pc::LinearCombination   
source · pub struct LinearCombination<F> {
    pub label: String,
    pub terms: BTreeMap<LCTerm, F>,
}Expand description
A labeled linear combinations of polynomials.
Fields§
§label: StringThe label.
terms: BTreeMap<LCTerm, F>The linear combination of (coeff, poly_label) pairs.
Implementations§
source§impl<F: Field> LinearCombination<F>
 
impl<F: Field> LinearCombination<F>
sourcepub fn new(
    label: impl Into<String>,
    _terms: impl IntoIterator<Item = (F, impl Into<LCTerm>)>
) -> Self
 
pub fn new( label: impl Into<String>, _terms: impl IntoIterator<Item = (F, impl Into<LCTerm>)> ) -> Self
Construct a new labeled linear combination.
with the terms specified in term.
sourcepub fn add(&mut self, c: F, t: impl Into<LCTerm>) -> &mut Self
 
pub fn add(&mut self, c: F, t: impl Into<LCTerm>) -> &mut Self
Add a term to the linear combination.
pub fn len(&self) -> usize
pub fn iter(&self) -> impl Iterator<Item = (&F, &LCTerm)>
Trait Implementations§
source§impl<'a, F: Field> AddAssign<&'a LinearCombination<F>> for LinearCombination<F>
 
impl<'a, F: Field> AddAssign<&'a LinearCombination<F>> for LinearCombination<F>
source§fn add_assign(&mut self, other: &'a LinearCombination<F>)
 
fn add_assign(&mut self, other: &'a LinearCombination<F>)
Performs the 
+= operation. Read moresource§impl<'a, F: Field> AddAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
 
impl<'a, F: Field> AddAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
source§fn add_assign(&mut self, (coeff, other): (F, &'a LinearCombination<F>))
 
fn add_assign(&mut self, (coeff, other): (F, &'a LinearCombination<F>))
Performs the 
+= operation. Read moresource§impl<F: Field> AddAssign<F> for LinearCombination<F>
 
impl<F: Field> AddAssign<F> for LinearCombination<F>
source§fn add_assign(&mut self, coeff: F)
 
fn add_assign(&mut self, coeff: F)
Performs the 
+= operation. Read moresource§impl<F: Clone> Clone for LinearCombination<F>
 
impl<F: Clone> Clone for LinearCombination<F>
source§fn clone(&self) -> LinearCombination<F>
 
fn clone(&self) -> LinearCombination<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: Debug> Debug for LinearCombination<F>
 
impl<F: Debug> Debug for LinearCombination<F>
source§impl<F: Field> MulAssign<F> for LinearCombination<F>
 
impl<F: Field> MulAssign<F> for LinearCombination<F>
source§fn mul_assign(&mut self, coeff: F)
 
fn mul_assign(&mut self, coeff: F)
Performs the 
*= operation. Read moresource§impl<'a, F: Field> SubAssign<&'a LinearCombination<F>> for LinearCombination<F>
 
impl<'a, F: Field> SubAssign<&'a LinearCombination<F>> for LinearCombination<F>
source§fn sub_assign(&mut self, other: &'a LinearCombination<F>)
 
fn sub_assign(&mut self, other: &'a LinearCombination<F>)
Performs the 
-= operation. Read moresource§impl<'a, F: Field> SubAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
 
impl<'a, F: Field> SubAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
source§fn sub_assign(&mut self, (coeff, other): (F, &'a LinearCombination<F>))
 
fn sub_assign(&mut self, (coeff, other): (F, &'a LinearCombination<F>))
Performs the 
-= operation. Read moresource§impl<F: Field> SubAssign<F> for LinearCombination<F>
 
impl<F: Field> SubAssign<F> for LinearCombination<F>
source§fn sub_assign(&mut self, coeff: F)
 
fn sub_assign(&mut self, coeff: F)
Performs the 
-= operation. Read more