source: git/factory/cf_primes.cc @ 6ce030f

spielwiese
Last change on this file since 6ce030f was 362fc67, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: remove $Id$
  • Property mode set to 100644
File size: 804 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3#include "config.h"
4
5#include "cf_assert.h"
6
7#include "cf_defs.h"
8#include "cf_primes.h"
9#include "cf_primetab.h"
10
11
12int cf_getPrime( int i )
13{
14    ASSERT( i >= 0 && i < NUMPRIMES, "index to primes too high" );
15    if ( i >= NUMSMALLPRIMES )
16        return bigprimes[i-NUMSMALLPRIMES];
17    else
18        return smallprimes[i];
19}
20
21int cf_getNumPrimes()
22{
23    return NUMPRIMES;
24}
25
26int cf_getSmallPrime( int i )
27{
28    ASSERT( i >= 0 && i < NUMSMALLPRIMES, "index to primes too high" );
29    return smallprimes[i];
30}
31
32int cf_getNumSmallPrimes()
33{
34    return NUMSMALLPRIMES;
35}
36
37int cf_getBigPrime( int i )
38{
39    ASSERT( i >= 0 && i < NUMBIGPRIMES, "index to primes too high" );
40    return bigprimes[i];
41}
42
43int cf_getNumBigPrimes()
44{
45    return NUMBIGPRIMES;
46}
Note: See TracBrowser for help on using the repository browser.