Struct snarkvm_algorithms::polycommit::sonic_pc::LinearCombination
source · [−]Expand description
A labeled linear combinations of polynomials.
Fields
label: String
The label.
terms: BTreeMap<LCTerm, F>
The linear combination of (coeff, poly_label)
pairs.
Implementations
sourceimpl<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
sourceimpl<'a, F: Field> AddAssign<&'a LinearCombination<F>> for LinearCombination<F>
impl<'a, F: Field> AddAssign<&'a LinearCombination<F>> for LinearCombination<F>
sourcefn add_assign(&mut self, other: &'a LinearCombination<F>)
fn add_assign(&mut self, other: &'a LinearCombination<F>)
Performs the +=
operation. Read more
sourceimpl<'a, F: Field> AddAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
impl<'a, F: Field> AddAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
sourcefn 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 more
sourceimpl<F: Field> AddAssign<F> for LinearCombination<F>
impl<F: Field> AddAssign<F> for LinearCombination<F>
sourcefn add_assign(&mut self, coeff: F)
fn add_assign(&mut self, coeff: F)
Performs the +=
operation. Read more
sourceimpl<F: Clone> Clone for LinearCombination<F>
impl<F: Clone> Clone for LinearCombination<F>
sourcefn clone(&self) -> LinearCombination<F>
fn clone(&self) -> LinearCombination<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: Debug> Debug for LinearCombination<F>
impl<F: Debug> Debug for LinearCombination<F>
sourceimpl<F: Field> MulAssign<F> for LinearCombination<F>
impl<F: Field> MulAssign<F> for LinearCombination<F>
sourcefn mul_assign(&mut self, coeff: F)
fn mul_assign(&mut self, coeff: F)
Performs the *=
operation. Read more
sourceimpl<'a, F: Field> SubAssign<&'a LinearCombination<F>> for LinearCombination<F>
impl<'a, F: Field> SubAssign<&'a LinearCombination<F>> for LinearCombination<F>
sourcefn sub_assign(&mut self, other: &'a LinearCombination<F>)
fn sub_assign(&mut self, other: &'a LinearCombination<F>)
Performs the -=
operation. Read more
sourceimpl<'a, F: Field> SubAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
impl<'a, F: Field> SubAssign<(F, &'a LinearCombination<F>)> for LinearCombination<F>
sourcefn 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 more
sourceimpl<F: Field> SubAssign<F> for LinearCombination<F>
impl<F: Field> SubAssign<F> for LinearCombination<F>
sourcefn sub_assign(&mut self, coeff: F)
fn sub_assign(&mut self, coeff: F)
Performs the -=
operation. Read more
Auto Trait Implementations
impl<F> RefUnwindSafe for LinearCombination<F> where
F: RefUnwindSafe,
impl<F> Send for LinearCombination<F> where
F: Send,
impl<F> Sync for LinearCombination<F> where
F: Sync,
impl<F> Unpin for LinearCombination<F>
impl<F> UnwindSafe for LinearCombination<F> where
F: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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