pub struct Encoder { /* private fields */ }
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn new(cnt: usize, max_degree: u32) -> Self
pub fn new(cnt: usize, max_degree: u32) -> Self
Create a new encoder for a given number of flags and maximum degree.
The flags will correspond to points in F^k, where k is the number of variables.
The zero point is reserved for the dummy row.
max_degree
is the upper bound for the flag expressions, but the eval
function
of the encoder itself will use some constraints of degree max_degree + 1
.
pub fn get_flag_expr<AB: InteractionBuilder>( &self, flag_idx: usize, vars: &[AB::Var], ) -> AB::Expr
pub fn get_flag_pt(&self, flag_idx: usize) -> Vec<u32>
pub fn is_valid<AB: InteractionBuilder>(&self, vars: &[AB::Var]) -> AB::Expr
pub fn flags<AB: InteractionBuilder>(&self, vars: &[AB::Var]) -> Vec<AB::Expr>
pub fn sum_of_unused<AB: InteractionBuilder>( &self, vars: &[AB::Var], ) -> AB::Expr
pub fn width(&self) -> usize
Trait Implementations§
Source§impl<AB: InteractionBuilder> SubAir<AB> for Encoder
impl<AB: InteractionBuilder> SubAir<AB> for Encoder
Source§type AirContext<'a> = &'a [<AB as AirBuilder>::Var]
where
AB: 'a,
AB::Var: 'a,
AB::Expr: 'a
type AirContext<'a> = &'a [<AB as AirBuilder>::Var] where AB: 'a, AB::Var: 'a, AB::Expr: 'a
Type to define the context, typically in terms of
AB::Expr
that are needed
to define the SubAir’s constraints.fn eval<'a>(&'a self, builder: &'a mut AB, local: &'a [AB::Var])where
AB: 'a,
AB::Expr: 'a,
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
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