Module buffer

Module buffer 

Source
Expand description

Implementations and extensions for PrimeBuffer, which represents a container of primes

In num-prime, there is no global instance to store primes, the user has to generate and store the primes themselves. The trait PrimeBuffer defines a unified interface for a prime number container. Some methods that can take advantage of pre-generated primes will be implemented in the PrimeBufferExt trait.

We also provide NaiveBuffer as a simple implementation of PrimeBuffer without any external dependencies. The performance of the NaiveBuffer will not be extremely optimized, but it will be efficient enough for most applications.

Structs§

NaiveBuffer
NaiveBuffer implements a very simple Sieve of Eratosthenes

Traits§

PrimeBufferExt
Extension functions that can utilize pre-generated primes