Skip to main content

DensePolynomialConfig

Struct DensePolynomialConfig 

Source
pub struct DensePolynomialConfig<'a, S: SemiringConfig, const DEGREE_PLUS_ONE: usize> {
    pub cfg: &'a S,
}
Expand description

Configuration of the polynomial semiring $S[X]$ over the (semi)ring configured by S, with [DynamicPolynomial] as its element.

Implements exactly the layer its coefficients provide: [SemiringConfig] over a semiring, additionally [RingConfig] over a ring. The polynomial ring is never a field, hence no [FieldConfig]; Euclidean division (which needs coefficient inversion), evaluation and other polynomial-specific operations are provided as inherent methods.

Checked operations delegate to the coefficient config’s checked operations, so overflow behavior follows the coefficients (e.g. Int coefficients can overflow, field coefficients cannot).

Fields§

§cfg: &'a S

Implementations§

Source§

impl<'a, S: SemiringConfig, const DEGREE_PLUS_ONE: usize> DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source

pub fn new_padded( &self, coeffs: impl AsRef<[S::Element]>, ) -> DensePolynomial<S::Element, DEGREE_PLUS_ONE>

Create a new polynomial with the given coefficients. If the input has fewer than N+1 coefficients, the remaining slots will be filled with zeros. If the input has more than N+1 coefficients, it will panic.

Trait Implementations§

Source§

impl<'a, S: Clone + SemiringConfig, const DEGREE_PLUS_ONE: usize> Clone for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

fn clone(&self) -> DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a, S: Debug + SemiringConfig, const DEGREE_PLUS_ONE: usize> Debug for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

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

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

impl<'a, S: PartialEq + SemiringConfig, const DEGREE_PLUS_ONE: usize> PartialEq for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

fn eq(&self, other: &DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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<'a, S: RingConfig, const DEGREE_PLUS_ONE: usize> RingConfig for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

fn neg(&self, x: &Self::Element) -> Self::Element

-x
Source§

fn checked_neg(&self, x: &Self::Element) -> Option<Self::Element>

-x;
§

fn neg_assign(&self, x: &mut Self::Element)

x = -x;
Source§

impl<'a, S: SemiringConfig, const DEGREE_PLUS_ONE: usize> SemiringConfig for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

fn is_zero(&self, value: &Self::Element) -> bool

Source§

fn zero(&self) -> Self::Element

Source§

fn one(&self) -> Self::Element

Source§

fn add(&self, x: &Self::Element, y: &Self::Element) -> Self::Element

x + y
Source§

fn sub(&self, x: &Self::Element, y: &Self::Element) -> Self::Element

x - y
Source§

fn mul(&self, _x: &Self::Element, _y: &Self::Element) -> Self::Element

x * y
Source§

fn pow_u32(&self, x: &Self::Element, y: u32) -> Self::Element

x ** y
Source§

fn checked_add( &self, x: &Self::Element, y: &Self::Element, ) -> Option<Self::Element>

x + y
Source§

fn checked_sub( &self, x: &Self::Element, y: &Self::Element, ) -> Option<Self::Element>

x - y
Source§

fn checked_mul( &self, _x: &Self::Element, _y: &Self::Element, ) -> Option<Self::Element>

x * y
Source§

fn checked_pow_u32(&self, x: &Self::Element, y: u32) -> Option<Self::Element>

x ** y
Source§

fn sum<I: Iterator<Item = Self::Element>>(&self, iter: I) -> Self::Element

Source§

fn sum_refs<'b, I: Iterator<Item = &'b Self::Element> + 'b>( &self, iter: I, ) -> Self::Element

Source§

fn product<I: Iterator<Item = Self::Element>>(&self, iter: I) -> Self::Element

Source§

fn product_refs<'b, I: Iterator<Item = &'b Self::Element>>( &self, iter: I, ) -> Self::Element

§

fn add_assign(&self, x: &mut Self::Element, y: &Self::Element)

x += y
§

fn sub_assign(&self, x: &mut Self::Element, y: &Self::Element)

x -= y
§

fn mul_assign(&self, x: &mut Self::Element, y: &Self::Element)

x *= y
§

fn pow_u32_assign(&self, x: &mut Self::Element, y: u32)

x **= y
Source§

impl<'a, S: SemiringConfig, const DEGREE_PLUS_ONE: usize> SetConfig for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

type Element = DensePolynomial<<S as SetConfig>::Element, DEGREE_PLUS_ONE>

Source§

impl<'a, S: Copy + SemiringConfig, const DEGREE_PLUS_ONE: usize> Copy for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

impl<'a, S: Eq + SemiringConfig, const DEGREE_PLUS_ONE: usize> Eq for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Source§

impl<'a, S: SemiringConfig, const DEGREE_PLUS_ONE: usize> StructuralPartialEq for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

Auto Trait Implementations§

§

impl<'a, S, const DEGREE_PLUS_ONE: usize> Freeze for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

§

impl<'a, S, const DEGREE_PLUS_ONE: usize> RefUnwindSafe for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>
where S: RefUnwindSafe,

§

impl<'a, S, const DEGREE_PLUS_ONE: usize> Send for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

§

impl<'a, S, const DEGREE_PLUS_ONE: usize> Sync for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

§

impl<'a, S, const DEGREE_PLUS_ONE: usize> Unpin for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

§

impl<'a, S, const DEGREE_PLUS_ONE: usize> UnsafeUnpin for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>

§

impl<'a, S, const DEGREE_PLUS_ONE: usize> UnwindSafe for DensePolynomialConfig<'a, S, DEGREE_PLUS_ONE>
where S: RefUnwindSafe,

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<S> HasDensePolynomialConfig for S
where S: SemiringConfig,

Source§

fn dense_poly_cfg<const DEGREE_PLUS_ONE: usize>( &self, ) -> DensePolynomialConfig<'_, Self, DEGREE_PLUS_ONE>

Source§

impl<S> HasDynamicPolynomialConfig for S
where S: SemiringConfig,

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<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, 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<T> SetElement for T
where T: Debug + Clone + Eq + Send + Sync + 'static,