pub struct MultilinearQuery<P, Data>{ /* private fields */ }
Expand description
Tensor product expansion of sumcheck round challenges.
Stores the tensor product expansion $\bigotimes_{i = 0}^{n - 1} (1 - r_i, r_i)$
when round()
is n
for the sequence of sumcheck challenges $(r_0, …, r_{n-1})$.
The tensor product can be updated with a new round challenge in linear time.
This is used in the first several rounds of the sumcheck prover for small-field polynomials,
before it becomes more efficient to switch over to the method that store folded multilinears.
Implementations§
source§impl<P: PackedField> MultilinearQuery<P, Box<[P]>>
impl<P: PackedField> MultilinearQuery<P, Box<[P]>>
source§impl<P: PackedField, Data: DerefMut<Target = [P]>> MultilinearQuery<P, Data>
impl<P: PackedField, Data: DerefMut<Target = [P]>> MultilinearQuery<P, Data>
pub fn with_expansion( n_vars: usize, expanded_query: Data, ) -> Result<Self, Error>
pub fn n_vars(&self) -> usize
sourcepub fn expansion(&self) -> &[P]
pub fn expansion(&self) -> &[P]
Returns the tensor product expansion of the query
If the number of query variables is less than the packing width, return a single packed element.
pub fn expansion_mut(&mut self) -> &mut [P]
pub fn into_expansion(self) -> Data
pub fn update( self, extra_query_coordinates: &[P::Scalar], ) -> Result<Self, Error>
pub fn to_ref(&self) -> MultilinearQueryRef<'_, P>
Trait Implementations§
source§impl<P, Data> Debug for MultilinearQuery<P, Data>
impl<P, Data> Debug for MultilinearQuery<P, Data>
source§impl<'a, P: PackedField, Data: DerefMut<Target = [P]>> From<&'a MultilinearQuery<P, Data>> for MultilinearQueryRef<'a, P>
impl<'a, P: PackedField, Data: DerefMut<Target = [P]>> From<&'a MultilinearQuery<P, Data>> for MultilinearQueryRef<'a, P>
source§fn from(query: &'a MultilinearQuery<P, Data>) -> Self
fn from(query: &'a MultilinearQuery<P, Data>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<P, Data> Freeze for MultilinearQuery<P, Data>where
Data: Freeze,
impl<P, Data> RefUnwindSafe for MultilinearQuery<P, Data>where
Data: RefUnwindSafe,
impl<P, Data> Send for MultilinearQuery<P, Data>where
Data: Send,
impl<P, Data> Sync for MultilinearQuery<P, Data>where
Data: Sync,
impl<P, Data> Unpin for MultilinearQuery<P, Data>where
Data: Unpin,
impl<P, Data> UnwindSafe for MultilinearQuery<P, Data>where
Data: 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
§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>
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