Skip to main content

DynamicPolynomialFS

Struct DynamicPolynomialFS 

Source
pub struct DynamicPolynomialFS<R: FixedSemiring> {
    pub coeffs: Vec<R>,
}
Expand description

Polynomials of dynamic degree. The implementation is tailored to work with FixedSemirings. 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<R> that represent equal polynomials, therefore trim has to be called before checking equality.

Fields§

§coeffs: Vec<R>

Implementations§

Source§

impl<R: FixedSemiring> DynamicPolynomialFS<R>

Source

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

Create a new polynomial with the given coefficients.

Source

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

Source

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

Source

pub fn trim(&mut self)

Trait Implementations§

Source§

impl<R: FixedSemiring> Add<&DynamicPolynomialFS<R>> for DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<R: FixedSemiring> Add for DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<R: FixedSemiring> AddAssign<&DynamicPolynomialFS<R>> for DynamicPolynomialFS<R>

Source§

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

Performs the += operation. Read more
Source§

impl<R: FixedSemiring> AddAssign for DynamicPolynomialFS<R>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<R: FixedSemiring> CheckedAdd for DynamicPolynomialFS<R>

Source§

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

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

impl<R: FixedSemiring> CheckedMul for DynamicPolynomialFS<R>

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<R: FixedSemiring + Ring> CheckedNeg for DynamicPolynomialFS<R>

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<R: FixedSemiring> CheckedSub for DynamicPolynomialFS<R>

Source§

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

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

impl<R: Clone + FixedSemiring> Clone for DynamicPolynomialFS<R>

Source§

fn clone(&self) -> DynamicPolynomialFS<R>

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<R: FixedSemiring> ConstZero for DynamicPolynomialFS<R>

Source§

const ZERO: Self

The additive identity element of Self, 0.
Source§

impl<R: Debug + FixedSemiring> Debug for DynamicPolynomialFS<R>

Source§

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

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

impl<R: Default + FixedSemiring> Default for DynamicPolynomialFS<R>

Source§

fn default() -> DynamicPolynomialFS<R>

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

impl<R: FixedSemiring> Display for DynamicPolynomialFS<R>

Source§

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

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

impl<R: FixedSemiring> EvaluatablePolynomial<R, R> for DynamicPolynomialFS<R>

Source§

type EvaluationPoint = R

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: &R) -> Result<R, EvaluationError>

Evaluates the polynomial at the given point.
Source§

impl<const DEGREE_PLUS_ONE: usize> From<BinaryU64Poly<DEGREE_PLUS_ONE>> for DynamicPolynomialFS<Boolean>

Source§

fn from(binary_poly: BinaryPoly<DEGREE_PLUS_ONE>) -> Self

Converts to this type from the input type.
Source§

impl<R: FixedSemiring, const DEGREE_PLUS_ONE: usize> From<DensePolynomial<R, DEGREE_PLUS_ONE>> for DynamicPolynomialFS<R>

Source§

fn from(dense_poly: DensePolynomial<R, DEGREE_PLUS_ONE>) -> Self

Converts to this type from the input type.
Source§

impl<R: FixedSemiring> From<Vec<R>> for DynamicPolynomialFS<R>

Source§

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

Converts to this type from the input type.
Source§

impl<R: Hash + FixedSemiring> Hash for DynamicPolynomialFS<R>

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<R: FixedSemiring> Mul<&DynamicPolynomialFS<R>> for DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<'a, R: FixedSemiring> Mul for &'a DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<R: FixedSemiring> Mul for DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<R: FixedSemiring> MulAssign<&DynamicPolynomialFS<R>> for DynamicPolynomialFS<R>

Source§

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

Performs the *= operation. Read more
Source§

impl<R: FixedSemiring> MulAssign for DynamicPolynomialFS<R>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<R: FixedSemiring + Ring> Neg for DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<R: FixedSemiring> One for DynamicPolynomialFS<R>

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl<R: PartialEq + FixedSemiring> PartialEq for DynamicPolynomialFS<R>

Source§

fn eq(&self, other: &DynamicPolynomialFS<R>) -> 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<R: FixedSemiring> Polynomial<R> for DynamicPolynomialFS<R>

Source§

const DEGREE_BOUND: usize = usize::MAX

Source§

impl<R, F> ProjectableToField<F> for DynamicPolynomialFS<R>
where R: FixedSemiring, F: PrimeField + for<'a> FromWithConfig<&'a R> + for<'a> MulByScalar<&'a F> + 'static,

Source§

fn prepare_projection( sampled_value: &F, ) -> impl Fn(&DynamicPolynomialFS<R>) -> F + Send + Sync + 'static

Prepare a projection function that will project the current type to a prime field using the given sampled value.
Source§

impl<R: FixedSemiring> Sub<&DynamicPolynomialFS<R>> for DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<R: FixedSemiring> Sub for DynamicPolynomialFS<R>

Source§

type Output = DynamicPolynomialFS<R>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<R: FixedSemiring> SubAssign<&DynamicPolynomialFS<R>> for DynamicPolynomialFS<R>

Source§

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

Performs the -= operation. Read more
Source§

impl<R: FixedSemiring> SubAssign for DynamicPolynomialFS<R>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<R: FixedSemiring> Zero for DynamicPolynomialFS<R>

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<R: Eq + FixedSemiring> Eq for DynamicPolynomialFS<R>

Source§

impl<R: FixedSemiring + Ring> Ring for DynamicPolynomialFS<R>

Source§

impl<R: FixedSemiring> Semiring for DynamicPolynomialFS<R>

Source§

impl<R: FixedSemiring> StructuralPartialEq for DynamicPolynomialFS<R>

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