pub struct ConstraintSystem<F: Field> { /* private fields */ }Expand description
A constraint system with multiplication constraints over witness indices.
Contains multiplication constraints of the form A * B = C where A, B, C are operands
(XOR combinations of witness values). Constraints directly reference WitnessIndex
positions in the witness array.
This struct does not guarantee power-of-two constraint counts or witness size.
Implementations§
Source§impl<F: Field> ConstraintSystem<F>
impl<F: Field> ConstraintSystem<F>
Sourcepub const fn new(
constants: Vec<F>,
n_inout: u32,
n_precommit: u32,
n_private: u32,
log_public: u32,
mul_constraints: Vec<MulConstraint<WitnessIndex>>,
one_wire_index: u32,
) -> Self
pub const fn new( constants: Vec<F>, n_inout: u32, n_precommit: u32, n_private: u32, log_public: u32, mul_constraints: Vec<MulConstraint<WitnessIndex>>, one_wire_index: u32, ) -> Self
Create a new constraint system.
pub fn constants(&self) -> &[F]
pub const fn n_inout(&self) -> u32
pub const fn n_precommit(&self) -> u32
pub const fn n_private(&self) -> u32
pub const fn log_public(&self) -> u32
pub const fn n_public(&self) -> u32
pub fn mul_constraints(&self) -> &[MulConstraint<WitnessIndex>]
pub const fn one_wire(&self) -> WitnessIndex
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for ConstraintSystem<F>
impl<F> RefUnwindSafe for ConstraintSystem<F>where
F: RefUnwindSafe,
impl<F> Send for ConstraintSystem<F>
impl<F> Sync for ConstraintSystem<F>
impl<F> Unpin for ConstraintSystem<F>where
F: Unpin,
impl<F> UnsafeUnpin for ConstraintSystem<F>
impl<F> UnwindSafe for ConstraintSystem<F>where
F: UnwindSafe,
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