pub struct SparseMatrixVar<FV>(pub Vec<Vec<(FV, usize)>>);Expand description
SparseMatrixVar is a sparse matrix represented as a vector of rows,
where each row is a vector of (value, column_index) pairs.
This follows the same format as ark_relations::gr1cs::Matrix.
Tuple Fields§
§0: Vec<Vec<(FV, usize)>>Trait Implementations§
Source§impl<F: PrimeField, CF: PrimeField, FV: AllocVar<F, CF>> AllocVar<Vec<Vec<(F, usize)>>, CF> for SparseMatrixVar<FV>
impl<F: PrimeField, CF: PrimeField, FV: AllocVar<F, CF>> AllocVar<Vec<Vec<(F, usize)>>, CF> for SparseMatrixVar<FV>
Source§fn new_variable<T: Borrow<Matrix<F>>>(
cs: impl Into<Namespace<CF>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode,
) -> Result<Self, SynthesisError>
fn new_variable<T: Borrow<Matrix<F>>>( cs: impl Into<Namespace<CF>>, f: impl FnOnce() -> Result<T, SynthesisError>, mode: AllocationMode, ) -> Result<Self, SynthesisError>
Allocates a new variable of type
Self in the ConstraintSystem cs.
The mode of allocation is decided by mode.Source§fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>,
) -> Result<Self, SynthesisError>
fn new_constant( cs: impl Into<Namespace<F>>, t: impl Borrow<V>, ) -> Result<Self, SynthesisError>
Source§fn new_input<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>where
T: Borrow<V>,
fn new_input<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>where
T: Borrow<V>,
Allocates a new public input of type
Self in the ConstraintSystem
cs.Source§fn new_witness<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>where
T: Borrow<V>,
fn new_witness<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>where
T: Borrow<V>,
Allocates a new private witness of type
Self in the ConstraintSystem
cs.Source§fn new_variable_with_inferred_mode<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>where
T: Borrow<V>,
fn new_variable_with_inferred_mode<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>where
T: Borrow<V>,
Allocates a new constant or private witness of type
Self in the
ConstraintSystem cs with the allocation mode inferred from cs.
A constant is allocated if cs is None, and a private witness is
allocated otherwise. Read moreSource§impl<FV: Clone> Clone for SparseMatrixVar<FV>
impl<FV: Clone> Clone for SparseMatrixVar<FV>
Source§fn clone(&self) -> SparseMatrixVar<FV>
fn clone(&self) -> SparseMatrixVar<FV>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<FV: Debug> Debug for SparseMatrixVar<FV>
impl<FV: Debug> Debug for SparseMatrixVar<FV>
Source§impl<F: PrimeField> MatrixGadget<FpVar<F>> for SparseMatrixVar<FpVar<F>>
impl<F: PrimeField> MatrixGadget<FpVar<F>> for SparseMatrixVar<FpVar<F>>
Source§fn mul_vector(
&self,
v: &impl Index<usize, Output = FpVar<F>>,
) -> Result<Vec<FpVar<F>>, SynthesisError>
fn mul_vector( &self, v: &impl Index<usize, Output = FpVar<F>>, ) -> Result<Vec<FpVar<F>>, SynthesisError>
Source§impl<CF: SonobeField, Cfg> MatrixGadget<LimbedVar<CF, Cfg, false>> for SparseMatrixVar<LimbedVar<CF, Cfg, false>>
impl<CF: SonobeField, Cfg> MatrixGadget<LimbedVar<CF, Cfg, false>> for SparseMatrixVar<LimbedVar<CF, Cfg, false>>
Source§fn mul_vector(
&self,
v: &impl Index<usize, Output = LimbedVar<CF, Cfg, false>>,
) -> Result<Vec<LimbedVar<CF, Cfg, false>>, SynthesisError>
fn mul_vector( &self, v: &impl Index<usize, Output = LimbedVar<CF, Cfg, false>>, ) -> Result<Vec<LimbedVar<CF, Cfg, false>>, SynthesisError>
Auto Trait Implementations§
impl<FV> Freeze for SparseMatrixVar<FV>
impl<FV> RefUnwindSafe for SparseMatrixVar<FV>where
FV: RefUnwindSafe,
impl<FV> Send for SparseMatrixVar<FV>where
FV: Send,
impl<FV> Sync for SparseMatrixVar<FV>where
FV: Sync,
impl<FV> Unpin for SparseMatrixVar<FV>where
FV: Unpin,
impl<FV> UnsafeUnpin for SparseMatrixVar<FV>
impl<FV> UnwindSafe for SparseMatrixVar<FV>where
FV: 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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