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 HostBumpAllocator<'alloc, P>,
) -> Self
pub fn new( cs: &'cs ConstraintSystem<F>, allocator: &'alloc HostBumpAllocator<'alloc, P>, ) -> 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.
Sourcepub fn into_multilinear_extension_index(
self,
) -> MultilinearExtensionIndex<'alloc, P>where
P: PackedExtension<B1> + PackedExtension<B8> + PackedExtension<B16> + PackedExtension<B32> + PackedExtension<B64> + PackedExtension<B128>,
pub fn into_multilinear_extension_index(
self,
) -> MultilinearExtensionIndex<'alloc, P>where
P: PackedExtension<B1> + PackedExtension<B8> + PackedExtension<B16> + PackedExtension<B32> + PackedExtension<B64> + PackedExtension<B128>,
Converts this witness into binius_core’s MultilinearExtensionIndex
.
Note that this function must be called only after the ConstraintSystem::compile
.
Source§impl<'cs, 'alloc, P> WitnessIndex<'cs, 'alloc, P>where
P: PackedField<Scalar: TowerField> + PackedExtension<B1> + PackedExtension<B8> + PackedExtension<B16> + PackedExtension<B32> + PackedExtension<B64> + PackedExtension<B128>,
impl<'cs, 'alloc, P> WitnessIndex<'cs, 'alloc, P>where
P: PackedField<Scalar: TowerField> + PackedExtension<B1> + PackedExtension<B8> + PackedExtension<B16> + PackedExtension<B32> + PackedExtension<B64> + PackedExtension<B128>,
Sourcepub fn fill_constant_cols(&mut self) -> Result<(), Error>
pub fn fill_constant_cols(&mut self) -> Result<(), Error>
Automatically populate the witness data for all the constant columns in all the tables with
a TableWitnessIndex<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
§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