Struct nekolib_doc::math::LinearSieve
source · pub struct LinearSieve { /* private fields */ }
Implementations§
source§impl LinearSieve
impl LinearSieve
pub fn new(n: usize) -> LinearSieve
pub fn is_prime(&self, i: usize) -> bool
pub fn lpf(&self, i: usize) -> Option<usize>
pub fn factors_dup(&self, i: usize) -> impl Iterator<Item = usize>
pub fn factors(&self, i: usize) -> impl Iterator<Item = (usize, u32)>
pub fn euler_phi(&self, i: usize) -> usize
pub fn euler_phi_star(&self, i: usize) -> usize
pub fn divisors( &self, i: usize, ) -> impl Iterator<Item = usize> + DoubleEndedIterator
pub fn divisors_count(&self, i: usize) -> usize
pub fn divisors_sum(&self, i: usize) -> usize
pub fn primes(&self) -> impl Iterator<Item = usize> + DoubleEndedIterator
pub fn dp<T>( &self, zero: T, one: T, eq: impl Fn(&T, usize) -> T, gt: impl Fn(&T, usize) -> T, ) -> Vec<T>
Auto Trait Implementations§
impl Freeze for LinearSieve
impl RefUnwindSafe for LinearSieve
impl Send for LinearSieve
impl Sync for LinearSieve
impl Unpin for LinearSieve
impl UnwindSafe for LinearSieve
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more