pub struct ValueVec { /* private fields */ }
Expand description
The vector of values used in constraint evaluation and proof generation.
ValueVec
is the concrete instantiation of values that satisfy (or should satisfy) a
ConstraintSystem
. It follows the layout defined by ValueVecLayout
and serves
as the primary data structure for both constraint evaluation and polynomial commitment.
Between these sections, there may be padding regions to satisfy alignment requirements. The total size is always a power of two as required for technical reasons.
Implementations§
Source§impl ValueVec
impl ValueVec
Sourcepub fn new(layout: ValueVecLayout) -> ValueVec
pub fn new(layout: ValueVecLayout) -> ValueVec
Creates a new value vector with the given layout.
The values are filled with zeros.
Sourcepub fn new_from_data(
layout: ValueVecLayout,
public: Vec<Word>,
private: Vec<Word>,
) -> Result<ValueVec, ConstraintSystemError>
pub fn new_from_data( layout: ValueVecLayout, public: Vec<Word>, private: Vec<Word>, ) -> Result<ValueVec, ConstraintSystemError>
Creates a new value vector with the given layout and data.
The data is checked to have the correct length.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
The total size of the committed portion of the vector (excluding scratch).
Sourcepub fn get(&self, index: usize) -> Word
pub fn get(&self, index: usize) -> Word
Returns the value stored at the given index.
Panics if the index is out of bounds. Will happily return a value from the padding section.
Sourcepub fn set(&mut self, index: usize, value: Word)
pub fn set(&mut self, index: usize, value: Word)
Sets the value at the given index.
Panics if the index is out of bounds. Will gladly assign a value to the padding section.
Sourcepub fn non_public(&self) -> &[Word]
pub fn non_public(&self) -> &[Word]
Return all non-public values (witness + internal).
Sourcepub fn combined_witness(&self) -> &[Word]
pub fn combined_witness(&self) -> &[Word]
Returns the combined values vector.
Trait Implementations§
Source§impl Index<ValueIndex> for ValueVec
impl Index<ValueIndex> for ValueVec
Auto Trait Implementations§
impl Freeze for ValueVec
impl RefUnwindSafe for ValueVec
impl Send for ValueVec
impl Sync for ValueVec
impl Unpin for ValueVec
impl UnwindSafe for ValueVec
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
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>
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>
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