source: git/factory/cf_primes.cc @ 243019

spielwiese
Last change on this file since 243019 was 9f7665, checked in by Oleksandr Motsak <motsak@…>, 10 years ago
Removed HAVE_CONFIG guards fix: fixed the inclusion of configure-generated *config.h's
  • Property mode set to 100644
File size: 806 bytes
Line 
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 )
18        return bigprimes[i-NUMSMALLPRIMES];
19    else
20        return smallprimes[i];
21}
22
23int cf_getNumPrimes()
24{
25    return NUMPRIMES;
26}
27
28int cf_getSmallPrime( int i )
29{
30    ASSERT( i >= 0 && i < NUMSMALLPRIMES, "index to primes too high" );
31    return smallprimes[i];
32}
33
34int cf_getNumSmallPrimes()
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
45int cf_getNumBigPrimes()
46{
47    return NUMBIGPRIMES;
48}
Note: See TracBrowser for help on using the repository browser.