Skip to main content

ModSubTruncated

Trait ModSubTruncated 

Source
pub trait ModSubTruncated<Rhs = Self, M = Self> {
    type Output;

    // Required method
    fn mod_sub_truncated(self, other: Rhs, len: u64, m: M) -> Self::Output;
}
Expand description

Subtracts one polynomial from another modulo $m$, keeping only the coefficients of $x^i$ for $i$ less than a given length. The coefficients of both must already be reduced modulo $m$.

With $n$ equal to len, this is subtraction in the ring of polynomials with coefficients modulo $m$, taken modulo $x^n$, applied to the images of the two polynomials there. Unlike the coefficients, which must already be reduced, the polynomials need not already be truncated: they may have any number of coefficients, and only the first len of each are read.

Required Associated Types§

Required Methods§

Source

fn mod_sub_truncated(self, other: Rhs, len: u64, m: M) -> Self::Output

Subtracts one polynomial from another modulo $m$ and truncates the difference to its first len coefficients.

$$ f(p, q, n, m) = ((p - q) \bmod x^n) \bmod m. $$

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§