Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Primes


Detailed Description

Primes is a module that makes use of Rabin's Probablistic Primetest-Algorithm for generating the prime numbers equal to the Hash table entries.

Defines

Functions


Function Documentation

unsigned long addMod unsigned long  x,
unsigned long  y,
unsigned long  m
[static]
 

addition in a modulo.

Parameters:
x the first element used in addition.
y the second element used in addition
m the modulud function
Returns:
the added result.
Definition at line 51 of file primes.c.

Referenced by multMod().

unsigned long multMod unsigned long  x,
unsigned long  y,
unsigned long  m
[static]
 

multiplication in a modulo.

Parameters:
x the first element used in multiplication.
y the second element used in multiplication.
m the modulo function.
Returns:
the multiplied result.
Definition at line 64 of file primes.c.

References addMod().

Referenced by powMod().

unsigned long powMod unsigned long  x,
unsigned long  y,
unsigned long  m
[static]
 

exponent in a modulo.

Parameters:
x the base function.
y the exponent function.
m the modulo function.
Returns:
the result - x raised to the exponential y.
Definition at line 87 of file primes.c.

References multMod().

Referenced by primeRabin().

unsigned long primeNext unsigned long  number,
unsigned long  times
 

returns the next prime after a given number.

Definition at line 123 of file primes.c.

References primeRabin().

Referenced by hashNew(), and rehashHashtable().

int primeRabin unsigned long  number,
unsigned long  times
 

Rabin's probablistic primetest-algorithm.

Parameters:
number ...
times ...
Returns:
true if number is a prime by testing it a few times
Definition at line 106 of file primes.c.

References powMod().

Referenced by primeNext().


BLAH 0.95 (20 Oct 2004)