Skip to main content

SparseMatrixVar

Struct SparseMatrixVar 

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

Source§

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>

Allocates a new constant of type Self in the ConstraintSystem cs. Read more
Source§

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>,

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>,

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

impl<FV: Clone> Clone for SparseMatrixVar<FV>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<FV: Debug> Debug for SparseMatrixVar<FV>

Source§

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

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

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>

MatrixGadget::mul_vector computes the product of self and a column vector v.
Source§

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>

MatrixGadget::mul_vector computes the product of self and a column vector v.

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more