pub struct Term<E: Engine> {
pub num: Num<E>,
pub coeff: E::Fr,
pub constant_term: E::Fr,
}
Fields§
§num: Num<E>
§coeff: E::Fr
§constant_term: E::Fr
Implementations§
Source§impl<E: Engine> Term<E>
impl<E: Engine> Term<E>
pub fn enforce_equal<CS: ConstraintSystem<E>>( &self, cs: &mut CS, other: &Self, ) -> Result<(), SynthesisError>
pub fn circuit_eq(&self, other: &Self) -> bool
pub fn is_constant(&self) -> bool
pub fn unpack(&self) -> (Variable, E::Fr, E::Fr)
pub fn from_constant(val: E::Fr) -> Self
pub fn from_allocated_num(n: AllocatedNum<E>) -> Self
pub fn from_num(n: Num<E>) -> Self
pub fn allocate<CS: ConstraintSystem<E>>( cs: &mut CS, witness: Option<E::Fr>, ) -> Result<Self, SynthesisError>
pub fn zero() -> Self
pub fn from_boolean(b: &Boolean) -> Self
pub fn try_into_constant_value(&self) -> Option<E::Fr>
pub fn into_constant_value(&self) -> E::Fr
pub fn into_num(&self) -> Num<E>
pub fn into_variable(&self) -> AllocatedNum<E>
pub fn scale(&mut self, by: &E::Fr)
pub fn add_constant(&mut self, c: &E::Fr)
pub fn negate(&mut self)
pub fn get_value(&self) -> Option<E::Fr>
pub fn collapse_into_num<CS: ConstraintSystem<E>>( &self, cs: &mut CS, ) -> Result<Num<E>, SynthesisError>
pub fn add<CS: ConstraintSystem<E>>( &self, cs: &mut CS, other: &Self, ) -> Result<Self, SynthesisError>
pub fn sub<CS: ConstraintSystem<E>>( &self, cs: &mut CS, other: &Self, ) -> Result<Self, SynthesisError>
pub fn add_multiple<CS: ConstraintSystem<E>>( &self, cs: &mut CS, other: &[Self], ) -> Result<Self, SynthesisError>
pub fn mul<CS: ConstraintSystem<E>>( &self, cs: &mut CS, other: &Self, ) -> Result<Self, SynthesisError>
pub fn fma<CS: ConstraintSystem<E>>( cs: &mut CS, mul_x: &Self, mul_y: &Self, add_z: &Self, ) -> Result<Self, SynthesisError>
pub fn select<CS: ConstraintSystem<E>>( cs: &mut CS, flag: &Boolean, first: &Self, second: &Self, ) -> Result<Self, SynthesisError>
pub fn inverse<CS: ConstraintSystem<E>>( &self, cs: &mut CS, ) -> Result<Self, SynthesisError>
pub fn div<CS: ConstraintSystem<E>>( &self, cs: &mut CS, other: &Self, ) -> Result<Self, SynthesisError>
Trait Implementations§
Source§impl<E: Engine> TableSelectable<E> for Term<E>
impl<E: Engine> TableSelectable<E> for Term<E>
fn add<CS: ConstraintSystem<E>>( cs: &mut CS, first: Self, second: Self, ) -> Result<Self, SynthesisError>
fn add_many<CS: ConstraintSystem<E>>( cs: &mut CS, items: &[Self], ) -> Result<Self, SynthesisError>
fn negate<CS: ConstraintSystem<E>>( _cs: &mut CS, first: Self, ) -> Result<Self, SynthesisError>
fn select<CS: ConstraintSystem<E>>( cs: &mut CS, flag: &Boolean, first: Self, second: Self, ) -> Result<Self, SynthesisError>
fn fma<CS: ConstraintSystem<E>>( cs: &mut CS, mul_a: Self, mul_b: Self, add_c: Self, ) -> Result<Self, SynthesisError>
fn from_bit(bit: &Boolean) -> Self
Auto Trait Implementations§
impl<E> Freeze for Term<E>
impl<E> RefUnwindSafe for Term<E>
impl<E> Send for Term<E>
impl<E> Sync for Term<E>
impl<E> Unpin for Term<E>
impl<E> UnwindSafe for Term<E>
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