.svn folders cleaned
[libg2hec.git] / include / g2hec_nsfieldtype.h
blob54d8606e82c94eabd1082119eb5c6f5f07b8947f
1 /*++
2 Module Name:
3 g2hec_nsfieldtype.h
5 Summary:
6 field_t and poly_t settings
8 Note:
9 Needs to be included by the main module g2hec_Genus2_ops.h.
10 Currently only ZZ_p and ZZ_pX are supported field types.
11 --*/
13 #ifndef NSFIELDTYPE_H
14 #define NSFIELDTYPE_H
16 /**************************************************************/
17 /* To support ZZ_pE, must change the following to
18 #define _FLD_TYPE ZZ_pE. Default is ZZ_p.
20 I know, this is by no means convenient. But the way in which NTL uses
21 different fields makes it hard to switch between different types easily.
23 #define _FLD_TYPE ZZ_p
24 /**************************************************************/
26 /* SET_POLY_TYPE(T) sets the type of the polynomials
27 it needs to be invoked by the client before the polynomials
28 are defined.
29 Example: SET_POLY_TYPE(ZZ_pX)
32 #define SET_POLY_TYPE(T) \
33 typedef NTL_NNS _FLD_TYPE field_t; \
34 typedef NTL_NNS T poly_t; \
35 typedef const poly_t poly_tc
37 #if _FLD_TYPE == ZZ_p
39 #include <NTL/ZZ_pXFactoring.h>
41 SET_POLY_TYPE(ZZ_pX);
43 #elif _FLD_TYPE == ZZ_pE
44 #include <NTL/ZZ_pEXFactoring.h>
46 SET_POLY_TYPE(ZZ_pEX);
48 #elif _FLD_TYPE == GF2
50 #error "Field type GF2 not currently supported"
52 #elif _FLD_TYPE == GF2E
55 #include <NTL/GF2EXFactoring.h>
57 SET_POLY_TYPE(GF2EX);
59 #error "Field type GF2E not currently supported"
61 #else
62 #error "Unsupported field type"
64 #endif
67 #endif /* NSFIELDTYPE_H */