[][src]Struct red_primality::PrimeFactorization

pub struct PrimeFactorization { /* fields omitted */ }

Represents a collection of powers of prime factors.

Methods

impl PrimeFactorization[src]

pub fn new() -> Self[src]

Creates a new PrimeFactoriazation

pub fn add(&mut self, prime: Prime, power: u64)[src]

Add a power of a prime to this factorization.

pub fn add_pf(&mut self, pf: &Self, fac: u64)[src]

Add all the factors in the other PrimeFactorization into this one.

pub fn iter<'a>(&'a self) -> impl 'a + Iterator<Item = (Prime, u64)>[src]

Create an iterator over the contained factors and powers.

pub fn product(&self) -> u64[src]

Multiply out the contained factors and powers, yielding the product they represent.

pub fn euler_totient(&self) -> u64[src]

Calculates Euler's totient function.

pub fn mobius(&self) -> i64[src]

Calculates the Möbius function for this prime factorization.

pub fn for_all_divisors<F: FnMut(u64)>(&self, f: F)[src]

Runs a closure on all divisors of n, including 1 and n.

No particular order of divisors is guaranteed.

Trait Implementations

impl Clone for PrimeFactorization[src]

impl Debug for PrimeFactorization[src]

impl Eq for PrimeFactorization[src]

impl Ord for PrimeFactorization[src]

impl PartialEq<PrimeFactorization> for PrimeFactorization[src]

impl PartialOrd<PrimeFactorization> for PrimeFactorization[src]

impl StructuralEq for PrimeFactorization[src]

impl StructuralPartialEq for PrimeFactorization[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.