source: git/factory/int_pp.h @ 2667bc8

spielwiese
Last change on this file since 2667bc8 was d07137, checked in by Hans Schönemann <hannes@…>, 21 years ago
*hannes: faster conversions git-svn-id: file:///usr/local/Singular/svn/trunk@6895 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.4 2003-10-15 17:19:41 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#include <iostream.h>
13#endif /* NOSTREAMIO */
14
15#include "assert.h"
16
17#include "int_cf.h"
18
19
20class InternalPrimePower : public InternalCF
21{
22private:
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 );
31public:
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, const int base=10 );
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
93inline MP_INT & InternalPrimePower::MPI( const InternalCF * const c )
94{
95    return (((InternalPrimePower*)c)->thempi);
96}
97
98#endif /* ! INCL_INT_PP_H */
Note: See TracBrowser for help on using the repository browser.