1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | |
---|
3 | /** |
---|
4 | * @file cf_factory.h |
---|
5 | * |
---|
6 | * Interface to generate InternalCF's over various domains from intrinsic types |
---|
7 | * or mpz_t's |
---|
8 | **/ |
---|
9 | #ifndef INCL_CF_FACTORY_H |
---|
10 | #define INCL_CF_FACTORY_H |
---|
11 | |
---|
12 | // #include "config.h" |
---|
13 | |
---|
14 | #include "cf_defs.h" |
---|
15 | #include "variable.h" |
---|
16 | |
---|
17 | #include "factory/cf_gmp.h" |
---|
18 | #include "cf_assert.h" |
---|
19 | |
---|
20 | class InternalCF; |
---|
21 | class CanonicalForm; |
---|
22 | |
---|
23 | class CFFactory |
---|
24 | { |
---|
25 | private: |
---|
26 | static int currenttype; |
---|
27 | public: |
---|
28 | static int gettype () { return currenttype; } |
---|
29 | static void settype ( int type ) |
---|
30 | { |
---|
31 | ASSERT( type==FiniteFieldDomain || type==GaloisFieldDomain || type==IntegerDomain || type==RationalDomain || type==PrimePowerDomain, "illegal basic domain!" ); |
---|
32 | currenttype = type; |
---|
33 | }; |
---|
34 | static InternalCF * basic ( long value ); |
---|
35 | static InternalCF * basic ( int type, long value ); |
---|
36 | static InternalCF * basic ( const char * str ); |
---|
37 | static InternalCF * basic ( const char * str, int base ); |
---|
38 | static InternalCF * basic ( int type, const char * const str ); |
---|
39 | static InternalCF * basic ( int type, long value, bool nonimm ); |
---|
40 | static InternalCF * basic ( const mpz_ptr num ); |
---|
41 | static InternalCF * rational ( long num, long den ); |
---|
42 | static InternalCF * rational ( const mpz_ptr num, const mpz_ptr den, bool normalize ); |
---|
43 | static InternalCF * poly ( const Variable & v, int exp, const CanonicalForm & c ); |
---|
44 | static InternalCF * poly ( const Variable & v, int exp = 1 ); |
---|
45 | }; |
---|
46 | |
---|
47 | void getmpi ( InternalCF * value, mpz_t mpi); |
---|
48 | #endif /* ! INCL_CF_FACTORY_H */ |
---|