Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
|
#include <eratosthenes_basic.h>
Public Member Functions | |
template<typename T > | |
void | initialize (T t_size) |
template<typename T > | |
bool | isPrime (T p) |
Private Types | |
typedef std::vector< bool > ::size_type | SizeType |
Private Attributes | |
std::vector< bool > | data |
The basic implementation of eratosthenes sieve.
Usage: EratosthenesBasic e; e.initialize(100); cout << "7:"<< e.isPrime(7) << " 10:" << e.isPrime(10);
typedef std::vector<bool>::size_type math::prime_sieve::EratosthenesBasic::SizeType [private] |
Internal type of the size index
void math::prime_sieve::EratosthenesBasic::initialize | ( | T | t_size | ) | [inline] |
Initialize eratosthenes sieve to use size up to specified size.
T | size size of the input |
bool math::prime_sieve::EratosthenesBasic::isPrime | ( | T | p | ) | [inline] |
p | - number to test |
std::vector<bool> math::prime_sieve::EratosthenesBasic::data [private] |