pub struct VirtualPairCol<F: Field> { /* private fields */ }Expand description
An affine linear combination of columns in a PAIR (Preprocessed AIR).
This structure represents the column V with entries V[j] = Σ(w_i * V_i[j]) + c where:
w_iare the column weightsV_iare the columns (either preprocessed or main trace columns)cis a constant term
Implementations§
Source§impl<F: Field> VirtualPairCol<F>
impl<F: Field> VirtualPairCol<F>
Sourcepub const fn new(column_weights: Vec<(PairCol, F)>, constant: F) -> Self
pub const fn new(column_weights: Vec<(PairCol, F)>, constant: F) -> Self
Creates a new virtual column with the specified column weights and constant term.
§Arguments
column_weights- Vector of (column, weight) pairs defining the linear combinationconstant- Constant term to add to the linear combination
Sourcepub fn new_preprocessed(column_weights: Vec<(usize, F)>, constant: F) -> Self
pub fn new_preprocessed(column_weights: Vec<(usize, F)>, constant: F) -> Self
Creates a virtual column as a linear combination of preprocessed columns.
§Arguments
column_weights- Vector of (column_index, weight) pairs for preprocessed columnsconstant- Constant term to add to the combination
Sourcepub fn new_main(column_weights: Vec<(usize, F)>, constant: F) -> Self
pub fn new_main(column_weights: Vec<(usize, F)>, constant: F) -> Self
Creates a virtual column as a linear combination of main trace columns.
§Arguments
column_weights- Vector of (column_index, weight) pairs for main trace columnsconstant- Constant term to add to the combination
Sourcepub const fn constant(x: F) -> Self
pub const fn constant(x: F) -> Self
Create a virtual column whose value on every row is equal and constant.
§Arguments
x- The constant field element.
Sourcepub fn single_preprocessed(column: usize) -> Self
pub fn single_preprocessed(column: usize) -> Self
Creates a virtual column equal to a preprocessed column.
§Arguments
column- Index of the preprocessed column
Sourcepub fn single_main(column: usize) -> Self
pub fn single_main(column: usize) -> Self
Creates a virtual column equal to a main trace column.
§Arguments
column- Index of the main trace column
Sourcepub fn sum_main(columns: Vec<usize>) -> Self
pub fn sum_main(columns: Vec<usize>) -> Self
Create a virtual column which is the sum of main trace columns.
§Arguments
columns- Vector of main trace column indices to sum
Sourcepub fn sum_preprocessed(columns: Vec<usize>) -> Self
pub fn sum_preprocessed(columns: Vec<usize>) -> Self
Create a virtual column which is the sum of preprocessed columns.
§Arguments
columns- Vector of preprocessed column indices to sum
Sourcepub fn diff_preprocessed(a_col: usize, b_col: usize) -> Self
pub fn diff_preprocessed(a_col: usize, b_col: usize) -> Self
Create a virtual column which is the difference between two preprocessed columns.
§Arguments
a_col- Index of the minuend preprocessed column.b_col- Index of the subtrahend preprocessed column.
Sourcepub fn diff_main(a_col: usize, b_col: usize) -> Self
pub fn diff_main(a_col: usize, b_col: usize) -> Self
Create a virtual column which is the difference between two main trace columns.
§Arguments
a_col- Index of the minuend main trace column.b_col- Index of the subtrahend main trace column.
Sourcepub fn apply<Expr, Var>(&self, preprocessed: &[Var], main: &[Var]) -> Expr
pub fn apply<Expr, Var>(&self, preprocessed: &[Var], main: &[Var]) -> Expr
Evaluates the virtual column at a given row by applying the affine linear combination to a pair of preprocessed and main trace rows.
This computes Σ(w_i * column_values[i]) + constant
§Arguments
preprocessed- Row of preprocessed values.main- Row of main trace values.
Trait Implementations§
Source§impl<F: Clone + Field> Clone for VirtualPairCol<F>
impl<F: Clone + Field> Clone for VirtualPairCol<F>
Source§fn clone(&self) -> VirtualPairCol<F>
fn clone(&self) -> VirtualPairCol<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<F> Freeze for VirtualPairCol<F>where
F: Freeze,
impl<F> RefUnwindSafe for VirtualPairCol<F>where
F: RefUnwindSafe,
impl<F> Send for VirtualPairCol<F>
impl<F> Sync for VirtualPairCol<F>
impl<F> Unpin for VirtualPairCol<F>where
F: Unpin,
impl<F> UnwindSafe for VirtualPairCol<F>where
F: UnwindSafe,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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