Usage
lazy-prime-sieve
is a library crate. You may add it to your Cargo.toml
as
follows:
[]
= "0.1.1"
lazy-prime-sieve
provides iterators for infinitely generating primes. This
crate provides a convenience method ::primes()
which returns the most
efficient iterator (in this crate) for generating primes.
use primes;
for i in primes.take
Benchmarks
This benchmark shows the time taken by the different prime generating iterators
in this crate to generate a certain number of primes. The x-axis
shows the
number of primes generated, while the y-axis
shows the amount of time taken.
References
This crate heavily draws from the paper The Genuine Sieve of Eratosthenes. This repository attempts to provide non-recursive lazy Rust iterator based alternatives to the Haskell lazy list + recursion based methods proposed in the paper.
License
lazy-prime-sieve
is licensed under the MIT License. See
License
for more details.