pub struct WitnessIndex<'cs, 'alloc, P = PackedType<OptimalUnderlier, B128>>{ /* private fields */ }
Expand description
Holds witness column data for all tables in a constraint system, indexed by column ID.
The struct has two lifetimes: 'cs
is the lifetime of the constraint system, and 'alloc
is
the lifetime of the bump allocator. The reason these must be separate is that the witness index
gets converted into a multilinear extension index, which maintains references to the data
allocated by the allocator, but does not need to maintain a reference to the constraint system,
which can then be dropped.
Implementations§
Source§impl<'cs, 'alloc, F: TowerField, P: PackedField<Scalar = F>> WitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, F: TowerField, P: PackedField<Scalar = F>> WitnessIndex<'cs, 'alloc, P>
Sourcepub fn new(cs: &'cs ConstraintSystem<F>, allocator: &'alloc Bump) -> Self
pub fn new(cs: &'cs ConstraintSystem<F>, allocator: &'alloc Bump) -> Self
Creates and allocates the witness index for a constraint system.
pub fn init_table( &mut self, table_id: TableId, size: usize, ) -> Result<&mut TableWitnessIndex<'cs, 'alloc, P>, Error>
pub fn get_table( &mut self, table_id: TableId, ) -> Option<&mut TableWitnessIndex<'cs, 'alloc, P>>
pub fn fill_table_sequential<T: TableFiller<P>>( &mut self, filler: &T, rows: &[T::Event], ) -> Result<(), Error>
pub fn fill_table_parallel<T>( &mut self, filler: &T, rows: &[T::Event], ) -> Result<(), Error>
Sourcepub fn table_sizes(&self) -> Vec<usize>
pub fn table_sizes(&self) -> Vec<usize>
Returns the sizes of all tables in the witness, indexed by table ID.
pub fn into_multilinear_extension_index(
self,
) -> MultilinearExtensionIndex<'alloc, P>where
P: PackedExtension<B1> + PackedExtension<B8> + PackedExtension<B16> + PackedExtension<B32> + PackedExtension<B64> + PackedExtension<B128>,
Trait Implementations§
Source§impl<'cs, 'alloc, P> Debug for WitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, P> Debug for WitnessIndex<'cs, 'alloc, P>
Auto Trait Implementations§
impl<'cs, 'alloc, P> Freeze for WitnessIndex<'cs, 'alloc, P>where
<P as PackedField>::Scalar: Sized,
<<P as PackedField>::Scalar as WithUnderlier>::Underlier: Sized,
impl<'cs, 'alloc, P = <M128 as PackScalar<BinaryField128b>>::Packed> !RefUnwindSafe for WitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, P = <M128 as PackScalar<BinaryField128b>>::Packed> !Send for WitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, P = <M128 as PackScalar<BinaryField128b>>::Packed> !Sync for WitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, P> Unpin for WitnessIndex<'cs, 'alloc, P>where
<P as PackedField>::Scalar: Sized,
<<P as PackedField>::Scalar as WithUnderlier>::Underlier: Sized,
impl<'cs, 'alloc, P = <M128 as PackScalar<BinaryField128b>>::Packed> !UnwindSafe for WitnessIndex<'cs, 'alloc, P>
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
§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>
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