Struct snarkvm_r1cs::LinearCombination [−][src]
Expand description
This represents a linear combination of some variables, with coefficients
in the field F
.
The (coeff, var)
pairs in a LinearCombination
are kept sorted according
to the index of the variable in its constraint system.
Implementations
impl<F: Field> LinearCombination<F>
[src]
impl<F: Field> LinearCombination<F>
[src]pub fn zero() -> LinearCombination<F>
[src]
pub fn zero() -> LinearCombination<F>
[src]Outputs an empty linear combination.
pub fn replace_in_place(&mut self, other: Self)
[src]
pub fn replace_in_place(&mut self, other: Self)
[src]Replaces the contents of self
with those of other
.
pub fn negate_in_place(&mut self)
[src]
pub fn negate_in_place(&mut self)
[src]Negate the coefficients of all variables in self
.
pub fn double_in_place(&mut self)
[src]
pub fn double_in_place(&mut self)
[src]Double the coefficients of all variables in self
.
Trait Implementations
impl<F: Field> Add<&'_ LinearCombination<F>> for &LinearCombination<F>
[src]
impl<F: Field> Add<&'_ LinearCombination<F>> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(self, other: &LinearCombination<F>) -> LinearCombination<F>
[src]
fn add(self, other: &LinearCombination<F>) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<'a, F: Field> Add<&'a LinearCombination<F>> for LinearCombination<F>
[src]
impl<'a, F: Field> Add<&'a LinearCombination<F>> for LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(self, other: &'a LinearCombination<F>) -> LinearCombination<F>
[src]
fn add(self, other: &'a LinearCombination<F>) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<F: Field> Add<(F, &'_ LinearCombination<F>)> for &LinearCombination<F>
[src]
impl<F: Field> Add<(F, &'_ LinearCombination<F>)> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(
self,
(mul_coeff, other): (F, &LinearCombination<F>)
) -> LinearCombination<F>
[src]
fn add(
self,
(mul_coeff, other): (F, &LinearCombination<F>)
) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<'a, F: Field> Add<(F, &'a LinearCombination<F>)> for LinearCombination<F>
[src]
impl<'a, F: Field> Add<(F, &'a LinearCombination<F>)> for LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(
self,
(mul_coeff, other): (F, &'a LinearCombination<F>)
) -> LinearCombination<F>
[src]
fn add(
self,
(mul_coeff, other): (F, &'a LinearCombination<F>)
) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<F: Field> Add<(F, LinearCombination<F>)> for &LinearCombination<F>
[src]
impl<F: Field> Add<(F, LinearCombination<F>)> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(
self,
(mul_coeff, other): (F, LinearCombination<F>)
) -> LinearCombination<F>
[src]
fn add(
self,
(mul_coeff, other): (F, LinearCombination<F>)
) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<F: Field> Add<(F, LinearCombination<F>)> for LinearCombination<F>
[src]
impl<F: Field> Add<(F, LinearCombination<F>)> for LinearCombination<F>
[src]impl<F: Field> Add<LinearCombination<F>> for ConstraintVariable<F>
[src]
impl<F: Field> Add<LinearCombination<F>> for ConstraintVariable<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]
fn add(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<F: Field> Add<LinearCombination<F>> for &ConstraintVariable<F>
[src]
impl<F: Field> Add<LinearCombination<F>> for &ConstraintVariable<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]
fn add(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<F: Field> Add<LinearCombination<F>> for &LinearCombination<F>
[src]
impl<F: Field> Add<LinearCombination<F>> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the +
operator.
fn add(self, other: LinearCombination<F>) -> LinearCombination<F>
[src]
fn add(self, other: LinearCombination<F>) -> LinearCombination<F>
[src]Performs the +
operation. Read more
impl<F: Field> Add<LinearCombination<F>> for LinearCombination<F>
[src]
impl<F: Field> Add<LinearCombination<F>> for LinearCombination<F>
[src]impl<F: Field> Add<Variable> for LinearCombination<F>
[src]
impl<F: Field> Add<Variable> for LinearCombination<F>
[src]impl<F: Clone + Field> Clone for LinearCombination<F>
[src]
impl<F: Clone + Field> Clone for LinearCombination<F>
[src]fn clone(&self) -> LinearCombination<F>
[src]
fn clone(&self) -> LinearCombination<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 + Field> Debug for LinearCombination<F>
[src]
impl<F: Debug + Field> Debug for LinearCombination<F>
[src]impl<F: Field> From<LinearCombination<F>> for ConstraintVariable<F>
[src]
impl<F: Field> From<LinearCombination<F>> for ConstraintVariable<F>
[src]fn from(lc: LinearCombination<F>) -> Self
[src]
fn from(lc: LinearCombination<F>) -> Self
[src]Performs the conversion.
impl<F: Field> From<Variable> for LinearCombination<F>
[src]
impl<F: Field> From<Variable> for LinearCombination<F>
[src]impl<F: Hash + Field> Hash for LinearCombination<F>
[src]
impl<F: Hash + Field> Hash for LinearCombination<F>
[src]impl<F: Field> Mul<F> for LinearCombination<F>
[src]
impl<F: Field> Mul<F> for LinearCombination<F>
[src]impl<F: Field> MulAssign<F> for LinearCombination<F>
[src]
impl<F: Field> MulAssign<F> for LinearCombination<F>
[src]fn mul_assign(&mut self, scalar: F)
[src]
fn mul_assign(&mut self, scalar: F)
[src]Performs the *=
operation. Read more
impl<F: Field> Neg for LinearCombination<F>
[src]
impl<F: Field> Neg for LinearCombination<F>
[src]impl<F: PartialEq + Field> PartialEq<LinearCombination<F>> for LinearCombination<F>
[src]
impl<F: PartialEq + Field> PartialEq<LinearCombination<F>> for LinearCombination<F>
[src]fn eq(&self, other: &LinearCombination<F>) -> bool
[src]
fn eq(&self, other: &LinearCombination<F>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &LinearCombination<F>) -> bool
[src]
fn ne(&self, other: &LinearCombination<F>) -> bool
[src]This method tests for !=
.
impl<F: Field> Sub<&'_ LinearCombination<F>> for &LinearCombination<F>
[src]
impl<F: Field> Sub<&'_ LinearCombination<F>> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, other: &LinearCombination<F>) -> LinearCombination<F>
[src]
fn sub(self, other: &LinearCombination<F>) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<'a, F: Field> Sub<&'a LinearCombination<F>> for LinearCombination<F>
[src]
impl<'a, F: Field> Sub<&'a LinearCombination<F>> for LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, other: &'a LinearCombination<F>) -> LinearCombination<F>
[src]
fn sub(self, other: &'a LinearCombination<F>) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Field> Sub<(F, &'_ LinearCombination<F>)> for &LinearCombination<F>
[src]
impl<F: Field> Sub<(F, &'_ LinearCombination<F>)> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, (coeff, other): (F, &LinearCombination<F>)) -> LinearCombination<F>
[src]
fn sub(self, (coeff, other): (F, &LinearCombination<F>)) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<'a, F: Field> Sub<(F, &'a LinearCombination<F>)> for LinearCombination<F>
[src]
impl<'a, F: Field> Sub<(F, &'a LinearCombination<F>)> for LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(
self,
(coeff, other): (F, &'a LinearCombination<F>)
) -> LinearCombination<F>
[src]
fn sub(
self,
(coeff, other): (F, &'a LinearCombination<F>)
) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Field> Sub<(F, LinearCombination<F>)> for &LinearCombination<F>
[src]
impl<F: Field> Sub<(F, LinearCombination<F>)> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, (coeff, other): (F, LinearCombination<F>)) -> LinearCombination<F>
[src]
fn sub(self, (coeff, other): (F, LinearCombination<F>)) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<'a, F: Field> Sub<(F, LinearCombination<F>)> for LinearCombination<F>
[src]
impl<'a, F: Field> Sub<(F, LinearCombination<F>)> for LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, (coeff, other): (F, LinearCombination<F>)) -> LinearCombination<F>
[src]
fn sub(self, (coeff, other): (F, LinearCombination<F>)) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Field> Sub<LinearCombination<F>> for ConstraintVariable<F>
[src]
impl<F: Field> Sub<LinearCombination<F>> for ConstraintVariable<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]
fn sub(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Field> Sub<LinearCombination<F>> for &ConstraintVariable<F>
[src]
impl<F: Field> Sub<LinearCombination<F>> for &ConstraintVariable<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]
fn sub(self, other_lc: LinearCombination<F>) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Field> Sub<LinearCombination<F>> for &LinearCombination<F>
[src]
impl<F: Field> Sub<LinearCombination<F>> for &LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, other: LinearCombination<F>) -> LinearCombination<F>
[src]
fn sub(self, other: LinearCombination<F>) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Field> Sub<LinearCombination<F>> for LinearCombination<F>
[src]
impl<F: Field> Sub<LinearCombination<F>> for LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, other: LinearCombination<F>) -> LinearCombination<F>
[src]
fn sub(self, other: LinearCombination<F>) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Field> Sub<Variable> for LinearCombination<F>
[src]
impl<F: Field> Sub<Variable> for LinearCombination<F>
[src]type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the -
operator.
fn sub(self, other: Variable) -> LinearCombination<F>
[src]
fn sub(self, other: Variable) -> LinearCombination<F>
[src]Performs the -
operation. Read more
impl<F: Eq + Field> Eq for LinearCombination<F>
[src]
impl<F: Field> StructuralEq for LinearCombination<F>
[src]
impl<F: Field> StructuralPartialEq for LinearCombination<F>
[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for LinearCombination<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for LinearCombination<F>
impl<F> Sync for LinearCombination<F>
impl<F> Unpin for LinearCombination<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for LinearCombination<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> 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>,