source: git/factory/cf_primes.cc @ 17b1f3

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