[−][src]Struct r1cs::Expression
A linear combination of wires.
Methods
impl<F: Field> Expression<F>
[src]
pub fn new(coefficients: HashMap<Wire, Element<F>>) -> Self
[src]
Creates a new expression with the given wire coefficients.
pub fn sum_of_wires(wires: &[Wire]) -> Self
[src]
The sum of zero or more wires, each with an implied coefficient of 1.
pub fn sum_of_expressions(expressions: &[Expression<F>]) -> Self
[src]
The sum of zero or more wires, each with an implied coefficient of 1.
pub fn zero() -> Self
[src]
pub fn one() -> Self
[src]
pub fn neg_one() -> Self
[src]
The additive inverse of 1.
pub fn num_terms(&self) -> usize
[src]
pub fn as_constant(&self) -> Option<Element<F>>
[src]
Return Some(c) if this is a constant c, otherwise None.
pub fn dependencies(&self) -> Vec<Wire>
[src]
Return a vector of all wires that this expression depends on.
pub fn evaluate(&self, wire_values: &WireValues<F>) -> Element<F>
[src]
Trait Implementations
impl<F: Field> From<Wire> for Expression<F>
[src]
impl<'_, F: Field> From<&'_ Wire> for Expression<F>
[src]
impl<F: Field> From<Element<F>> for Expression<F>
[src]
impl<'_, F: Field> From<&'_ Element<F>> for Expression<F>
[src]
impl<F: Field> From<usize> for Expression<F>
[src]
impl<F: Field> From<u128> for Expression<F>
[src]
impl<F: Field> From<u64> for Expression<F>
[src]
impl<F: Field> From<u32> for Expression<F>
[src]
impl<F: Field> From<u16> for Expression<F>
[src]
impl<F: Field> From<u8> for Expression<F>
[src]
impl<F: Field> From<bool> for Expression<F>
[src]
impl<F: PartialEq + Field> PartialEq<Expression<F>> for Expression<F>
[src]
fn eq(&self, other: &Expression<F>) -> bool
[src]
fn ne(&self, other: &Expression<F>) -> bool
[src]
impl<F: Field> Clone for Expression<F>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<F: Eq + Field> Eq for Expression<F>
[src]
impl<F: Field> Display for Expression<F>
[src]
impl<F: Debug + Field> Debug for Expression<F>
[src]
impl<F: Field> Add<Expression<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the +
operator.
fn add(self, rhs: Expression<F>) -> Expression<F>
[src]
impl<'_, F: Field> Add<&'_ Expression<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the +
operator.
fn add(self, rhs: &Expression<F>) -> Expression<F>
[src]
impl<'_, F: Field> Add<Expression<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the +
operator.
fn add(self, rhs: Expression<F>) -> Expression<F>
[src]
impl<'_, '_, F: Field> Add<&'_ Expression<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the +
operator.
fn add(self, rhs: &Expression<F>) -> Expression<F>
[src]
impl<F: Field> Sub<Expression<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: Expression<F>) -> Self::Output
[src]
impl<'_, F: Field> Sub<&'_ Expression<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Expression<F>) -> Self::Output
[src]
impl<'_, F: Field> Sub<Expression<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: Expression<F>) -> Self::Output
[src]
impl<'_, '_, F: Field> Sub<&'_ Expression<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Expression<F>) -> Self::Output
[src]
impl<F: Field> Mul<Element<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: Element<F>) -> Expression<F>
[src]
impl<'_, F: Field> Mul<&'_ Element<F>> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Element<F>) -> Expression<F>
[src]
impl<'_, F: Field> Mul<Element<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: Element<F>) -> Expression<F>
[src]
impl<'_, '_, F: Field> Mul<&'_ Element<F>> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Element<F>) -> Expression<F>
[src]
impl<F: Field> Mul<u128> for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: u128) -> Expression<F>
[src]
impl<'_, F: Field> Mul<u128> for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the *
operator.
fn mul(self, rhs: u128) -> Expression<F>
[src]
impl<'_, F: Field> Neg for &'_ Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the -
operator.
fn neg(self) -> Expression<F>
[src]
impl<F: Field> Neg for Expression<F>
[src]
type Output = Expression<F>
The resulting type after applying the -
operator.
fn neg(self) -> Expression<F>
[src]
impl<F: Field> AddAssign<Expression<F>> for Expression<F>
[src]
fn add_assign(&mut self, rhs: Expression<F>)
[src]
impl<'_, F: Field> AddAssign<&'_ Expression<F>> for Expression<F>
[src]
fn add_assign(&mut self, rhs: &Expression<F>)
[src]
impl<F: Field> SubAssign<Expression<F>> for Expression<F>
[src]
fn sub_assign(&mut self, rhs: Expression<F>)
[src]
impl<'_, F: Field> SubAssign<&'_ Expression<F>> for Expression<F>
[src]
fn sub_assign(&mut self, rhs: &Expression<F>)
[src]
impl<F: Field> MulAssign<Element<F>> for Expression<F>
[src]
fn mul_assign(&mut self, rhs: Element<F>)
[src]
impl<'_, F: Field> MulAssign<&'_ Element<F>> for Expression<F>
[src]
fn mul_assign(&mut self, rhs: &Element<F>)
[src]
impl<F: Field> MulAssign<u128> for Expression<F>
[src]
fn mul_assign(&mut self, rhs: u128)
[src]
Auto Trait Implementations
impl<F> Send for Expression<F> where
F: Send,
F: Send,
impl<F> Unpin for Expression<F> where
F: Unpin,
F: Unpin,
impl<F> Sync for Expression<F> where
F: Sync,
F: Sync,
impl<F> UnwindSafe for Expression<F> where
F: UnwindSafe,
F: UnwindSafe,
impl<F> RefUnwindSafe for Expression<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,