pub struct LinearCombination<F> {
pub label: String,
pub terms: BTreeMap<LCTerm, F>,
}
Expand description
A labeled linear combinations of polynomials.
Fields§
§label: String
The label.
terms: BTreeMap<LCTerm, F>
The linear combination of (poly_label, coeff)
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 moreAuto Trait Implementations§
impl<F> Freeze for LinearCombination<F>
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§
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