Skip to main content

DynamicPolynomialF

Struct DynamicPolynomialF 

Source
pub struct DynamicPolynomialF<F: PrimeField> {
    pub coeffs: Vec<F>,
}
Expand description

Polynomials of dynamic degree. The implementation is tailored to work with random finite fields. To be used in UAIR and PIOP where ZIP+ degree bound is not observed anymore.

Note that operations involving dynamic polynomials do not trim leading zeros meaning one can end up with unequal objects of the type DynamicPoly<F> that represent equal polynomials, therefore trim has to be called before checking equality.

Fields§

§coeffs: Vec<F>

Implementations§

Source§

impl<F: PrimeField> DynamicPolynomialF<F>

Source

pub fn new_trimmed(coeffs: impl AsRef<[F]>) -> Self

Create a new polynomial with the given coefficients.

Source

pub fn new(coeffs: impl AsRef<[F]>) -> Self

Source

pub fn degree(&self) -> Option<usize>

Source

pub fn trim(&mut self)

Source

pub fn constant_poly(a: F) -> Self

Trait Implementations§

Source§

impl<F: PrimeField> Add<&DynamicPolynomialF<F>> for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<F: PrimeField> Add for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<F: PrimeField> AddAssign<&DynamicPolynomialF<F>> for DynamicPolynomialF<F>

Source§

fn add_assign(&mut self, rhs: &Self)

Performs the += operation. Read more
Source§

impl<F: PrimeField> AddAssign for DynamicPolynomialF<F>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<F: PrimeField> CheckedAdd for DynamicPolynomialF<F>

Source§

fn checked_add(&self, rhs: &Self) -> Option<Self>

Adds two numbers, checking for overflow. If overflow happens, None is returned.
Source§

impl<F: PrimeField> CheckedMul for DynamicPolynomialF<F>

Source§

fn checked_mul(&self, rhs: &Self) -> Option<Self>

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned.
Source§

impl<F: PrimeField> CheckedNeg for DynamicPolynomialF<F>

Source§

fn checked_neg(&self) -> Option<Self>

Negates a number, returning None for results that can’t be represented, like signed MIN values that can’t be positive, or non-zero unsigned values that can’t be negative. Read more
Source§

impl<F: PrimeField> CheckedSub for DynamicPolynomialF<F>

Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Subtracts two numbers, checking for underflow. If underflow happens, None is returned.
Source§

impl<F: Clone + PrimeField> Clone for DynamicPolynomialF<F>

Source§

fn clone(&self) -> DynamicPolynomialF<F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: PrimeField> ConstZero for DynamicPolynomialF<F>

Source§

const ZERO: Self

The additive identity element of Self, 0.
Source§

impl<F: Debug + PrimeField> Debug for DynamicPolynomialF<F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: PrimeField> Default for DynamicPolynomialF<F>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<F: PrimeField> Display for DynamicPolynomialF<F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: PrimeField> Div for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<F: PrimeField> Euclid for DynamicPolynomialF<F>

Source§

fn div_euclid(&self, v: &Self) -> Self

Calculates Euclidean division, the matching method for rem_euclid. Read more
Source§

fn rem_euclid(&self, v: &Self) -> Self

Calculates the least nonnegative remainder of self (mod v). Read more
Source§

fn div_rem_euclid(&self, divisor: &Self) -> (Self, Self)

Returns both the quotient and remainder from Euclidean division. Read more
Source§

impl<F: PrimeField> EvaluatablePolynomial<F, F> for DynamicPolynomialF<F>

Source§

type EvaluationPoint = F

The type of points a polynomial can be evaluated on. For univariate polynomials this typically is Out, for multivariate this is [Out].
Source§

fn evaluate_at_point(&self, point: &F) -> Result<F, EvaluationError>

Evaluates the polynomial at the given point.
Source§

impl<F: PrimeField, const DEGFEE_PLUS_ONE: usize> From<DensePolynomial<F, DEGFEE_PLUS_ONE>> for DynamicPolynomialF<F>

Source§

fn from(dense_poly: DensePolynomial<F, DEGFEE_PLUS_ONE>) -> Self

Converts to this type from the input type.
Source§

impl<F: PrimeField> From<Vec<F>> for DynamicPolynomialF<F>

Source§

fn from(value: Vec<F>) -> Self

Converts to this type from the input type.
Source§

impl<F: PrimeField> FromIterator<F> for DynamicPolynomialF<F>

Source§

fn from_iter<T: IntoIterator<Item = F>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<F: Hash + PrimeField> Hash for DynamicPolynomialF<F>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<F: PrimeField> Mul<&DynamicPolynomialF<F>> for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, F: PrimeField> Mul for &'a DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<F: PrimeField> Mul for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<F: PrimeField> MulAssign<&DynamicPolynomialF<F>> for DynamicPolynomialF<F>

Source§

fn mul_assign(&mut self, rhs: &Self)

Performs the *= operation. Read more
Source§

impl<F: PrimeField> MulAssign for DynamicPolynomialF<F>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<F: PrimeField> Neg for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<F: PartialEq + PrimeField> PartialEq for DynamicPolynomialF<F>

Source§

fn eq(&self, other: &DynamicPolynomialF<F>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F: PrimeField> Polynomial<F> for DynamicPolynomialF<F>

Source§

const DEGREE_BOUND: usize = usize::MAX

Source§

impl<F: PrimeField> Rem for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<F: PrimeField> Sub<&DynamicPolynomialF<F>> for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<F: PrimeField> Sub for DynamicPolynomialF<F>

Source§

type Output = DynamicPolynomialF<F>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<F: PrimeField> SubAssign<&DynamicPolynomialF<F>> for DynamicPolynomialF<F>

Source§

fn sub_assign(&mut self, rhs: &Self)

Performs the -= operation. Read more
Source§

impl<F: PrimeField> SubAssign for DynamicPolynomialF<F>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<F: PrimeField> Zero for DynamicPolynomialF<F>

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<F: Eq + PrimeField> Eq for DynamicPolynomialF<F>

Source§

impl<F: PrimeField> Semiring for DynamicPolynomialF<F>

Source§

impl<F: PrimeField> StructuralPartialEq for DynamicPolynomialF<F>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<F, T> IntoWithConfig<F> for T
where F: PrimeField + FromWithConfig<T>,

§

fn into_with_cfg(self, cfg: &<F as PrimeField>::Config) -> F

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,