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>
Source§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>
Source§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>
Source§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>
Source§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>
Source§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>
Source§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> Add for LinearCombination<F>
impl<F: PrimeField> Add 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 for LinearCombination<F>
impl<F: PrimeField> AddAssign 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>>> for LinearCombination<F>
impl<F: PrimeField> From<&Vec<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<Variable<F>> for LinearCombination<F>
impl<F: PrimeField> From<Variable<F>> for LinearCombination<F>
Source§impl<F: PrimeField> From<Vec<Variable<F>>> for LinearCombination<F>
impl<F: PrimeField> From<Vec<Variable<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> 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>
Source§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>
Source§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>
Source§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>
Source§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>
Source§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>
Source§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>
Source§impl<F: PrimeField> Sub for LinearCombination<F>
impl<F: PrimeField> Sub for LinearCombination<F>
Auto Trait Implementations§
impl<F> Freeze for LinearCombination<F>where
F: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more