Field

Trait Field 

Source
pub trait Field:
    Copy
    + Default
    + Debug
    + PartialEq {
    type Int: PrimInt + Default + Debug + From<u8> + Into<u128> + Into<Self::Long> + Truncate<u128>;
    type Long: PrimInt + From<Self::Int>;
    type LongLong: PrimInt;

    const Q: Self::Int;
    const QL: Self::Long;
    const QLL: Self::LongLong;
    const BARRETT_SHIFT: usize;
    const BARRETT_MULTIPLIER: Self::LongLong;

    // Required methods
    fn small_reduce(x: Self::Int) -> Self::Int;
    fn barrett_reduce(x: Self::Long) -> Self::Int;
}

Required Associated Constants§

Source

const Q: Self::Int

Source

const QL: Self::Long

Source

const QLL: Self::LongLong

Source

const BARRETT_SHIFT: usize

Source

const BARRETT_MULTIPLIER: Self::LongLong

Required Associated Types§

Required Methods§

Source

fn small_reduce(x: Self::Int) -> Self::Int

Source

fn barrett_reduce(x: Self::Long) -> Self::Int

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Field for BaseField

Source§

const Q: Self::Int = {transmute(0x007fe001): <algebra::BaseField as module_lattice::algebra::Field>::Int}

Source§

const QL: Self::Long = {transmute(0x00000000007fe001): <algebra::BaseField as module_lattice::algebra::Field>::Long}

Source§

const QLL: Self::LongLong = {transmute(0x000000000000000000000000007fe001): <algebra::BaseField as module_lattice::algebra::Field>::LongLong}

Source§

const BARRETT_SHIFT: usize = 46usize

Source§

const BARRETT_MULTIPLIER: Self::LongLong = {transmute(0x00000000000000000000000000802007): <algebra::BaseField as module_lattice::algebra::Field>::LongLong}

Source§

type Int = u32

Source§

type Long = u64

Source§

type LongLong = u128