Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
math::prime_sieve::EratosthenesBasic Class Reference

#include <eratosthenes_basic.h>

List of all members.

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

Detailed Description

The basic implementation of eratosthenes sieve.

Usage: EratosthenesBasic e; e.initialize(100); cout << "7:"<< e.isPrime(7) << " 10:" << e.isPrime(10);


Member Typedef Documentation

typedef std::vector<bool>::size_type math::prime_sieve::EratosthenesBasic::SizeType [private]

Internal type of the size index


Member Function Documentation

template<typename T >
void math::prime_sieve::EratosthenesBasic::initialize ( t_size) [inline]

Initialize eratosthenes sieve to use size up to specified size.

Parameters:
Tsize size of the input
template<typename T >
bool math::prime_sieve::EratosthenesBasic::isPrime ( p) [inline]
Parameters:
p- number to test
Returns:
true if p is prime

Member Data Documentation

std::vector<bool> math::prime_sieve::EratosthenesBasic::data [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines