pub enum Variable {
Zero,
One,
Instance(usize),
Witness(usize),
SymbolicLc(LcIndex),
}
Expand description
Represents the different kinds of variables present in a constraint system.
Variants§
Zero
Represents the “zero” constant.
One
Represents of the “one” constant.
Instance(usize)
Represents a public instance variable.
Witness(usize)
Represents a private witness variable.
SymbolicLc(LcIndex)
Represents of a linear combination.
Implementations§
Source§impl Variable
impl Variable
Sourcepub fn is_instance(&self) -> bool
pub fn is_instance(&self) -> bool
Is self
an instance variable?
Sourcepub fn is_witness(&self) -> bool
pub fn is_witness(&self) -> bool
Is self
a witness variable?
Sourcepub fn get_lc_index(&self) -> Option<LcIndex>
pub fn get_lc_index(&self) -> Option<LcIndex>
Get the LcIndex
in self
if self.is_lc()
.
Sourcepub fn get_index_unchecked(&self, witness_offset: usize) -> Option<usize>
pub fn get_index_unchecked(&self, witness_offset: usize) -> Option<usize>
Returns Some(usize)
if !self.is_lc()
, and None
otherwise.
Trait Implementations§
Source§impl<'a, F: Field> Add<&'a Variable> for LinearCombination<F>
impl<'a, F: Field> Add<&'a Variable> for LinearCombination<F>
Source§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.Source§impl<F: Field> Add<Variable> for LinearCombination<F>
impl<F: Field> Add<Variable> for LinearCombination<F>
Source§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.Source§impl Ord for Variable
impl Ord for Variable
Source§impl PartialOrd for Variable
impl PartialOrd for Variable
Source§impl<'a, F: Field> Sub<&'a Variable> for LinearCombination<F>
impl<'a, F: Field> Sub<&'a Variable> for LinearCombination<F>
Source§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.Source§impl<F: Field> Sub<Variable> for LinearCombination<F>
impl<F: Field> Sub<Variable> for LinearCombination<F>
Source§type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.impl Copy for Variable
impl Eq for Variable
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)