pub struct Polynomial<'coeffs, FF: FiniteField> { /* private fields */ }
Expand description
A univariate polynomial with coefficients in a finite field, in monomial form.
Implementations§
Source§impl<FF> Polynomial<'_, FF>where
FF: FiniteField,
impl<FF> Polynomial<'_, FF>where
FF: FiniteField,
pub fn degree(&self) -> isize
Sourcepub fn coefficients(&self) -> &[FF]
pub fn coefficients(&self) -> &[FF]
The polynomial’s coefficients, in order of increasing degree. That is, the leading coefficient is the slice’s last element.
The leading coefficient is guaranteed to be non-zero. Consequently, the zero-polynomial is the empty slice.
See also into_coefficients()
.
Sourcepub fn into_coefficients(self) -> Vec<FF>
pub fn into_coefficients(self) -> Vec<FF>
Like coefficients()
, but consumes self
.
Only clones the underlying coefficients if they are not already owned.
Sourcepub fn leading_coefficient(&self) -> Option<FF>
pub fn leading_coefficient(&self) -> Option<FF>
The coefficient of the polynomial’s term of highest power. None
if (and only if) self
is zero.
Furthermore, is never Some(FF::ZERO)
.
§Examples
let f = Polynomial::new(bfe_vec![1, 2, 3]);
assert_eq!(Some(bfe!(3)), f.leading_coefficient());
assert_eq!(None, Polynomial::<XFieldElement>::zero().leading_coefficient());
pub fn is_x(&self) -> bool
pub fn formal_derivative(&self) -> Polynomial<'static, FF>
Sourcepub fn evaluate<Ind, Eval>(&self, x: Ind) -> Eval
pub fn evaluate<Ind, Eval>(&self, x: Ind) -> Eval
Evaluate self
in an indeterminate.
For a specialized version, with fewer type annotations needed, see
Self::evaluate_in_same_field
.
Sourcepub fn evaluate_in_same_field(&self, x: FF) -> FF
pub fn evaluate_in_same_field(&self, x: FF) -> FF
Evaluate self
in an indeterminate.
For a generalized version, with more type annotations needed, see
Self::evaluate
.
pub fn are_colinear_3(p0: (FF, FF), p1: (FF, FF), p2: (FF, FF)) -> bool
pub fn are_colinear(points: &[(FF, FF)]) -> bool
pub fn get_colinear_y(p0: (FF, FF), p1: (FF, FF), p2_x: FF) -> FF
Sourcepub fn slow_square(&self) -> Polynomial<'static, FF>
pub fn slow_square(&self) -> Polynomial<'static, FF>
Slow square implementation that does not use NTT
Sourcepub fn pow(&self, pow: u32) -> Polynomial<'static, FF>
pub fn pow(&self, pow: u32) -> Polynomial<'static, FF>
Multiply self
with itself pow
times.
Similar to Self::fast_pow
, but slower and slightly more general.
pub fn mod_pow(&self, pow: BigInt) -> Polynomial<'static, FF>
pow
insteadSourcepub fn shift_coefficients(self, power: usize) -> Polynomial<'static, FF>
pub fn shift_coefficients(self, power: usize) -> Polynomial<'static, FF>
Multiply a polynomial with x^power
Sourcepub fn scalar_mul_mut<S>(&mut self, scalar: S)
pub fn scalar_mul_mut<S>(&mut self, scalar: S)
Multiply a polynomial with a scalar, i.e., compute scalar · self(x)
.
Slightly faster but slightly less general than Self::scalar_mul
.
§Examples
let mut f = Polynomial::new(bfe_vec![1, 2, 3]);
f.scalar_mul_mut(bfe!(2));
assert_eq!(Polynomial::new(bfe_vec![2, 4, 6]), f);
Sourcepub fn scalar_mul<S, FF2>(&self, scalar: S) -> Polynomial<'static, FF2>
pub fn scalar_mul<S, FF2>(&self, scalar: S) -> Polynomial<'static, FF2>
Multiply a polynomial with a scalar, i.e., compute scalar · self(x)
.
Slightly slower but slightly more general than Self::scalar_mul_mut
.
§Examples
let f = Polynomial::new(bfe_vec![1, 2, 3]);
let g = f.scalar_mul(bfe!(2));
assert_eq!(Polynomial::new(bfe_vec![2, 4, 6]), g);
Sourcepub fn divide(
&self,
divisor: &Polynomial<'_, FF>,
) -> (Polynomial<'static, FF>, Polynomial<'static, FF>)
pub fn divide( &self, divisor: &Polynomial<'_, FF>, ) -> (Polynomial<'static, FF>, Polynomial<'static, FF>)
Divide self
by some divisor
, returning (quotient
, remainder
).
§Panics
Panics if the divisor
is zero.
Sourcepub fn xgcd(
x: Self,
y: Polynomial<'_, FF>,
) -> (Polynomial<'static, FF>, Polynomial<'static, FF>, Polynomial<'static, FF>)
pub fn xgcd( x: Self, y: Polynomial<'_, FF>, ) -> (Polynomial<'static, FF>, Polynomial<'static, FF>, Polynomial<'static, FF>)
Extended Euclidean algorithm with polynomials. Computes the greatest
common divisor gcd
as a monic polynomial, as well as the corresponding
Bézout coefficients a
and b
, satisfying gcd = a·x + b·y
§Example
let x = Polynomial::<BFieldElement>::from([1, 0, 1]);
let y = Polynomial::<BFieldElement>::from([1, 1]);
let (gcd, a, b) = Polynomial::xgcd(x.clone(), y.clone());
assert_eq!(gcd, a * x + b * y);
Sourcepub fn into_owned(self) -> Polynomial<'static, FF>
pub fn into_owned(self) -> Polynomial<'static, FF>
Return a polynomial that owns its coefficients. Clones the coefficients if they are not already owned.
Source§impl<FF> Polynomial<'_, FF>
impl<FF> Polynomial<'_, FF>
Sourcepub fn scale<S, XF>(&self, alpha: S) -> Polynomial<'static, XF>
pub fn scale<S, XF>(&self, alpha: S) -> Polynomial<'static, XF>
Return the polynomial which corresponds to the transformation x → α·x
.
Given a polynomial P(x), produce P’(x) := P(α·x). Evaluating P’(x) then corresponds to evaluating P(α·x).
Sourcepub fn fast_square(&self) -> Polynomial<'static, FF>
pub fn fast_square(&self) -> Polynomial<'static, FF>
It is the caller’s responsibility that this function is called with sufficiently large input
to be safe and to be faster than square
.
pub fn square(&self) -> Polynomial<'static, FF>
Sourcepub fn fast_pow(&self, pow: u32) -> Polynomial<'static, FF>
pub fn fast_pow(&self, pow: u32) -> Polynomial<'static, FF>
Multiply self
with itself pow
times.
Similar to Self::pow
, but faster and slightly less general.
pub fn fast_mod_pow(&self, pow: BigInt) -> Polynomial<'static, FF>
fast_pow
insteadSourcepub fn multiply<FF2>(
&self,
other: &Polynomial<'_, FF2>,
) -> Polynomial<'static, <FF as Mul<FF2>>::Output>where
FF: Mul<FF2>,
FF2: FiniteField + MulAssign<BFieldElement>,
<FF as Mul<FF2>>::Output: FiniteField + MulAssign<BFieldElement>,
pub fn multiply<FF2>(
&self,
other: &Polynomial<'_, FF2>,
) -> Polynomial<'static, <FF as Mul<FF2>>::Output>where
FF: Mul<FF2>,
FF2: FiniteField + MulAssign<BFieldElement>,
<FF as Mul<FF2>>::Output: FiniteField + MulAssign<BFieldElement>,
Multiply self
by other
.
Prefer this over self * other
since it chooses the fastest multiplication
strategy.
Sourcepub fn batch_multiply(factors: &[Self]) -> Polynomial<'static, FF>
pub fn batch_multiply(factors: &[Self]) -> Polynomial<'static, FF>
Multiply a bunch of polynomials together.
Sourcepub fn par_batch_multiply(factors: &[Self]) -> Polynomial<'static, FF>
pub fn par_batch_multiply(factors: &[Self]) -> Polynomial<'static, FF>
Parallel version of batch_multiply
.
Sourcepub fn reduce(&self, modulus: &Polynomial<'_, FF>) -> Polynomial<'static, FF>
pub fn reduce(&self, modulus: &Polynomial<'_, FF>) -> Polynomial<'static, FF>
Divide (with remainder) and throw away the quotient. Note that the self object is the numerator and the argument is the denominator (or modulus).
Sourcepub fn fast_reduce(&self, modulus: &Self) -> Polynomial<'static, FF>
pub fn fast_reduce(&self, modulus: &Self) -> Polynomial<'static, FF>
Compute the remainder after division of one polynomial by another. This method first reduces the numerator by a multiple of the denominator that was constructed to enable NTT-based chunk-wise reduction, before invoking the standard long division based algorithm to finalize. As a result, it works best for large numerators being reduced by small denominators.
Sourcepub fn structured_multiple_of_degree(&self, n: usize) -> Polynomial<'static, FF>
pub fn structured_multiple_of_degree(&self, n: usize) -> Polynomial<'static, FF>
Given a polynomial f(X) and an integer n, find a multiple of f(X) of the form X^n + (something of much smaller degree).
§Panics
Panics if the polynomial is zero, or if its degree is larger than n
Sourcepub fn formal_power_series_inverse_newton(
self,
precision: usize,
) -> Polynomial<'static, FF>
pub fn formal_power_series_inverse_newton( self, precision: usize, ) -> Polynomial<'static, FF>
Compute a polynomial g(X) from a given polynomial f(X) such that g(X) * f(X) = 1 mod X^n , where n is the precision.
In formal terms, g(X) is the approximate multiplicative inverse in the formal power series ring, where elements obey the same algebraic rules as polynomials do but can have an infinite number of coefficients. To represent these elements on a computer, one has to truncate the coefficient vectors somewhere. The resulting truncation error is considered “small” when it lives on large powers of X. This function works by applying Newton’s method in this ring.
§Example
let precision = 8;
let f = Polynomial::new(bfe_vec![42; precision]);
let g = f.clone().formal_power_series_inverse_newton(precision);
let x_to_the_n = Polynomial::one().shift_coefficients(precision);
let (_quotient, remainder) = g.multiply(&f).divide(&x_to_the_n);
assert!(remainder.is_one());
§Panics
Panics when f(X) is not invertible in the formal power series ring, i.e., when its constant coefficient is zero.
Sourcepub fn fast_coset_evaluate<S>(&self, offset: S, order: usize) -> Vec<FF>
pub fn fast_coset_evaluate<S>(&self, offset: S, order: usize) -> Vec<FF>
Fast evaluate on a coset domain, which is the group generated by generator^i * offset
.
§Performance
If possible, use a base field element as the offset.
§Panics
Panics if the order of the domain generated by the generator
is smaller than or equal to
the degree of self
.
Source§impl<FF> Polynomial<'static, FF>
impl<FF> Polynomial<'static, FF>
Sourcepub fn zerofier(roots: &[FF]) -> Self
pub fn zerofier(roots: &[FF]) -> Self
Compute the lowest degree polynomial with the provided roots. Also known as “vanishing polynomial.”
§Example
let roots = bfe_array![2, 4, 6];
let zerofier = Polynomial::zerofier(&roots);
assert_eq!(3, zerofier.degree());
assert_eq!(bfe_vec![0, 0, 0], zerofier.batch_evaluate(&roots));
let non_roots = bfe_vec![0, 1, 3, 5];
assert!(zerofier.batch_evaluate(&non_roots).iter().all(|x| !x.is_zero()));
Sourcepub fn par_zerofier(roots: &[FF]) -> Self
pub fn par_zerofier(roots: &[FF]) -> Self
Parallel version of zerofier
.
Sourcepub fn interpolate(domain: &[FF], values: &[FF]) -> Self
pub fn interpolate(domain: &[FF], values: &[FF]) -> Self
Construct the lowest-degree polynomial interpolating the given points.
let domain = bfe_vec![0, 1, 2, 3];
let values = bfe_vec![1, 3, 5, 7];
let polynomial = Polynomial::interpolate(&domain, &values);
assert_eq!(1, polynomial.degree());
assert_eq!(bfe!(9), polynomial.evaluate(bfe!(4)));
§Panics
- Panics if the provided domain is empty.
- Panics if the provided domain and values are not of the same length.
Sourcepub fn par_interpolate(domain: &[FF], values: &[FF]) -> Self
pub fn par_interpolate(domain: &[FF], values: &[FF]) -> Self
pub fn batch_fast_interpolate( domain: &[FF], values_matrix: &[Vec<FF>], primitive_root: BFieldElement, root_order: usize, ) -> Vec<Self>
Sourcepub fn batch_evaluate(&self, domain: &[FF]) -> Vec<FF>
pub fn batch_evaluate(&self, domain: &[FF]) -> Vec<FF>
Evaluate the polynomial on a batch of points.
Sourcepub fn par_batch_evaluate(&self, domain: &[FF]) -> Vec<FF>
pub fn par_batch_evaluate(&self, domain: &[FF]) -> Vec<FF>
Parallel version of batch_evaluate
.
Sourcepub fn fast_coset_interpolate<S>(offset: S, values: &[FF]) -> Self
pub fn fast_coset_interpolate<S>(offset: S, values: &[FF]) -> Self
The inverse of Self::fast_coset_evaluate
.
§Performance
If possible, use a base field element as the offset.
§Panics
Panics if the length of values
is
- not a power of 2
- larger than
u32::MAX
Sourcepub fn truncate(&self, k: usize) -> Self
pub fn truncate(&self, k: usize) -> Self
The degree-k
polynomial with the same k + 1
leading coefficients as self
. To be more
precise: The degree of the result will be the minimum of k
and Self::degree()
. This
implies, among other things, that if self
is zero, the result will also
be zero, independent of k
.
§Examples
let f = Polynomial::new(bfe_vec![0, 1, 2, 3, 4]); // 4x⁴ + 3x³ + 2x² + 1x¹ + 0
let g = f.truncate(2); // 4x² + 3x¹ + 2
assert_eq!(Polynomial::new(bfe_vec![2, 3, 4]), g);
Sourcepub fn mod_x_to_the_n(&self, n: usize) -> Self
pub fn mod_x_to_the_n(&self, n: usize) -> Self
Sourcepub fn coset_extrapolate(
domain_offset: BFieldElement,
codeword: &[FF],
points: &[FF],
) -> Vec<FF>
pub fn coset_extrapolate( domain_offset: BFieldElement, codeword: &[FF], points: &[FF], ) -> Vec<FF>
Extrapolate a Reed-Solomon codeword, defined relative to a coset of the subgroup of order n (codeword length), in new points.
Sourcepub fn batch_coset_extrapolate(
domain_offset: BFieldElement,
codeword_length: usize,
codewords: &[FF],
points: &[FF],
) -> Vec<FF>
pub fn batch_coset_extrapolate( domain_offset: BFieldElement, codeword_length: usize, codewords: &[FF], points: &[FF], ) -> Vec<FF>
Extrapolate many Reed-Solomon codewords, defined relative to the same
coset of the subgroup of order codeword_length
, in the same set of
new points.
§Example
let n = 1 << 5;
let domain_offset = bfe!(7);
let codewords = [bfe_vec![3; n], bfe_vec![2; n]].concat();
let points = bfe_vec![0, 1];
assert_eq!(
bfe_vec![3, 3, 2, 2],
Polynomial::<BFieldElement>::batch_coset_extrapolate(
domain_offset,
n,
&codewords,
&points
)
);
§Panics
Panics if the codeword_length
is not a power of two.
Sourcepub fn par_batch_coset_extrapolate(
domain_offset: BFieldElement,
codeword_length: usize,
codewords: &[FF],
points: &[FF],
) -> Vec<FF>
pub fn par_batch_coset_extrapolate( domain_offset: BFieldElement, codeword_length: usize, codewords: &[FF], points: &[FF], ) -> Vec<FF>
Parallel version of batch_coset_extrapolate
.
Source§impl Polynomial<'_, BFieldElement>
impl Polynomial<'_, BFieldElement>
Sourcepub fn clean_divide(self, divisor: Self) -> Polynomial<'static, BFieldElement>
pub fn clean_divide(self, divisor: Self) -> Polynomial<'static, BFieldElement>
A fast way of dividing two polynomials. Only works if division is clean, i.e., if the
remainder of polynomial long division is zero. This must be known ahead of time. If
division is unclean, this method might panic or produce a wrong result.
Use Polynomial::divide
for more generality.
§Panics
Panics if
- the divisor is zero, or
- division is not clean, i.e., if polynomial long division leaves some non-zero remainder.
Source§impl<FF> Polynomial<'static, FF>where
FF: FiniteField,
impl<FF> Polynomial<'static, FF>where
FF: FiniteField,
Sourcepub fn new(coefficients: Vec<FF>) -> Self
pub fn new(coefficients: Vec<FF>) -> Self
Create a new polynomial with the given coefficients. The first coefficient is the constant term, the last coefficient has the highest degree.
See also Self::new_borrowed
.
pub fn from_constant(constant: FF) -> Self
Source§impl<'coeffs, FF> Polynomial<'coeffs, FF>where
FF: FiniteField,
impl<'coeffs, FF> Polynomial<'coeffs, FF>where
FF: FiniteField,
Sourcepub fn new_borrowed(coefficients: &'coeffs [FF]) -> Self
pub fn new_borrowed(coefficients: &'coeffs [FF]) -> Self
Like Self::new
, but without owning the coefficients.
Trait Implementations§
Source§impl<FF> Add<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
impl<FF> Add<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
Source§type Output = Polynomial<'static, FF>
type Output = Polynomial<'static, FF>
+
operator.Source§impl<FF: FiniteField> AddAssign<Polynomial<'_, FF>> for Polynomial<'_, FF>
impl<FF: FiniteField> AddAssign<Polynomial<'_, FF>> for Polynomial<'_, FF>
Source§fn add_assign(&mut self, rhs: Polynomial<'_, FF>)
fn add_assign(&mut self, rhs: Polynomial<'_, FF>)
+=
operation. Read moreSource§impl<'a, FF> Arbitrary<'a> for Polynomial<'static, FF>where
FF: FiniteField + Arbitrary<'a>,
impl<'a, FF> Arbitrary<'a> for Polynomial<'static, FF>where
FF: FiniteField + Arbitrary<'a>,
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read moreSource§impl<T> BFieldCodec for Polynomial<'_, T>where
T: BFieldCodec + FiniteField + 'static,
impl<T> BFieldCodec for Polynomial<'_, T>where
T: BFieldCodec + FiniteField + 'static,
type Error = PolynomialBFieldCodecError
fn decode(sequence: &[BFieldElement]) -> Result<Box<Self>, Self::Error>
fn encode(&self) -> Vec<BFieldElement>
Source§fn static_length() -> Option<usize>
fn static_length() -> Option<usize>
Source§impl<'coeffs, FF: Clone + FiniteField> Clone for Polynomial<'coeffs, FF>
impl<'coeffs, FF: Clone + FiniteField> Clone for Polynomial<'coeffs, FF>
Source§fn clone(&self) -> Polynomial<'coeffs, FF>
fn clone(&self) -> Polynomial<'coeffs, FF>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<FF: FiniteField> Debug for Polynomial<'_, FF>
impl<FF: FiniteField> Debug for Polynomial<'_, FF>
Source§impl<FF: FiniteField> Display for Polynomial<'_, FF>
impl<FF: FiniteField> Display for Polynomial<'_, FF>
Source§impl<FF> Div<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
impl<FF> Div<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
Source§type Output = Polynomial<'static, FF>
type Output = Polynomial<'static, FF>
/
operator.Source§impl<'c, FF> From<&'c [FF]> for Polynomial<'c, FF>where
FF: FiniteField,
impl<'c, FF> From<&'c [FF]> for Polynomial<'c, FF>where
FF: FiniteField,
Source§impl<const N: usize, FF, E> From<[E; N]> for Polynomial<'static, FF>where
FF: FiniteField,
E: Into<FF>,
impl<const N: usize, FF, E> From<[E; N]> for Polynomial<'static, FF>where
FF: FiniteField,
E: Into<FF>,
Source§impl From<Polynomial<'_, BFieldElement>> for XFieldElement
impl From<Polynomial<'_, BFieldElement>> for XFieldElement
Source§fn from(poly: Polynomial<'_, BFieldElement>) -> Self
fn from(poly: Polynomial<'_, BFieldElement>) -> Self
Source§impl<FF, E> From<Vec<E>> for Polynomial<'static, FF>where
FF: FiniteField,
E: Into<FF>,
impl<FF, E> From<Vec<E>> for Polynomial<'static, FF>where
FF: FiniteField,
E: Into<FF>,
Source§impl From<XFieldElement> for Polynomial<'static, BFieldElement>
impl From<XFieldElement> for Polynomial<'static, BFieldElement>
Source§fn from(xfe: XFieldElement) -> Self
fn from(xfe: XFieldElement) -> Self
Source§impl<FF: FiniteField> Hash for Polynomial<'_, FF>
impl<FF: FiniteField> Hash for Polynomial<'_, FF>
Source§impl<FF, FF2> Mul<Polynomial<'_, FF>> for BFieldElement
impl<FF, FF2> Mul<Polynomial<'_, FF>> for BFieldElement
Source§type Output = Polynomial<'static, FF2>
type Output = Polynomial<'static, FF2>
*
operator.Source§impl<FF, FF2> Mul<Polynomial<'_, FF>> for XFieldElement
impl<FF, FF2> Mul<Polynomial<'_, FF>> for XFieldElement
Source§type Output = Polynomial<'static, FF2>
type Output = Polynomial<'static, FF2>
*
operator.Source§impl<FF, FF2> Mul<Polynomial<'_, FF2>> for Polynomial<'_, FF>where
FF: FiniteField + Mul<FF2>,
FF2: FiniteField,
<FF as Mul<FF2>>::Output: 'static + FiniteField,
impl<FF, FF2> Mul<Polynomial<'_, FF2>> for Polynomial<'_, FF>where
FF: FiniteField + Mul<FF2>,
FF2: FiniteField,
<FF as Mul<FF2>>::Output: 'static + FiniteField,
Source§type Output = Polynomial<'static, <FF as Mul<FF2>>::Output>
type Output = Polynomial<'static, <FF as Mul<FF2>>::Output>
*
operator.Source§fn mul(
self,
other: Polynomial<'_, FF2>,
) -> Polynomial<'static, <FF as Mul<FF2>>::Output>
fn mul( self, other: Polynomial<'_, FF2>, ) -> Polynomial<'static, <FF as Mul<FF2>>::Output>
*
operation. Read moreSource§impl<S, FF, FF2> Mul<S> for Polynomial<'_, FF>
impl<S, FF, FF2> Mul<S> for Polynomial<'_, FF>
Source§impl<FF> Neg for Polynomial<'_, FF>where
FF: FiniteField + 'static,
impl<FF> Neg for Polynomial<'_, FF>where
FF: FiniteField + 'static,
Source§impl<FF: FiniteField> One for Polynomial<'static, FF>
impl<FF: FiniteField> One for Polynomial<'static, FF>
Source§impl<FF: FiniteField> PartialEq<Polynomial<'_, FF>> for Polynomial<'_, FF>
impl<FF: FiniteField> PartialEq<Polynomial<'_, FF>> for Polynomial<'_, FF>
Source§impl<FF> Rem<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
impl<FF> Rem<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
Source§type Output = Polynomial<'static, FF>
type Output = Polynomial<'static, FF>
%
operator.Source§impl<FF> Sub<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
impl<FF> Sub<Polynomial<'_, FF>> for Polynomial<'_, FF>where
FF: FiniteField + 'static,
Source§type Output = Polynomial<'static, FF>
type Output = Polynomial<'static, FF>
-
operator.Source§impl<FF: FiniteField> Zero for Polynomial<'static, FF>
impl<FF: FiniteField> Zero for Polynomial<'static, FF>
impl<FF: FiniteField> Eq for Polynomial<'_, FF>
Auto Trait Implementations§
impl<'coeffs, FF> Freeze for Polynomial<'coeffs, FF>
impl<'coeffs, FF> RefUnwindSafe for Polynomial<'coeffs, FF>where
FF: RefUnwindSafe,
impl<'coeffs, FF> Send for Polynomial<'coeffs, FF>
impl<'coeffs, FF> Sync for Polynomial<'coeffs, FF>
impl<'coeffs, FF> Unpin for Polynomial<'coeffs, FF>where
FF: Unpin,
impl<'coeffs, FF> UnwindSafe for Polynomial<'coeffs, FF>where
FF: RefUnwindSafe + 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
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>
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