pub enum ArithExpr<F: Field> {
Const(F),
Var(usize),
Add(Arc<ArithExpr<F>>, Arc<ArithExpr<F>>),
Mul(Arc<ArithExpr<F>>, Arc<ArithExpr<F>>),
Pow(Arc<ArithExpr<F>>, u64),
}
Expand description
A builder for arithmetic expressions.
This is a simple representation of multivariate polynomials. The user can explicitly
specify which subexpressions are shared by using Arc
to wrap them. The same subexpressions
are guaranteed to be converted to the same steps ArithCircuit
after the conversion.
Variants§
Const(F)
Var(usize)
Add(Arc<ArithExpr<F>>, Arc<ArithExpr<F>>)
Mul(Arc<ArithExpr<F>>, Arc<ArithExpr<F>>)
Pow(Arc<ArithExpr<F>>, u64)
Implementations§
Trait Implementations§
Source§impl<F> AddAssign<Arc<ArithExpr<F>>> for ArithExpr<F>where
F: Field,
impl<F> AddAssign<Arc<ArithExpr<F>>> for ArithExpr<F>where
F: Field,
Source§fn add_assign(&mut self, rhs: Arc<Self>)
fn add_assign(&mut self, rhs: Arc<Self>)
Performs the
+=
operation. Read moreSource§impl<F> AddAssign for ArithExpr<F>where
F: Field,
impl<F> AddAssign for ArithExpr<F>where
F: Field,
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl<F: Field> From<&ArithCircuit<F>> for ArithExpr<F>
impl<F: Field> From<&ArithCircuit<F>> for ArithExpr<F>
Source§fn from(circuit: &ArithCircuit<F>) -> Self
fn from(circuit: &ArithCircuit<F>) -> Self
Converts to this type from the input type.
Source§impl<F: Field> From<ArithCircuit<F>> for ArithExpr<F>
impl<F: Field> From<ArithCircuit<F>> for ArithExpr<F>
Source§fn from(circuit: ArithCircuit<F>) -> Self
fn from(circuit: ArithCircuit<F>) -> Self
Converts to this type from the input type.
Source§impl<F> MulAssign<Arc<ArithExpr<F>>> for ArithExpr<F>where
F: Field,
impl<F> MulAssign<Arc<ArithExpr<F>>> for ArithExpr<F>where
F: Field,
Source§fn mul_assign(&mut self, rhs: Arc<Self>)
fn mul_assign(&mut self, rhs: Arc<Self>)
Performs the
*=
operation. Read moreSource§impl<F> MulAssign for ArithExpr<F>where
F: Field,
impl<F> MulAssign for ArithExpr<F>where
F: Field,
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moreSource§impl<F> SubAssign<Arc<ArithExpr<F>>> for ArithExpr<F>where
F: Field,
impl<F> SubAssign<Arc<ArithExpr<F>>> for ArithExpr<F>where
F: Field,
Source§fn sub_assign(&mut self, rhs: Arc<Self>)
fn sub_assign(&mut self, rhs: Arc<Self>)
Performs the
-=
operation. Read moreSource§impl<F> SubAssign for ArithExpr<F>where
F: Field,
impl<F> SubAssign for ArithExpr<F>where
F: Field,
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl<F: Eq + Field> Eq for ArithExpr<F>
impl<F: Field> StructuralPartialEq for ArithExpr<F>
Auto Trait Implementations§
impl<F> Freeze for ArithExpr<F>
impl<F> RefUnwindSafe for ArithExpr<F>
impl<F> Send for ArithExpr<F>
impl<F> Sync for ArithExpr<F>
impl<F> Unpin for ArithExpr<F>
impl<F> UnwindSafe for ArithExpr<F>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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