1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: int_pp.h,v 1.3 1997-06-19 12:22:29 schmidt Exp $ */ |
---|
3 | |
---|
4 | #ifndef INCL_INT_PP_H |
---|
5 | #define INCL_INT_PP_H |
---|
6 | |
---|
7 | #include <config.h> |
---|
8 | |
---|
9 | #include "cf_gmp.h" |
---|
10 | |
---|
11 | #ifndef NOSTREAMIO |
---|
12 | #include <iostream.h> |
---|
13 | #endif /* NOSTREAMIO */ |
---|
14 | |
---|
15 | #include "assert.h" |
---|
16 | |
---|
17 | #include "int_cf.h" |
---|
18 | |
---|
19 | |
---|
20 | class InternalPrimePower : public InternalCF |
---|
21 | { |
---|
22 | private: |
---|
23 | MP_INT thempi; |
---|
24 | static int initialized; |
---|
25 | static int prime; |
---|
26 | static int exp; |
---|
27 | static MP_INT primepow; |
---|
28 | static MP_INT primepowhalf; |
---|
29 | static int initialize(); |
---|
30 | static MP_INT & MPI( const InternalCF * const c ); |
---|
31 | public: |
---|
32 | InternalPrimePower(); |
---|
33 | InternalPrimePower( const InternalCF& ) |
---|
34 | { |
---|
35 | ASSERT( 0, "ups there is something wrong in your code" ); |
---|
36 | } |
---|
37 | InternalPrimePower( const int i ); |
---|
38 | InternalPrimePower( const char * str ); |
---|
39 | InternalPrimePower( const MP_INT & ); |
---|
40 | ~InternalPrimePower(); |
---|
41 | InternalCF* deepCopyObject() const; |
---|
42 | const char * const classname() const { return "InternalPrimePower"; } |
---|
43 | #ifndef NOSTREAMIO |
---|
44 | void print( ostream&, char* ); |
---|
45 | #endif /* NOSTREAMIO */ |
---|
46 | bool isZero() const; |
---|
47 | bool isOne() const; |
---|
48 | InternalCF* genZero(); |
---|
49 | InternalCF* genOne(); |
---|
50 | InternalCF* normalize_myself(); |
---|
51 | |
---|
52 | static void setPrimePower( int p, int k ); |
---|
53 | static int getp(); |
---|
54 | static int getk(); |
---|
55 | |
---|
56 | bool is_imm() const; |
---|
57 | |
---|
58 | int levelcoeff() const { return PrimePowerDomain; } |
---|
59 | InternalCF* neg(); |
---|
60 | |
---|
61 | int comparesame( InternalCF* ); |
---|
62 | |
---|
63 | InternalCF* addsame( InternalCF* ); |
---|
64 | InternalCF* subsame( InternalCF* ); |
---|
65 | InternalCF* mulsame( InternalCF* ); |
---|
66 | InternalCF* dividesame( InternalCF* ); |
---|
67 | InternalCF* modulosame( InternalCF* ); |
---|
68 | InternalCF* divsame( InternalCF* ); |
---|
69 | InternalCF* modsame( InternalCF* ); |
---|
70 | void divremsame( InternalCF*, InternalCF*&, InternalCF*& ); |
---|
71 | bool divremsamet( InternalCF*, InternalCF*&, InternalCF*& ); |
---|
72 | |
---|
73 | int comparecoeff( InternalCF* ); |
---|
74 | |
---|
75 | InternalCF* addcoeff( InternalCF* ); |
---|
76 | InternalCF* subcoeff( InternalCF*, bool ); |
---|
77 | InternalCF* mulcoeff( InternalCF* ); |
---|
78 | InternalCF* dividecoeff( InternalCF*, bool ); |
---|
79 | InternalCF* modulocoeff( InternalCF*, bool ); |
---|
80 | InternalCF* divcoeff( InternalCF*, bool ); |
---|
81 | InternalCF* modcoeff( InternalCF*, bool ); |
---|
82 | void divremcoeff( InternalCF*, InternalCF*&, InternalCF*&, bool ); |
---|
83 | bool divremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool ); |
---|
84 | |
---|
85 | int intval() const; |
---|
86 | |
---|
87 | int intmod( int p ) const; |
---|
88 | |
---|
89 | int sign() const; |
---|
90 | friend MP_INT getmpi ( InternalCF * value, bool symmetric ); |
---|
91 | }; |
---|
92 | |
---|
93 | inline MP_INT & InternalPrimePower::MPI( const InternalCF * const c ) |
---|
94 | { |
---|
95 | return (((InternalPrimePower*)c)->thempi); |
---|
96 | } |
---|
97 | |
---|
98 | #endif /* ! INCL_INT_PP_H */ |
---|