pub struct NatEvaluatedPoly<E: SetElement> {
pub evaluations: Vec<E>,
}Expand description
Polynomial evaluated on 0, 1, 2, ….
Fields§
§evaluations: Vec<E>Evaluations on P(0), P(1), P(2), …
Implementations§
Source§impl<E: SetElement> NatEvaluatedPoly<E>
impl<E: SetElement> NatEvaluatedPoly<E>
pub const fn new(evaluations: Vec<E>) -> Self
Sourcepub fn evaluate_at_point<C>(
&self,
cfg: &C,
point: &E,
) -> Result<E, EvaluationError>where
C: FieldConfig + ProjectPrimitiveIntegersWithConfig + SetConfig<Element = E>,
pub fn evaluate_at_point<C>(
&self,
cfg: &C,
point: &E,
) -> Result<E, EvaluationError>where
C: FieldConfig + ProjectPrimitiveIntegersWithConfig + SetConfig<Element = E>,
Interpolate the unique univariate polynomial of degree at most
evaluations.len()-1 passing through the y-values in evaluations at x
= 0,…, evaluations.len()-1
and evaluate this polynomial at point. In other words, efficiently
compute $\sum_{i=0}^{len\ evaluations - 1} evaluations[i] *
(\prod_{j!=i} (\text{point} - j)/(i-j))$.
Trait Implementations§
Source§impl<E: Clone + SetElement> Clone for NatEvaluatedPoly<E>
impl<E: Clone + SetElement> Clone for NatEvaluatedPoly<E>
Source§fn clone(&self) -> NatEvaluatedPoly<E>
fn clone(&self) -> NatEvaluatedPoly<E>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E: Debug + SetElement> Debug for NatEvaluatedPoly<E>
impl<E: Debug + SetElement> Debug for NatEvaluatedPoly<E>
Source§impl<E: PartialEq + SetElement> PartialEq for NatEvaluatedPoly<E>
impl<E: PartialEq + SetElement> PartialEq for NatEvaluatedPoly<E>
Source§fn eq(&self, other: &NatEvaluatedPoly<E>) -> bool
fn eq(&self, other: &NatEvaluatedPoly<E>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<E: SetElement> StructuralPartialEq for NatEvaluatedPoly<E>
Auto Trait Implementations§
impl<E> Freeze for NatEvaluatedPoly<E>
impl<E> RefUnwindSafe for NatEvaluatedPoly<E>where
E: RefUnwindSafe,
impl<E> Send for NatEvaluatedPoly<E>
impl<E> Sync for NatEvaluatedPoly<E>
impl<E> Unpin for NatEvaluatedPoly<E>where
E: Unpin,
impl<E> UnsafeUnpin for NatEvaluatedPoly<E>
impl<E> UnwindSafe for NatEvaluatedPoly<E>where
E: 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§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