Type Alias VanillaInt

Source
pub type VanillaInt<T> = ReducedInt<T, Vanilla<T>>;
Expand description

An integer in modulo ring based on conventional Rem operations

Aliased Type§

struct VanillaInt<T> { /* private fields */ }

Implementations

Source§

impl<T, R: Reducer<T>> ReducedInt<T, R>

Source

pub fn new(n: T, m: &T) -> Self

Convert n into the modulo ring ℤ/mℤ (i.e. n % m)

Source

pub fn repr(&self) -> &T

Source

pub fn inv(self) -> Option<Self>

Source

pub fn pow(self, exp: &T) -> Self

Trait Implementations

Source§

impl<T: PartialEq + Clone, R: Reducer<T>> Add<&ReducedInt<T, R>> for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Add<T> for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Add for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: Clone, R: Clone + Reducer<T>> Clone for ReducedInt<T, R>

Source§

fn clone(&self) -> ReducedInt<T, R>

Returns a copy 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<T: Debug, R: Debug + Reducer<T>> Debug for ReducedInt<T, R>

Source§

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

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

impl<T: PartialEq + Clone, R: Reducer<T>> Div<&ReducedInt<T, R>> for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Div for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T: PartialEq + Clone, R: Reducer<T> + Clone> ModularInteger for ReducedInt<T, R>

Source§

type Base = T

The underlying representation type of the integer
Source§

fn modulus(&self) -> T

Return the modulus of the ring
Source§

fn residue(&self) -> T

Return the normalized residue of this integer in the ring
Source§

fn is_zero(&self) -> bool

Check if the integer is zero
Source§

fn convert(&self, n: T) -> Self

Convert an normal integer into the same ring. Read more
Source§

fn double(self) -> Self

Calculate the value of self + self
Source§

fn square(self) -> Self

Calculate the value of self * self
Source§

impl<T: PartialEq + Clone, R: Reducer<T>> Mul<&ReducedInt<T, R>> for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Mul<T> for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Mul for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Neg for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> PartialEq for ReducedInt<T, R>

Source§

fn eq(&self, other: &Self) -> 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<T: PartialEq + Clone, R: Reducer<T>> Sub<&ReducedInt<T, R>> for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Sub<T> for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: PartialEq, R: Reducer<T>> Sub for ReducedInt<T, R>

Source§

type Output = ReducedInt<T, R>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Copy, R: Copy + Reducer<T>> Copy for ReducedInt<T, R>