[493c477] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
[2dd068] | 2 | |
---|
[b52d27] | 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 | **/ |
---|
[493c477] | 9 | #ifndef INCL_CF_FACTORY_H |
---|
| 10 | #define INCL_CF_FACTORY_H |
---|
[2dd068] | 11 | |
---|
[e4fe2b] | 12 | // #include "config.h" |
---|
[ab4548f] | 13 | |
---|
[2dd068] | 14 | #include "cf_defs.h" |
---|
| 15 | #include "variable.h" |
---|
[e4fe2b] | 16 | |
---|
[991dd9] | 17 | #include "factory/cf_gmp.h" |
---|
[926aa7] | 18 | #include "cf_assert.h" |
---|
[2dd068] | 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; } |
---|
[f71c1a] | 29 | static void settype ( int type ) |
---|
| 30 | { |
---|
[4a7a45] | 31 | ASSERT( type==FiniteFieldDomain || type==GaloisFieldDomain || type==IntegerDomain || type==RationalDomain || type==PrimePowerDomain, "illegal basic domain!" ); |
---|
[f71c1a] | 32 | currenttype = type; |
---|
| 33 | }; |
---|
[ef4ae2] | 34 | static InternalCF * basic ( int value ); |
---|
[8710ff0] | 35 | static InternalCF * basic ( long value ); |
---|
| 36 | static InternalCF * basic ( int type, long value ); |
---|
[2dd068] | 37 | static InternalCF * basic ( const char * str ); |
---|
[d07137] | 38 | static InternalCF * basic ( const char * str, int base ); |
---|
[16105c] | 39 | static InternalCF * basic ( int type, const char * const str ); |
---|
[8710ff0] | 40 | static InternalCF * basic ( int type, long value, bool nonimm ); |
---|
[a52291] | 41 | static InternalCF * basic ( const mpz_ptr num ); |
---|
[8710ff0] | 42 | static InternalCF * rational ( long num, long den ); |
---|
[a52291] | 43 | static InternalCF * rational ( const mpz_ptr num, const mpz_ptr den, bool normalize ); |
---|
[2dd068] | 44 | static InternalCF * poly ( const Variable & v, int exp, const CanonicalForm & c ); |
---|
| 45 | static InternalCF * poly ( const Variable & v, int exp = 1 ); |
---|
| 46 | }; |
---|
| 47 | |
---|
[b15cf85] | 48 | void getmpi ( InternalCF * value, mpz_t mpi); |
---|
[493c477] | 49 | #endif /* ! INCL_CF_FACTORY_H */ |
---|