My Project
cf_primes.cc
Go to the documentation of this file.
1/* emacs edit mode for this file is -*- C++ -*- */
2
3
4#include "config.h"
5
6
7#include "cf_assert.h"
8
9#include "cf_defs.h"
10#include "cf_primes.h"
11#include "cf_primetab.h"
12
13
14int cf_getPrime( int i )
15{
16 ASSERT( i >= 0 && i < NUMPRIMES, "index to primes too high" );
17 if ( i >= NUMSMALLPRIMES )
19 else
20 return smallprimes[i];
21}
22
24{
25 return NUMPRIMES;
26}
27
29{
30 ASSERT( i >= 0 && i < NUMSMALLPRIMES, "index to primes too high" );
31 return smallprimes[i];
32}
33
35{
36 return NUMSMALLPRIMES;
37}
38
39int cf_getBigPrime( int i )
40{
41 ASSERT( i >= 0 && i < NUMBIGPRIMES, "index to primes too high" );
42 return bigprimes[i];
43}
44
46{
47 return NUMBIGPRIMES;
48}
int i
Definition: cfEzgcd.cc:132
assertions for Factory
#define ASSERT(expression, message)
Definition: cf_assert.h:99
factory switches.
int cf_getPrime(int i)
Definition: cf_primes.cc:14
int cf_getBigPrime(int i)
Definition: cf_primes.cc:39
int cf_getNumPrimes()
Definition: cf_primes.cc:23
int cf_getNumSmallPrimes()
Definition: cf_primes.cc:34
int cf_getSmallPrime(int i)
Definition: cf_primes.cc:28
int cf_getNumBigPrimes()
Definition: cf_primes.cc:45
access to prime tables
static const int smallprimes[]
Definition: cf_primetab.h:12
#define NUMPRIMES
Definition: cf_primetab.h:10
static const int bigprimes[]
Definition: cf_primetab.h:601
#define NUMBIGPRIMES
Definition: cf_primetab.h:9
#define NUMSMALLPRIMES
Definition: cf_primetab.h:8