Struct libspartan::Instance
source · [−]pub struct Instance { /* private fields */ }Expand description
Instance holds the description of R1CS matrices
Implementations
sourceimpl Instance
impl Instance
sourcepub fn new(
num_cons: usize,
num_vars: usize,
num_inputs: usize,
A: &[(usize, usize, [u8; 32])],
B: &[(usize, usize, [u8; 32])],
C: &[(usize, usize, [u8; 32])]
) -> Result<Instance, R1CSError>
pub fn new(
num_cons: usize,
num_vars: usize,
num_inputs: usize,
A: &[(usize, usize, [u8; 32])],
B: &[(usize, usize, [u8; 32])],
C: &[(usize, usize, [u8; 32])]
) -> Result<Instance, R1CSError>
Constructs a new Instance and an associated satisfying assignment
sourcepub fn is_sat(
&self,
vars: &VarsAssignment,
inputs: &InputsAssignment
) -> Result<bool, R1CSError>
pub fn is_sat(
&self,
vars: &VarsAssignment,
inputs: &InputsAssignment
) -> Result<bool, R1CSError>
Checks if a given R1CSInstance is satisfiable with a given variables and inputs assignments
sourcepub fn produce_synthetic_r1cs(
num_cons: usize,
num_vars: usize,
num_inputs: usize
) -> (Instance, VarsAssignment, InputsAssignment)
pub fn produce_synthetic_r1cs(
num_cons: usize,
num_vars: usize,
num_inputs: usize
) -> (Instance, VarsAssignment, InputsAssignment)
Constructs a new synthetic R1CS Instance and an associated satisfying assignment
Auto Trait Implementations
impl RefUnwindSafe for Instance
impl Send for Instance
impl Sync for Instance
impl Unpin for Instance
impl UnwindSafe for Instance
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> Cast<U> for T where
U: FromCast<T>,
impl<T, U> Cast<U> for T where
U: FromCast<T>,
fn cast(self) -> U
fn cast(self) -> U
Numeric cast from self to T.
impl<T> FromBits<T> for T
impl<T> FromBits<T> for T
fn from_bits(t: T) -> T
fn from_bits(t: T) -> T
Safe lossless bitwise transmute from T to Self.
impl<T> FromCast<T> for T
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
fn from_cast(t: T) -> T
Numeric cast from T to Self.
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
fn into_bits(self) -> U
fn into_bits(self) -> U
Safe lossless bitwise transmute from self to T.