pub struct MultivariateRing<F: FieldExtension, M: Positive, Form> { /* private fields */ }Expand description
An element P(X_0, ..., X_{N-1}) of the multivariate polynomial ring with N variables.
The polynomial can be either in coefficient or in evaluation form, given by Form
parameter. The number of coefficients/evaluations is M = 2 ^ N.
In coefficient representation data are the coefficients of the polynomial:
\sum_{i=0..2^N-1} c_i * \Prod_{j=0..N-1} X_j ^ bin(i)_j
bin(i) is the binary-decomposition of i (LSB first).
For example for N=2 the 2-variate polynomial is c_0 + c_1 . X_0 + c_2 . X_1 + c_3 . X_0 . X_1 and data = [c_0, c_1, c_2, c_3].
In evaluation representation data are the evaluations:
e_i = P(bin_signed(i))
bin_signed(i) is the signed binary-decomposition of i (LSB first).
For example for N=2 the evaluations are:
- e_0 = P(-1, -1)
- e_1 = P(-1, 1)
- e_2 = P( 1, -1)
- e_3 = P( 1, 1)
and data = [e_0, e_1, e_2, e_3]
Implementations§
Source§impl<F: FieldExtension, M: Positive + PowerOfTwo, Form> MultivariateRing<F, M, Form>
impl<F: FieldExtension, M: Positive + PowerOfTwo, Form> MultivariateRing<F, M, Form>
pub fn new(data: SubfieldElements<F, M>) -> Self
pub fn random(rng: impl CryptoRngCore) -> Self
pub fn data(&self) -> &SubfieldElements<F, M>
pub fn into_data(self) -> SubfieldElements<F, M>
Source§impl<F: FieldExtension, M: Positive + PowerOfTwo> MultivariateRing<F, M, Coefficient>
impl<F: FieldExtension, M: Positive + PowerOfTwo> MultivariateRing<F, M, Coefficient>
Sourcepub fn to_eval_repr(self) -> MultivariateRing<F, M, Evaluation>
pub fn to_eval_repr(self) -> MultivariateRing<F, M, Evaluation>
Transform polynomial from coefficient representation to evaluation representation using the Walsh-Hadamard transform.
pub fn nb_coefs(&self) -> usize
Source§impl<F: FieldExtension, M: Positive + PowerOfTwo> MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive + PowerOfTwo> MultivariateRing<F, M, Evaluation>
pub fn new_from_sparse_coef( coefs: impl IntoIterator<Item = (usize, SubfieldElement<F>)>, ) -> Self
pub fn from_coeffs(coefs: SubfieldElements<F, M>) -> Self
pub fn square(&self) -> Self
pub fn nb_evals(&self) -> usize
Trait Implementations§
Source§impl<F: FieldExtension, M: Positive + PowerOfTwo> Add for MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive + PowerOfTwo> Add for MultivariateRing<F, M, Evaluation>
Source§type Output = MultivariateRing<F, M, Evaluation>
type Output = MultivariateRing<F, M, Evaluation>
+ operator.Source§impl<F: FieldExtension, M: Positive> AddAssign for MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive> AddAssign for MultivariateRing<F, M, Evaluation>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<F: Clone + FieldExtension, M: Clone + Positive, Form: Clone> Clone for MultivariateRing<F, M, Form>
impl<F: Clone + FieldExtension, M: Clone + Positive, Form: Clone> Clone for MultivariateRing<F, M, Form>
Source§fn clone(&self) -> MultivariateRing<F, M, Form>
fn clone(&self) -> MultivariateRing<F, M, Form>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug + FieldExtension, M: Debug + Positive, Form: Debug> Debug for MultivariateRing<F, M, Form>
impl<F: Debug + FieldExtension, M: Debug + Positive, Form: Debug> Debug for MultivariateRing<F, M, Form>
Source§impl<F: Default + FieldExtension, M: Default + Positive, Form: Default> Default for MultivariateRing<F, M, Form>
impl<F: Default + FieldExtension, M: Default + Positive, Form: Default> Default for MultivariateRing<F, M, Form>
Source§fn default() -> MultivariateRing<F, M, Form>
fn default() -> MultivariateRing<F, M, Form>
Source§impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul for MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul for MultivariateRing<F, M, Evaluation>
Source§type Output = MultivariateRing<F, M, Evaluation>
type Output = MultivariateRing<F, M, Evaluation>
* operator.Source§fn mul(self, rhs: MultivariateRing<F, M, Evaluation>) -> Self::Output
fn mul(self, rhs: MultivariateRing<F, M, Evaluation>) -> Self::Output
* operation. Read moreSource§impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul<&MultivariateRing<F, M, Evaluation>> for MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul<&MultivariateRing<F, M, Evaluation>> for MultivariateRing<F, M, Evaluation>
Source§type Output = MultivariateRing<F, M, Evaluation>
type Output = MultivariateRing<F, M, Evaluation>
* operator.Source§fn mul(self, rhs: &MultivariateRing<F, M, Evaluation>) -> Self::Output
fn mul(self, rhs: &MultivariateRing<F, M, Evaluation>) -> Self::Output
* operation. Read moreSource§impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul<&MultivariateRing<F, M, Evaluation>> for &MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul<&MultivariateRing<F, M, Evaluation>> for &MultivariateRing<F, M, Evaluation>
Source§type Output = MultivariateRing<F, M, Evaluation>
type Output = MultivariateRing<F, M, Evaluation>
* operator.Source§fn mul(self, rhs: &MultivariateRing<F, M, Evaluation>) -> Self::Output
fn mul(self, rhs: &MultivariateRing<F, M, Evaluation>) -> Self::Output
* operation. Read moreSource§impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul<MultivariateRing<F, M, Evaluation>> for &MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive + PowerOfTwo> Mul<MultivariateRing<F, M, Evaluation>> for &MultivariateRing<F, M, Evaluation>
Source§type Output = MultivariateRing<F, M, Evaluation>
type Output = MultivariateRing<F, M, Evaluation>
* operator.Source§fn mul(self, rhs: MultivariateRing<F, M, Evaluation>) -> Self::Output
fn mul(self, rhs: MultivariateRing<F, M, Evaluation>) -> Self::Output
* operation. Read moreSource§impl<F: PartialEq + FieldExtension, M: PartialEq + Positive, Form: PartialEq> PartialEq for MultivariateRing<F, M, Form>
impl<F: PartialEq + FieldExtension, M: PartialEq + Positive, Form: PartialEq> PartialEq for MultivariateRing<F, M, Form>
Source§fn eq(&self, other: &MultivariateRing<F, M, Form>) -> bool
fn eq(&self, other: &MultivariateRing<F, M, Form>) -> bool
self and other values to be equal, and is used by ==.impl<F: FieldExtension, M: Positive, Form> StructuralPartialEq for MultivariateRing<F, M, Form>
Source§impl<F: FieldExtension, M: Positive + PowerOfTwo> Sum for MultivariateRing<F, M, Evaluation>
impl<F: FieldExtension, M: Positive + PowerOfTwo> Sum for MultivariateRing<F, M, Evaluation>
Auto Trait Implementations§
impl<F, M, Form> Freeze for MultivariateRing<F, M, Form>
impl<F, M, Form> RefUnwindSafe for MultivariateRing<F, M, Form>
impl<F, M, Form> Send for MultivariateRing<F, M, Form>where
Form: Send,
impl<F, M, Form> Sync for MultivariateRing<F, M, Form>where
Form: Sync,
impl<F, M, Form> Unpin for MultivariateRing<F, M, Form>where
Form: Unpin,
impl<F, M, Form> UnsafeUnpin for MultivariateRing<F, M, Form>
impl<F, M, Form> UnwindSafe for MultivariateRing<F, M, Form>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.