pub struct TableWitnessIndex<'cs, 'alloc, P = PackedType<OptimalUnderlier, B128>>{ /* private fields */ }
Expand description
Holds witness column data for a table, indexed by column index.
Implementations§
Source§impl<'cs, 'alloc, P> TableWitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, P> TableWitnessIndex<'cs, 'alloc, P>
pub fn table(&self) -> &'cs Table<P::Scalar>
pub fn log_capacity(&self) -> usize
Sourcepub fn min_log_segment_size(&self) -> usize
pub fn min_log_segment_size(&self) -> usize
Binary logarithm of the mininimum segment size.
This is the minimum number of logical rows that can be put into one segment during iteration. It is the maximum number of logical rows occupied by a single underlier.
Source§impl<'cs, 'alloc, F: TowerField, P: PackedField<Scalar = F>> TableWitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, F: TowerField, P: PackedField<Scalar = F>> TableWitnessIndex<'cs, 'alloc, P>
pub fn new( allocator: &'alloc Bump, table: &'cs Table<F>, size: usize, ) -> Result<Self, Error>
pub fn table_id(&self) -> TableId
pub fn capacity(&self) -> usize
Sourcepub fn full_segment(&mut self) -> TableWitnessSegment<'_, P>
pub fn full_segment(&mut self) -> TableWitnessSegment<'_, P>
Returns a witness index segment covering the entire table.
Sourcepub fn fill_sequential<T: TableFiller<P>>(
&mut self,
table: &T,
rows: &[T::Event],
) -> Result<(), Error>
pub fn fill_sequential<T: TableFiller<P>>( &mut self, table: &T, rows: &[T::Event], ) -> Result<(), Error>
Fill a full table witness index using the given row data.
This function iterates through witness segments sequentially in a single thread.
Sourcepub fn fill_parallel<T>(
&mut self,
table: &T,
rows: &[T::Event],
) -> Result<(), Error>
pub fn fill_parallel<T>( &mut self, table: &T, rows: &[T::Event], ) -> Result<(), Error>
Fill a full table witness index using the given row data.
This function iterates through witness segments in parallel in multiple threads.
Sourcepub fn fill_sequential_with_segment_size<T: TableFiller<P>>(
&mut self,
table: &T,
rows: &[T::Event],
log_size: usize,
) -> Result<(), Error>
pub fn fill_sequential_with_segment_size<T: TableFiller<P>>( &mut self, table: &T, rows: &[T::Event], log_size: usize, ) -> Result<(), Error>
Fill a full table witness index using the given row data.
This function iterates through witness segments sequentially in a single thread.
Sourcepub fn fill_parallel_with_segment_size<T>(
&mut self,
table: &T,
rows: &[T::Event],
log_size: usize,
) -> Result<(), Error>
pub fn fill_parallel_with_segment_size<T>( &mut self, table: &T, rows: &[T::Event], log_size: usize, ) -> Result<(), Error>
Fill a full table witness index using the given row data.
This function iterates through witness segments in parallel in multiple threads.
Sourcepub fn segments(
&mut self,
log_size: usize,
) -> impl Iterator<Item = TableWitnessSegment<'_, P>>
pub fn segments( &mut self, log_size: usize, ) -> impl Iterator<Item = TableWitnessSegment<'_, P>>
Returns an iterator over segments of witness index rows.
This method clamps the segment size, requested as log_size
, to a minimum of
self.min_log_segment_size()
and a maximum of self.log_capacity()
. The actual segment
size can be queried on the items yielded by the iterator.
pub fn par_segments( &mut self, log_size: usize, ) -> impl IndexedParallelIterator<Item = TableWitnessSegment<'_, P>>
Trait Implementations§
Source§impl<'cs, 'alloc, P> Debug for TableWitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, P> Debug for TableWitnessIndex<'cs, 'alloc, P>
Auto Trait Implementations§
impl<'cs, 'alloc, P> Freeze for TableWitnessIndex<'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 TableWitnessIndex<'cs, 'alloc, P>
impl<'cs, 'alloc, P> Send for TableWitnessIndex<'cs, 'alloc, P>where
<P as PackedField>::Scalar: Sized,
<<P as PackedField>::Scalar as WithUnderlier>::Underlier: Sized,
impl<'cs, 'alloc, P> Sync for TableWitnessIndex<'cs, 'alloc, P>where
<P as PackedField>::Scalar: Sized,
<<P as PackedField>::Scalar as WithUnderlier>::Underlier: Sized,
impl<'cs, 'alloc, P> Unpin for TableWitnessIndex<'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 TableWitnessIndex<'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
§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