pub struct LinearCombination<F: PrimeField> { /* private fields */ }
Implementations§
source§impl<F: PrimeField> LinearCombination<F>
impl<F: PrimeField> LinearCombination<F>
sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Returns true
if there are no terms in the linear combination.
sourcepub fn is_public(&self) -> bool
pub fn is_public(&self) -> bool
Returns true
if there is exactly one term with a coefficient of one,
and the term contains a public variable.
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Returns true
if the linear combination is not constant or public.
sourcepub fn is_boolean_type(&self) -> bool
pub fn is_boolean_type(&self) -> bool
Returns true
if the linear combination represents a Boolean
type,
and is well-formed.
Properties:
- Either
constant
orterms
is utilized, however never both. - Every individual variable in the linear combination must always be either
0
or1
. - The value of the linear combination must always be either
0
or1
.
Trait Implementations§
source§impl<F: PrimeField> Add<&LinearCombination<F>> for &LinearCombination<F>
impl<F: PrimeField> Add<&LinearCombination<F>> for &LinearCombination<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.source§impl<F: PrimeField> Add<&LinearCombination<F>> for &Variable<F>
impl<F: PrimeField> Add<&LinearCombination<F>> for &Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.source§impl<F: PrimeField> Add<&LinearCombination<F>> for LinearCombination<F>
impl<F: PrimeField> Add<&LinearCombination<F>> for LinearCombination<F>
source§impl<F: PrimeField> Add<&LinearCombination<F>> for Variable<F>
impl<F: PrimeField> Add<&LinearCombination<F>> for Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.source§impl<F: PrimeField> Add<&Variable<F>> for LinearCombination<F>
impl<F: PrimeField> Add<&Variable<F>> for LinearCombination<F>
source§impl<F: PrimeField> Add<LinearCombination<F>> for &LinearCombination<F>
impl<F: PrimeField> Add<LinearCombination<F>> for &LinearCombination<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.source§impl<F: PrimeField> Add<LinearCombination<F>> for &Variable<F>
impl<F: PrimeField> Add<LinearCombination<F>> for &Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.source§impl<F: PrimeField> Add<LinearCombination<F>> for LinearCombination<F>
impl<F: PrimeField> Add<LinearCombination<F>> for LinearCombination<F>
source§impl<F: PrimeField> Add<LinearCombination<F>> for Variable<F>
impl<F: PrimeField> Add<LinearCombination<F>> for Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.source§impl<F: PrimeField> Add<Variable<F>> for &LinearCombination<F>
impl<F: PrimeField> Add<Variable<F>> for &LinearCombination<F>
source§impl<F: PrimeField> Add<Variable<F>> for LinearCombination<F>
impl<F: PrimeField> Add<Variable<F>> for LinearCombination<F>
source§impl<F: PrimeField> AddAssign<&LinearCombination<F>> for LinearCombination<F>
impl<F: PrimeField> AddAssign<&LinearCombination<F>> for LinearCombination<F>
source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+=
operation. Read moresource§impl<F: PrimeField> AddAssign<LinearCombination<F>> for LinearCombination<F>
impl<F: PrimeField> AddAssign<LinearCombination<F>> for LinearCombination<F>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl<F: Clone + PrimeField> Clone for LinearCombination<F>
impl<F: Clone + PrimeField> 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: PrimeField> Debug for LinearCombination<F>
impl<F: PrimeField> Debug for LinearCombination<F>
source§impl<F: PrimeField> Display for LinearCombination<F>
impl<F: PrimeField> Display for LinearCombination<F>
source§impl<F: PrimeField> From<&[Variable<F>]> for LinearCombination<F>
impl<F: PrimeField> From<&[Variable<F>]> for LinearCombination<F>
source§impl<F: PrimeField, const N: usize> From<&[Variable<F>; N]> for LinearCombination<F>
impl<F: PrimeField, const N: usize> From<&[Variable<F>; N]> for LinearCombination<F>
source§impl<F: PrimeField> From<&LinearCombination<F>> for AssignmentLC<F>
impl<F: PrimeField> From<&LinearCombination<F>> for AssignmentLC<F>
source§fn from(lc: &LinearCombination<F>) -> Self
fn from(lc: &LinearCombination<F>) -> Self
Converts a linear combination to an assignment linear combination.
source§impl<F: PrimeField> From<&Variable<F>> for LinearCombination<F>
impl<F: PrimeField> From<&Variable<F>> for LinearCombination<F>
source§impl<F: PrimeField> From<&Vec<Variable<F>, Global>> for LinearCombination<F>
impl<F: PrimeField> From<&Vec<Variable<F>, Global>> for LinearCombination<F>
source§impl<F: PrimeField, const N: usize> From<[Variable<F>; N]> for LinearCombination<F>
impl<F: PrimeField, const N: usize> From<[Variable<F>; N]> for LinearCombination<F>
source§impl<F: PrimeField> From<Variable<F>> for LinearCombination<F>
impl<F: PrimeField> From<Variable<F>> for LinearCombination<F>
source§impl<F: PrimeField> From<Vec<Variable<F>, Global>> for LinearCombination<F>
impl<F: PrimeField> From<Vec<Variable<F>, Global>> for LinearCombination<F>
source§impl<F: PrimeField> Mul<&F> for &LinearCombination<F>
impl<F: PrimeField> Mul<&F> for &LinearCombination<F>
source§impl<F: PrimeField> Mul<&F> for LinearCombination<F>
impl<F: PrimeField> Mul<&F> for LinearCombination<F>
source§impl<F: PrimeField> Mul<F> for &LinearCombination<F>
impl<F: PrimeField> Mul<F> for &LinearCombination<F>
source§impl<F: PrimeField> Mul<F> for LinearCombination<F>
impl<F: PrimeField> Mul<F> for LinearCombination<F>
source§impl<F: PrimeField> Neg for &LinearCombination<F>
impl<F: PrimeField> Neg for &LinearCombination<F>
source§impl<F: PrimeField> Neg for LinearCombination<F>
impl<F: PrimeField> Neg for LinearCombination<F>
source§impl<F: PrimeField> Sub<&LinearCombination<F>> for &LinearCombination<F>
impl<F: PrimeField> Sub<&LinearCombination<F>> for &LinearCombination<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.source§impl<F: PrimeField> Sub<&LinearCombination<F>> for &Variable<F>
impl<F: PrimeField> Sub<&LinearCombination<F>> for &Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.source§impl<F: PrimeField> Sub<&LinearCombination<F>> for LinearCombination<F>
impl<F: PrimeField> Sub<&LinearCombination<F>> for LinearCombination<F>
source§impl<F: PrimeField> Sub<&LinearCombination<F>> for Variable<F>
impl<F: PrimeField> Sub<&LinearCombination<F>> for Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.source§impl<F: PrimeField> Sub<&Variable<F>> for LinearCombination<F>
impl<F: PrimeField> Sub<&Variable<F>> for LinearCombination<F>
source§impl<F: PrimeField> Sub<LinearCombination<F>> for &LinearCombination<F>
impl<F: PrimeField> Sub<LinearCombination<F>> for &LinearCombination<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.source§impl<F: PrimeField> Sub<LinearCombination<F>> for &Variable<F>
impl<F: PrimeField> Sub<LinearCombination<F>> for &Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.source§impl<F: PrimeField> Sub<LinearCombination<F>> for LinearCombination<F>
impl<F: PrimeField> Sub<LinearCombination<F>> for LinearCombination<F>
source§impl<F: PrimeField> Sub<LinearCombination<F>> for Variable<F>
impl<F: PrimeField> Sub<LinearCombination<F>> for Variable<F>
§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.source§impl<F: PrimeField> Sub<Variable<F>> for &LinearCombination<F>
impl<F: PrimeField> Sub<Variable<F>> for &LinearCombination<F>
source§impl<F: PrimeField> Sub<Variable<F>> for LinearCombination<F>
impl<F: PrimeField> Sub<Variable<F>> for LinearCombination<F>
Auto Trait Implementations§
impl<F> RefUnwindSafe for LinearCombination<F>where F: RefUnwindSafe,
impl<F> !Send for LinearCombination<F>
impl<F> !Sync for LinearCombination<F>
impl<F> Unpin for LinearCombination<F>where F: Unpin,
impl<F> UnwindSafe for LinearCombination<F>where F: UnwindSafe + 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