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 // ----------------------------------------------------------------------------
void copy_zero(void)
Definition: npolygon.h:109
void copy_deep(const newtonPolygon &)
Definition: npolygon.cc:354
void copy_deep(const linearForm &)
Definition: npolygon.cc:94
int positive(void)
Definition: npolygon.cc:280
linearForm & operator=(const linearForm &)
Definition: npolygon.cc:126
void copy_shallow(linearForm &)
Definition: npolygon.h:119
Rational weight_shift(poly, const ring r) const
Definition: npolygon.cc:586
Rational * c
Definition: npolygon.h:22
void copy_new(int)
Definition: npolygon.cc:297
Rational weight_shift1(poly, const ring r) const
Definition: npolygon.cc:629
newtonPolygon & operator=(const newtonPolygon &)
Definition: npolygon.cc:386
Rational weight1(poly, const ring r) const
Definition: npolygon.cc:246
linearForm()
Definition: npolygon.h:130
Rational pweight(poly, const ring r) const
Definition: npolygon.cc:206
void copy_delete(void)
Definition: npolygon.cc:343
const ring r
Definition: syzextra.cc:208
Rational weight(poly, const ring r) const
Definition: npolygon.cc:190
void copy_delete(void)
Definition: npolygon.cc:83
void copy_shallow(newtonPolygon &)
Definition: npolygon.h:154
Rational weight_shift(poly, const ring r) const
Definition: npolygon.cc:230
#define NULL
Definition: omList.c:10
void add_linearForm(const linearForm &)
Definition: npolygon.cc:526
Rational weight1(poly, const ring r) const
Definition: npolygon.cc:607
linearForm * l
Definition: npolygon.h:66
Rational weight_shift1(poly, const ring r) const
Definition: npolygon.cc:263
polyrec * poly
Definition: hilb.h:10
Rational weight(poly, const ring r) const
Definition: npolygon.cc:565
void copy_zero(void)
Definition: npolygon.h:144
int l
Definition: cfEzgcd.cc:94
friend int operator==(const linearForm &, const linearForm &)
Definition: npolygon.cc:173
ostream & operator<<(ostream &s, const spectrum &spec)
Definition: semic.cc:249
void copy_new(int)
Definition: npolygon.cc:37