source: git/factory/int_pp.h @ 84250a6

spielwiese
Last change on this file since 84250a6 was 718e670, checked in by Jens Schmidt <schmidt@…>, 27 years ago
stream-io wrapped by NOSTREAMIO git-svn-id: file:///usr/local/Singular/svn/trunk@106 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.1 1997-03-27 10:10:17 schmidt Exp $
3
4#ifndef INCL_INTERNALPRIMEPOWER_H
5#define INCL_INTERNALPRIMEPOWER_H
6
7/*
8$Log: not supported by cvs2svn $
9Revision 1.0  1996/05/17 10:59:41  stobbe
10Initial revision
11
12*/
13
14#include "cf_gmp.h"
15
16#ifndef NOSTREAMIO
17#include <iostream.h>
18#endif /* NOSTREAMIO */
19
20#include "assert.h"
21
22#include "int_cf.h"
23
24
25class InternalPrimePower : public InternalCF
26{
27private:
28    MP_INT thempi;
29    static int initialized;
30    static int prime;
31    static int exp;
32    static MP_INT primepow;
33    static MP_INT primepowhalf;
34    static int initialize();
35    static MP_INT & MPI( const InternalCF * const c );
36public:
37    InternalPrimePower();
38    InternalPrimePower( const InternalCF& )
39    {
40        ASSERT( 0, "ups there is something wrong in your code" );
41    }
42    InternalPrimePower( const int i );
43    InternalPrimePower( const char * str );
44    InternalPrimePower( const MP_INT & );
45    ~InternalPrimePower();
46    InternalCF* deepCopyObject() const;
47    const char * const classname() const { return "InternalPrimePower"; }
48#ifndef NOSTREAMIO
49    void print( ostream&, char* );
50#endif /* NOSTREAMIO */
51    bool isZero() const;
52    bool isOne() const;
53    InternalCF* genZero();
54    InternalCF* genOne();
55    InternalCF* normalize_myself();
56
57    static void setPrimePower( int p, int k );
58    static int getp();
59    static int getk();
60
61    bool is_imm() const;
62
63    int levelcoeff() const { return PrimePowerDomain; }
64    InternalCF* neg();
65
66    int comparesame( InternalCF* );
67
68    InternalCF* addsame( InternalCF* );
69    InternalCF* subsame( InternalCF* );
70    InternalCF* mulsame( InternalCF* );
71    InternalCF* dividesame( InternalCF* );
72    InternalCF* modulosame( InternalCF* );
73    InternalCF* divsame( InternalCF* );
74    InternalCF* modsame( InternalCF* );
75    void divremsame( InternalCF*, InternalCF*&, InternalCF*& );
76    bool divremsamet( InternalCF*, InternalCF*&, InternalCF*& );
77
78    int comparecoeff( InternalCF* );
79
80    InternalCF* addcoeff( InternalCF* );
81    InternalCF* subcoeff( InternalCF*, bool );
82    InternalCF* mulcoeff( InternalCF* );
83    InternalCF* dividecoeff( InternalCF*, bool );
84    InternalCF* modulocoeff( InternalCF*, bool );
85    InternalCF* divcoeff( InternalCF*, bool );
86    InternalCF* modcoeff( InternalCF*, bool );
87    void divremcoeff( InternalCF*, InternalCF*&, InternalCF*&, bool );
88    bool divremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool );
89
90    int intval() const;
91
92    int intmod( int p ) const;
93
94    int sign() const;
95    friend MP_INT getmpi ( InternalCF * value, bool symmetric );
96};
97
98inline MP_INT & InternalPrimePower::MPI( const InternalCF * const c )
99{
100    return (((InternalPrimePower*)c)->thempi);
101}
102
103#endif /* INCL_INTERNALPRIMEPOWER_H */
Note: See TracBrowser for help on using the repository browser.