source: git/factory/int_pp.h @ 2dd068

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