My Project
int_pp.h
Go to the documentation of this file.
1 /* emacs edit mode for this file is -*- C++ -*- */
2 
3 #ifndef INCL_INT_PP_H
4 #define INCL_INT_PP_H
5 
6 // #include "config.h"
7 
8 #include "cf_defs.h"
9 #include "factory/cf_gmp.h"
10 
11 #ifndef NOSTREAMIO
12 #ifdef HAVE_IOSTREAM
13 #include <iostream>
14 #define OSTREAM std::ostream
15 #elif defined(HAVE_IOSTREAM_H)
16 #include <iostream.h>
17 #define OSTREAM ostream
18 #endif
19 #endif /* NOSTREAMIO */
20 
21 #include "cf_assert.h"
22 
23 #include "int_cf.h"
24 
25 
27 {
28 private:
29  mpz_t thempi;
33  static void initialize();
34  static mpz_ptr MPI( const InternalCF * const c );
35 public:
40  {
41  ASSERT( 0, "ups there is something wrong in your code" );
42  }
43  InternalPrimePower( const int i );
44  InternalPrimePower( const char * str, const int base=10 );
45  InternalPrimePower( const mpz_ptr );
48  const char * classname() const { return "InternalPrimePower"; }
49 #ifndef NOSTREAMIO
50  void print( OSTREAM&, char* );
51 #endif /* NOSTREAMIO */
52  bool isZero() const;
53  bool isOne() const;
57 
58  static void setPrimePower( int p, int k );
59 
60  bool is_imm() const;
61 
62  int levelcoeff() const { return PrimePowerDomain; }
64 
66 
76 
78 
88 
89  long intval() const;
90 
91  int intmod( int p ) const;
92 
93  int sign() const;
94  friend void getmpi ( InternalCF * value, mpz_t );
95 };
96 
97 inline mpz_ptr InternalPrimePower::MPI( const InternalCF * const c )
98 {
99  return (((InternalPrimePower*)c)->thempi);
100 }
101 
102 #endif /* ! INCL_INT_PP_H */
int i
Definition: cfEzgcd.cc:132
int k
Definition: cfEzgcd.cc:99
int p
Definition: cfModGcd.cc:4080
assertions for Factory
#define ASSERT(expression, message)
Definition: cf_assert.h:99
factory switches.
#define PrimePowerDomain
Definition: cf_defs.h:23
virtual class for internal CanonicalForm's
Definition: int_cf.h:47
bool isOne() const
bool InternalCF::isOne, isZero () const
bool is_imm() const
InternalCF * dividecoeff(InternalCF *, bool)
void divremsame(InternalCF *, InternalCF *&, InternalCF *&)
static mpz_ptr MPI(const InternalCF *const c)
Definition: int_pp.h:97
long intval() const
InternalCF * modcoeff(InternalCF *, bool)
InternalCF * neg()
InternalCF * normalize_myself()
STATIC_VAR int exp
Definition: int_pp.h:32
int comparesame(InternalCF *)
bool isZero() const
int comparecoeff(InternalCF *)
InternalPrimePower(const int i)
InternalCF * mulcoeff(InternalCF *)
InternalCF * genZero()
InternalCF * modulosame(InternalCF *)
InternalPrimePower(const char *str, const int base=10)
STATIC_VAR int prime
Definition: int_pp.h:31
const char * classname() const
Definition: int_pp.h:48
int sign() const
bool divremsamet(InternalCF *, InternalCF *&, InternalCF *&)
int levelcoeff() const
Definition: int_pp.h:62
InternalCF * divsame(InternalCF *)
InternalCF * dividesame(InternalCF *)
InternalCF * modsame(InternalCF *)
InternalCF * subsame(InternalCF *)
InternalCF * genOne()
InternalCF * subcoeff(InternalCF *, bool)
void divremcoeff(InternalCF *, InternalCF *&, InternalCF *&, bool)
void print(OSTREAM &, char *)
InternalCF * deepCopyObject() const
STATIC_VAR bool initialized
Definition: int_pp.h:30
InternalCF * modulocoeff(InternalCF *, bool)
bool divremcoefft(InternalCF *, InternalCF *&, InternalCF *&, bool)
InternalCF * addsame(InternalCF *)
STATIC_VAR mpz_t primepowhalf
Definition: int_pp.h:37
InternalPrimePower(const InternalCF &)
Definition: int_pp.h:39
STATIC_VAR mpz_t primepow
Definition: int_pp.h:36
InternalCF * mulsame(InternalCF *)
int intmod(int p) const
static void initialize()
friend void getmpi(InternalCF *value, mpz_t)
Definition: cf_factory.cc:303
InternalPrimePower(const mpz_ptr)
static void setPrimePower(int p, int k)
InternalCF * addcoeff(InternalCF *)
InternalCF * divcoeff(InternalCF *, bool)
#define STATIC_VAR
Definition: globaldefs.h:7
Factory's internal CanonicalForm's.
#define OSTREAM
Definition: int_pp.h:14
char N base
Definition: ValueTraits.h:144
char * str(leftv arg)
Definition: shared.cc:704