[][src]Trait maths_traits::algebra::ring_like::Primality

pub trait Primality: Divisibility {
    fn irreducible(&self) -> bool;
fn prime(&self) -> bool; }

Methods for testing irreduciblity and primality

Do note that for obvious reasons these methods should be assumed to be expensive by default. Furthermore, given the difficulty of checking irreduciblity or primality for general rings, it is entirely possible that there is simply no good algorithm for doing so, and as such, this trait is not a requirement for any of the ring categorization traits.

Furthermore, it is important to note that in general, while all primes are irreducible, the notions are not synonymous. In particular, in Z[sqrt(5)], 3 is irreducible but is not prime. However, if all pairs of elements have a GCD, then all irreducibles are prime as well.

Required methods

fn irreducible(&self) -> bool

Determines if this element cannot be produced from the product of two other non-invertible elements

fn prime(&self) -> bool

Determines if this element is prime

An element x is prime if when y is a multiple of x, a*b=y implies that x divides either a or b. Do note that this implies irreduciblity.

Loading content...

Implementations on Foreign Types

impl Primality for i8[src]

impl Primality for i16[src]

impl Primality for i32[src]

impl Primality for i64[src]

impl Primality for i128[src]

impl Primality for isize[src]

impl Primality for u8[src]

impl Primality for u16[src]

impl Primality for u32[src]

impl Primality for u64[src]

impl Primality for u128[src]

impl Primality for usize[src]

Loading content...

Implementors

Loading content...