pub enum Layer<F> {
GrandProduct(Mle<F>),
LogUpGeneric {
numerators: Mle<F>,
denominators: Mle<F>,
},
LogUpMultiplicities {
numerators: Mle<F>,
denominators: Mle<F>,
},
LogUpSingles {
denominators: Mle<F>,
},
}
Expand description
Represents a layer in a binary tree structured GKR circuit.
Layers can contain multiple columns, for example LogUp which has separate columns for numerators and denominators.
Variants§
GrandProduct(Mle<F>)
LogUpGeneric
LogUpMultiplicities
LogUpSingles
All numerators implicitly equal “1”.
Implementations§
Source§impl<F: Field> Layer<F>
impl<F: Field> Layer<F>
Sourcepub fn n_variables(&self) -> usize
pub fn n_variables(&self) -> usize
Returns the number of variables used to interpolate the layer’s gate values.
Sourcepub fn next_layer(&self) -> Option<Self>
pub fn next_layer(&self) -> Option<Self>
Produces the next layer from the current layer.
The next layer is strictly half the size of the current layer.
Returns None
if called on an output layer.
Sourcepub fn try_into_output_layer_values(self) -> Result<Vec<F>, NotOutputLayerError>
pub fn try_into_output_layer_values(self) -> Result<Vec<F>, NotOutputLayerError>
Returns each column output if the layer is an output layer, otherwise returns an Err
.
Sourcepub fn fix_first_variable(self, x0: F) -> Self
pub fn fix_first_variable(self, x0: F) -> Self
Returns a transformed layer with the first variable of each column fixed to assignment
.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Layer<F>
impl<F> RefUnwindSafe for Layer<F>where
F: RefUnwindSafe,
impl<F> Send for Layer<F>where
F: Send,
impl<F> Sync for Layer<F>where
F: Sync,
impl<F> Unpin for Layer<F>where
F: Unpin,
impl<F> UnwindSafe for Layer<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
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