My Project
Loading...
Searching...
No Matches
factory
cf_primes.cc
Go to the documentation of this file.
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
14
int
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
23
int
cf_getNumPrimes
()
24
{
25
return
NUMPRIMES
;
26
}
27
28
int
cf_getSmallPrime
(
int
i
)
29
{
30
ASSERT
(
i
>= 0 &&
i
<
NUMSMALLPRIMES
,
"index to primes too high"
);
31
return
smallprimes
[
i
];
32
}
33
34
int
cf_getNumSmallPrimes
()
35
{
36
return
NUMSMALLPRIMES
;
37
}
38
39
int
cf_getBigPrime
(
int
i
)
40
{
41
ASSERT
(
i
>= 0 &&
i
<
NUMBIGPRIMES
,
"index to primes too high"
);
42
return
bigprimes
[
i
];
43
}
44
45
int
cf_getNumBigPrimes
()
46
{
47
return
NUMBIGPRIMES
;
48
}
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
Generated on Mon Feb 27 2023 10:53:48 for My Project by
doxygen 1.9.5
for
Singular