snarkvm_circuit_environment::helpers::r1cs

Struct R1CS

Source
pub struct R1CS<F: PrimeField> { /* private fields */ }

Implementations§

Source§

impl<F: PrimeField> R1CS<F>

Source

pub fn is_satisfied(&self) -> bool

Returns true if all of the constraints are satisfied.

In addition, when in debug mode, this function also checks that all constraints use variables corresponding to the declared variables.

Source

pub fn num_constants(&self) -> u64

Returns the number of constants in the constraint system.

Source

pub fn num_public(&self) -> u64

Returns the number of public variables in the constraint system.

Source

pub fn num_private(&self) -> u64

Returns the number of private variables in the constraint system.

Source

pub fn num_variables(&self) -> u64

Returns the number of constant, public, and private variables in the constraint system.

Source

pub fn num_constraints(&self) -> u64

Returns the number of constraints in the constraint system.

Source

pub fn num_nonzeros(&self) -> (u64, u64, u64)

Returns the number of nonzeros in the constraint system.

Source

pub fn to_public_variables(&self) -> &Vec<Variable<F>>

Returns the public variables in the constraint system.

Source

pub fn to_private_variables(&self) -> &Vec<Variable<F>>

Returns the private variables in the constraint system.

Source

pub fn to_constraints(&self) -> &Vec<Rc<Constraint<F>>>

Returns the constraints in the constraint system.

Trait Implementations§

Source§

impl<F: Debug + PrimeField> Debug for R1CS<F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: PrimeField> Display for R1CS<F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: PrimeField> From<R1CS<F>> for Assignment<F>

Source§

fn from(r1cs: R1CS<F>) -> Self

Converts an R1CS to an assignment.

Auto Trait Implementations§

§

impl<F> Freeze for R1CS<F>

§

impl<F> RefUnwindSafe for R1CS<F>
where F: RefUnwindSafe,

§

impl<F> !Send for R1CS<F>

§

impl<F> !Sync for R1CS<F>

§

impl<F> Unpin for R1CS<F>

§

impl<F> UnwindSafe for R1CS<F>
where F: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V