pub struct EvaluationDomain<F: Field> { /* private fields */ }Expand description
A domain that univariate polynomials may be evaluated on.
An evaluation domain of size d + 1 together with polynomial values on that domain uniquely defines a degree <= d polynomial.
Implementations§
Source§impl<F: Field> EvaluationDomain<F>
impl<F: Field> EvaluationDomain<F>
Sourcepub fn from_points(points: Vec<F>) -> Self
pub fn from_points(points: Vec<F>) -> Self
pub fn size(&self) -> usize
pub fn points(&self) -> &[F]
Sourcepub fn lagrange_evals(&self, x: F) -> Vec<F>
pub fn lagrange_evals(&self, x: F) -> Vec<F>
Compute a vector of Lagrange polynomial evaluations in $O(N)$ at a given point x.
For an evaluation domain consisting of points $x_i$ Lagrange polynomials $L_i(x)$ are defined by
$$L_i(x) = \prod_{j \neq i}\frac{x - \pi_j}{\pi_i - \pi_j}$$
Sourcepub fn extrapolate(&self, values: &[F], x: F) -> F
pub fn extrapolate(&self, values: &[F], x: F) -> F
Evaluate the unique interpolated polynomial at any point x.
Computational complexity is $O(n)$, for a domain of size $n$.
Trait Implementations§
Source§impl<F: Clone + Field> Clone for EvaluationDomain<F>
impl<F: Clone + Field> Clone for EvaluationDomain<F>
Source§fn clone(&self) -> EvaluationDomain<F>
fn clone(&self) -> EvaluationDomain<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<F> Freeze for EvaluationDomain<F>where
<F as WithUnderlier>::Underlier: Sized,
impl<F> RefUnwindSafe for EvaluationDomain<F>where
<F as WithUnderlier>::Underlier: Sized,
F: RefUnwindSafe,
impl<F> Send for EvaluationDomain<F>where
<F as WithUnderlier>::Underlier: Sized,
impl<F> Sync for EvaluationDomain<F>where
<F as WithUnderlier>::Underlier: Sized,
impl<F> Unpin for EvaluationDomain<F>
impl<F> UnwindSafe for EvaluationDomain<F>where
<F as WithUnderlier>::Underlier: Sized,
F: UnwindSafe,
Blanket Implementations§
§impl<T> AsMaybeUninit for T
impl<T> AsMaybeUninit for T
§type Uninit = MaybeUninit<T>
type Uninit = MaybeUninit<T>
This type in its maybe-uninitialized form.
§fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
Converts a
&self to its maybe-initialized equivalent.§unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
Converts a
&mut T to its maybe-initialized equivalent. Read more§unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
Converts a raw pointer to a reference to maybe-uninit. Read more
§unsafe fn raw_mut_as_uninit<'a>(
raw: *mut T,
) -> &'a mut <T as AsMaybeUninit>::Uninit
unsafe fn raw_mut_as_uninit<'a>( raw: *mut T, ) -> &'a mut <T as AsMaybeUninit>::Uninit
Converts a raw mutable pointer to a mutable reference to maybe-uninit. Read more
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,
§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