[−][src]Struct red_primality::PrimeFactorization
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]
fn clone(&self) -> PrimeFactorization
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PrimeFactorization
[src]
impl Eq for PrimeFactorization
[src]
impl Ord for PrimeFactorization
[src]
fn cmp(&self, other: &PrimeFactorization) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PrimeFactorization> for PrimeFactorization
[src]
fn eq(&self, other: &PrimeFactorization) -> bool
[src]
fn ne(&self, other: &PrimeFactorization) -> bool
[src]
impl PartialOrd<PrimeFactorization> for PrimeFactorization
[src]
fn partial_cmp(&self, other: &PrimeFactorization) -> Option<Ordering>
[src]
fn lt(&self, other: &PrimeFactorization) -> bool
[src]
fn le(&self, other: &PrimeFactorization) -> bool
[src]
fn gt(&self, other: &PrimeFactorization) -> bool
[src]
fn ge(&self, other: &PrimeFactorization) -> bool
[src]
impl StructuralEq for PrimeFactorization
[src]
impl StructuralPartialEq for PrimeFactorization
[src]
Auto Trait Implementations
impl RefUnwindSafe for PrimeFactorization
impl Send for PrimeFactorization
impl Sync for PrimeFactorization
impl Unpin for PrimeFactorization
impl UnwindSafe for PrimeFactorization
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,