source: git/factory/int_pp.h @ 1dc616

spielwiese
Last change on this file since 1dc616 was 1dc616, checked in by Hans Schönemann <hannes@…>, 18 years ago
*hannes: test for iostream and iostream.h git-svn-id: file:///usr/local/Singular/svn/trunk@9134 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.7 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: int_pp.h,v 1.5 2006-05-15 08:17:54 Singular 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#ifdef HAVE_IOSTREAM
13#include <iostream>
14#elif defined(HAVE_IOSTREAM_H)
15#include <iostream.h>
16#endif
17#endif /* NOSTREAMIO */
18
19#include "assert.h"
20
21#include "int_cf.h"
22
23
24class InternalPrimePower : public InternalCF
25{
26private:
27    MP_INT thempi;
28    static int initialized;
29    static int prime;
30    static int exp;
31    static MP_INT primepow;
32    static MP_INT primepowhalf;
33    static int initialize();
34    static MP_INT & MPI( const InternalCF * const c );
35public:
36    InternalPrimePower();
37    InternalPrimePower( const InternalCF& )
38    {
39        ASSERT( 0, "ups there is something wrong in your code" );
40    }
41    InternalPrimePower( const int i );
42    InternalPrimePower( const char * str, const int base=10 );
43    InternalPrimePower( const MP_INT & );
44    ~InternalPrimePower();
45    InternalCF* deepCopyObject() const;
46    const char * const classname() const { return "InternalPrimePower"; }
47#ifndef NOSTREAMIO
48    void print( ostream&, char* );
49#endif /* NOSTREAMIO */
50    bool isZero() const;
51    bool isOne() const;
52    InternalCF* genZero();
53    InternalCF* genOne();
54    InternalCF* normalize_myself();
55
56    static void setPrimePower( int p, int k );
57    static int getp();
58    static int getk();
59
60    bool is_imm() const;
61
62    int levelcoeff() const { return PrimePowerDomain; }
63    InternalCF* neg();
64
65    int comparesame( InternalCF* );
66
67    InternalCF* addsame( InternalCF* );
68    InternalCF* subsame( InternalCF* );
69    InternalCF* mulsame( InternalCF* );
70    InternalCF* dividesame( InternalCF* );
71    InternalCF* modulosame( InternalCF* );
72    InternalCF* divsame( InternalCF* );
73    InternalCF* modsame( InternalCF* );
74    void divremsame( InternalCF*, InternalCF*&, InternalCF*& );
75    bool divremsamet( InternalCF*, InternalCF*&, InternalCF*& );
76
77    int comparecoeff( InternalCF* );
78
79    InternalCF* addcoeff( InternalCF* );
80    InternalCF* subcoeff( InternalCF*, bool );
81    InternalCF* mulcoeff( InternalCF* );
82    InternalCF* dividecoeff( InternalCF*, bool );
83    InternalCF* modulocoeff( InternalCF*, bool );
84    InternalCF* divcoeff( InternalCF*, bool );
85    InternalCF* modcoeff( InternalCF*, bool );
86    void divremcoeff( InternalCF*, InternalCF*&, InternalCF*&, bool );
87    bool divremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool );
88
89    int intval() const;
90
91    int intmod( int p ) const;
92
93    int sign() const;
94    friend MP_INT getmpi ( InternalCF * value, bool symmetric );
95};
96
97inline MP_INT & InternalPrimePower::MPI( const InternalCF * const c )
98{
99    return (((InternalPrimePower*)c)->thempi);
100}
101
102#endif /* ! INCL_INT_PP_H */
Note: See TracBrowser for help on using the repository browser.