[−][src]Struct primes::Sieve
A prime generator, using the Sieve of Eratosthenes method. This is asymptotically more efficient than the Trial Division method, but slower earlier on.
Create with let mut pset = Sieve::new()
, and then use pset.iter()
to iterate over all primes.
Methods
impl Sieve
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Sieve
impl Send for Sieve
impl Sync for Sieve
impl Unpin for Sieve
impl UnwindSafe for Sieve
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<P> PrimeSet for P where
P: PrimeSetBasics,
[src]
P: PrimeSetBasics,
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
ⓘImportant traits for PrimeSetIter<'a, P>fn generator(&mut self) -> PrimeSetIter<Self>
[src]
ⓘImportant traits for PrimeSetIter<'a, P>
ⓘImportant traits for PrimeSetIter<'a, P>fn iter(&mut self) -> PrimeSetIter<Self>
[src]
ⓘImportant traits for PrimeSetIter<'a, P>
fn iter_vec(&self) -> Iter<u64>
[src]
fn find(&mut self, n: u64) -> (usize, u64)
[src]
fn is_prime(&mut self, n: u64) -> bool
[src]
fn find_vec(&self, n: u64) -> Option<(usize, u64)>
[src]
fn get(&mut self, index: usize) -> u64
[src]
fn prime_factors(&mut self, n: u64) -> Vec<u64>
[src]
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>,