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 words live in a buffer that starts on a 16-byte boundary.
That keeps the frequent bulk copies of the vector on the aligned SIMD memcpy path.
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 const fn size(&self) -> usize
pub const 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) without scratch space.
Sourcepub fn combined_witness(&self) -> &[Word]
pub fn combined_witness(&self) -> &[Word]
Returns the combined values vector.
Sourcepub fn eval_operand(&self, operand: &[ShiftedValueIndex]) -> Word
pub fn eval_operand(&self, operand: &[ShiftedValueIndex]) -> Word
Evaluates an operand against this witness.
An operand is the XOR of its shifted-value terms. An empty operand evaluates to the zero word, the XOR identity.
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 UnsafeUnpin 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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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