source: git/factory/cf_primes.cc @ f5d2647

spielwiese
Last change on this file since f5d2647 was 16f511, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Fixed the usage of "config.h" (if defined HAVE_CONFIG_H)
  • Property mode set to 100644
File size: 852 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3#ifdef HAVE_CONFIG_H
4#include "config.h"
5#endif /* HAVE_CONFIG_H */
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.