My Project  debian-1:4.1.1-p2+ds-4
npolygon.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // npolygon.h
3 // begin of file
4 // Stephan Endrass, endrass@mathematik.uni-mainz.de
5 // 23.7.99
6 // ----------------------------------------------------------------------------
7 
8 #ifndef NPOLYGON_H
9 #define NPOLYGON_H
10 
11 #include "kernel/spectrum/GMPrat.h"
12 
13 // ----------------------------------------------------------------------------
14 // Class representing a linear form QQ^N-->QQ
15 // ----------------------------------------------------------------------------
16 
18 {
19 
20 private:
21 
22  Rational *c; // the coefficients
23  int N; // number of coefficients
24 
25 public:
26 
27  linearForm( );
28  linearForm( const linearForm& );
29  ~linearForm( );
30 
31  linearForm & operator = ( const linearForm& );
32 
33  friend int operator == ( const linearForm&,const linearForm& );
34 
35  void copy_new ( int );
36  void copy_delete ( void );
37  void copy_zero ( void );
38  void copy_shallow ( linearForm& );
39  void copy_deep ( const linearForm& );
40 
41  Rational weight ( poly, const ring r ) const;
42  Rational weight_shift ( poly, const ring r ) const;
43  Rational weight1 ( poly, const ring r ) const;
44  Rational weight_shift1( poly, const ring r ) const;
45 
46  Rational pweight ( poly, const ring r ) const;
47 
48  int positive ( void );
49 
50  #ifdef NPOLYGON_PRINT
51  friend ostream & operator << ( ostream&,const linearForm& );
52  #endif
53 
54  friend class newtonPolygon;
55 };
56 
57 // ----------------------------------------------------------------------------
58 // Class representing a Newton polygon
59 // ----------------------------------------------------------------------------
60 
62 {
63 
64 private:
65 
66  linearForm *l; // the linear forms
67  int N; // number of linear forms
68 
69 public:
70 
71  newtonPolygon( );
72  newtonPolygon( const newtonPolygon& );
73  newtonPolygon( poly, const ring r );
74  ~newtonPolygon( );
75 
77 
78 
79  void copy_new ( int );
80  void copy_delete ( void );
81  void copy_zero ( void );
82  void copy_shallow( newtonPolygon& );
83  void copy_deep ( const newtonPolygon& );
84 
85  void add_linearForm( const linearForm& );
86 
87  Rational weight ( poly, const ring r ) const;
88  Rational weight_shift ( poly, const ring r ) const;
89  Rational weight1 ( poly, const ring r ) const;
90  Rational weight_shift1( poly, const ring r ) const;
91 
92  //int is_sqh ( void ) const;
93  //Rational* sqh_weights( void ) const;
94  //int sqh_N ( void ) const;
95 
96  #ifdef NPOLYGON_PRINT
97  friend ostream & operator << ( ostream&,const newtonPolygon& );
98  #endif
99 };
100 
101 // ---------------------------------------
102 // inline functions for class linearForm
103 // ---------------------------------------
104 
105 // ----------------------------------------------------------------------------
106 // Initialize with zero
107 // ----------------------------------------------------------------------------
108 
109 inline void linearForm::copy_zero( void )
110 {
111  c = (Rational*)NULL;
112  N = 0;
113 }
114 
115 // ----------------------------------------------------------------------------
116 // Initialize shallow from another linear form
117 // ----------------------------------------------------------------------------
118 
120 {
121  c = l.c;
122  N = l.N;
123 }
124 
125 
126 // ----------------------------------------------------------------------------
127 // Zero constructor
128 // ----------------------------------------------------------------------------
129 
131 {
132  copy_zero( );
133 }
134 
135 
136 // ------------------------------------------
137 // inline functions for class newtonPolygon
138 // ------------------------------------------
139 
140 // ----------------------------------------------------------------------------
141 // Initialize with zero
142 // ----------------------------------------------------------------------------
143 
144 inline void newtonPolygon::copy_zero( void )
145 {
146  l = (linearForm*)NULL;
147  N = 0;
148 }
149 
150 // ----------------------------------------------------------------------------
151 // Initialize shallow from another Newton polygon
152 // ----------------------------------------------------------------------------
153 
155 {
156  l = np.l;
157  N = np.N;
158 }
159 
160 
161 // ----------------------------------------------------------------------------
162 // Zero constructor
163 // ----------------------------------------------------------------------------
164 
166 {
167  copy_zero( );
168 }
169 
170 #endif /* NPOLYGON_H */
171 
172 // ----------------------------------------------------------------------------
173 // npolygon.h
174 // end of file
175 // ----------------------------------------------------------------------------
newtonPolygon::copy_delete
void copy_delete(void)
Definition: npolygon.cc:342
linearForm::weight
Rational weight(poly, const ring r) const
Definition: npolygon.cc:189
newtonPolygon::~newtonPolygon
~newtonPolygon()
Definition: npolygon.cc:376
linearForm::pweight
Rational pweight(poly, const ring r) const
Definition: npolygon.cc:205
newtonPolygon::N
int N
Definition: npolygon.h:67
newtonPolygon
Definition: npolygon.h:61
newtonPolygon::operator=
newtonPolygon & operator=(const newtonPolygon &)
Definition: npolygon.cc:385
linearForm::operator==
friend int operator==(const linearForm &, const linearForm &)
Definition: npolygon.cc:172
newtonPolygon::newtonPolygon
newtonPolygon()
Definition: npolygon.h:165
operator<<
ostream & operator<<(ostream &s, const spectrum &spec)
Definition: semic.cc:249
linearForm::weight_shift
Rational weight_shift(poly, const ring r) const
Definition: npolygon.cc:229
newtonPolygon::weight
Rational weight(poly, const ring r) const
Definition: npolygon.cc:564
newtonPolygon::add_linearForm
void add_linearForm(const linearForm &)
Definition: npolygon.cc:525
linearForm::positive
int positive(void)
Definition: npolygon.cc:279
newtonPolygon::copy_zero
void copy_zero(void)
Definition: npolygon.h:144
newtonPolygon::copy_new
void copy_new(int)
Definition: npolygon.cc:296
linearForm::copy_new
void copy_new(int)
Definition: npolygon.cc:36
linearForm::copy_shallow
void copy_shallow(linearForm &)
Definition: npolygon.h:119
linearForm::~linearForm
~linearForm()
Definition: npolygon.cc:116
linearForm::weight1
Rational weight1(poly, const ring r) const
Definition: npolygon.cc:245
linearForm::c
Rational * c
Definition: npolygon.h:22
linearForm::weight_shift1
Rational weight_shift1(poly, const ring r) const
Definition: npolygon.cc:262
newtonPolygon::copy_deep
void copy_deep(const newtonPolygon &)
Definition: npolygon.cc:353
newtonPolygon::weight1
Rational weight1(poly, const ring r) const
Definition: npolygon.cc:606
linearForm::copy_zero
void copy_zero(void)
Definition: npolygon.h:109
newtonPolygon::weight_shift1
Rational weight_shift1(poly, const ring r) const
Definition: npolygon.cc:628
linearForm::copy_deep
void copy_deep(const linearForm &)
Definition: npolygon.cc:93
NULL
#define NULL
Definition: omList.c:9
linearForm
Definition: npolygon.h:17
linearForm::linearForm
linearForm()
Definition: npolygon.h:130
l
int l
Definition: cfEzgcd.cc:93
newtonPolygon::copy_shallow
void copy_shallow(newtonPolygon &)
Definition: npolygon.h:154
linearForm::N
int N
Definition: npolygon.h:23
linearForm::operator=
linearForm & operator=(const linearForm &)
Definition: npolygon.cc:125
linearForm::copy_delete
void copy_delete(void)
Definition: npolygon.cc:82
newtonPolygon::weight_shift
Rational weight_shift(poly, const ring r) const
Definition: npolygon.cc:585
Rational
Definition: GMPrat.h:14
GMPrat.h
newtonPolygon::l
linearForm * l
Definition: npolygon.h:66