pub struct KeySegment {
pub keys: Vec<Key>,
pub key_ranges: Vec<Range<u32>>,
pub constraint_indices: Vec<ConstraintIndex>,
pub dense_shift_enc: DenseShiftEncoding,
}Expand description
One value-vector segment’s keys, public or hidden. Indexed so each word’s constraints can be found without a scan.
Fields§
§keys: Vec<Key>Every key of the segment, flattened into one vector.
key_ranges: Vec<Range<u32>>One range per word, at that word’s segment-relative index. The range names that word’s keys inside the flattened keys vector.
constraint_indices: Vec<ConstraintIndex>The constraint indices the keys reference, flattened into one vector.
dense_shift_enc: DenseShiftEncodingThe shift sequences the segment’s keys name.
Implementations§
Source§impl KeySegment
impl KeySegment
Sourcepub fn word_keys(&self, index: usize) -> &[Key]
pub fn word_keys(&self, index: usize) -> &[Key]
The keys for the word at the given segment-relative index.
Sourcepub fn build_g<F: Field, P: PackedField<Scalar = F>>(
&self,
words: &[Word],
prepared: &PreparedOperandClaims<F>,
) -> Box<[P]>
pub fn build_g<F: Field, P: PackedField<Scalar = F>>( &self, words: &[Word], prepared: &PreparedOperandClaims<F>, ) -> Box<[P]>
Accumulates this segment’s rows of the witness-and-batching multilinear.
Every witness word can carry several shift keys, one per operand position it feeds. For each key, this folds its constraint-index tensor and batching powers into one accumulator value, then scatters that value across the bit positions the word has set.
§Returns
One row of weights per shift this segment uses, one weight per bit position of a word, at the position this segment’s own dense encoding assigns to that shift.
Trait Implementations§
Source§impl Clone for KeySegment
impl Clone for KeySegment
Source§fn clone(&self) -> KeySegment
fn clone(&self) -> KeySegment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeySegment
impl Debug for KeySegment
Source§impl DeserializeBytes for KeySegment
impl DeserializeBytes for KeySegment
fn deserialize(read_buf: impl Buf) -> Result<Self, SerializationError>
Source§impl SerializeBytes for KeySegment
impl SerializeBytes for KeySegment
Auto Trait Implementations§
impl Freeze for KeySegment
impl RefUnwindSafe for KeySegment
impl Send for KeySegment
impl Sync for KeySegment
impl Unpin for KeySegment
impl UnsafeUnpin for KeySegment
impl UnwindSafe for KeySegment
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