Loading...
Searching...
No Matches
cf_primes.cc
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
#include "config.h"
#include "cf_assert.h"
#include "cf_defs.h"
#include "cf_primes.h"
#include "cf_primetab.h"
int cf_getPrime( int i )
{
ASSERT( i >= 0 && i < NUMPRIMES, "index to primes too high" );
if ( i >= NUMSMALLPRIMES )
return bigprimes[i-NUMSMALLPRIMES];
else
return smallprimes[i];
}
int cf_getNumPrimes()
{
return NUMPRIMES;
}
int cf_getSmallPrime( int i )
{
ASSERT( i >= 0 && i < NUMSMALLPRIMES, "index to primes too high" );
return smallprimes[i];
}
int cf_getNumSmallPrimes()
{
return NUMSMALLPRIMES;
}
int cf_getBigPrime( int i )
{
ASSERT( i >= 0 && i < NUMBIGPRIMES, "index to primes too high" );
return bigprimes[i];
}
int cf_getNumBigPrimes()
{
return NUMBIGPRIMES;
}
i
int i
Definition cfEzgcd.cc:132
cf_assert.h
assertions for Factory
ASSERT
#define ASSERT(expression, message)
Definition cf_assert.h:99
cf_defs.h
factory switches.
cf_getPrime
int cf_getPrime(int i)
Definition cf_primes.cc:14
cf_getBigPrime
int cf_getBigPrime(int i)
Definition cf_primes.cc:39
cf_getNumPrimes
int cf_getNumPrimes()
Definition cf_primes.cc:23
cf_getNumSmallPrimes
int cf_getNumSmallPrimes()
Definition cf_primes.cc:34
cf_getSmallPrime
int cf_getSmallPrime(int i)
Definition cf_primes.cc:28
cf_getNumBigPrimes
int cf_getNumBigPrimes()
Definition cf_primes.cc:45
cf_primes.h
access to prime tables
cf_primetab.h
smallprimes
static const int smallprimes[]
Definition cf_primetab.h:12
NUMPRIMES
#define NUMPRIMES
Definition cf_primetab.h:10
bigprimes
static const int bigprimes[]
Definition cf_primetab.h:601
NUMBIGPRIMES
#define NUMBIGPRIMES
Definition cf_primetab.h:9
NUMSMALLPRIMES
#define NUMSMALLPRIMES
Definition cf_primetab.h:8