My Project
Loading...
Searching...
No Matches
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
12
13// ----------------------------------------------------------------------------
14// Class representing a linear form QQ^N-->QQ
15// ----------------------------------------------------------------------------
16
18{
19
20private:
21
22 Rational *c; // the coefficients
23 int N; // number of coefficients
24
25public:
26
27 linearForm( );
28 linearForm( const linearForm& );
29 ~linearForm( );
30
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
64private:
65
66 linearForm *l; // the linear forms
67 int N; // number of linear forms
68
69public:
70
73 newtonPolygon( poly, const ring r );
75
77
78
79 void copy_new ( int );
80 void copy_delete ( void );
81 void copy_zero ( void );
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
109inline 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
144inline 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// ----------------------------------------------------------------------------
int l
Definition: cfEzgcd.cc:100
Rational weight_shift(poly, const ring r) const
Definition: npolygon.cc:229
Rational weight(poly, const ring r) const
Definition: npolygon.cc:189
void copy_zero(void)
Definition: npolygon.h:109
linearForm()
Definition: npolygon.h:130
friend int operator==(const linearForm &, const linearForm &)
Definition: npolygon.cc:172
Rational weight1(poly, const ring r) const
Definition: npolygon.cc:245
void copy_new(int)
Definition: npolygon.cc:36
Rational * c
Definition: npolygon.h:22
Rational weight_shift1(poly, const ring r) const
Definition: npolygon.cc:262
void copy_delete(void)
Definition: npolygon.cc:82
linearForm & operator=(const linearForm &)
Definition: npolygon.cc:125
Rational pweight(poly, const ring r) const
Definition: npolygon.cc:205
int positive(void)
Definition: npolygon.cc:279
void copy_shallow(linearForm &)
Definition: npolygon.h:119
void copy_deep(const linearForm &)
Definition: npolygon.cc:93
void add_linearForm(const linearForm &)
Definition: npolygon.cc:525
void copy_new(int)
Definition: npolygon.cc:296
void copy_shallow(newtonPolygon &)
Definition: npolygon.h:154
Rational weight(poly, const ring r) const
Definition: npolygon.cc:564
Rational weight_shift1(poly, const ring r) const
Definition: npolygon.cc:628
void copy_delete(void)
Definition: npolygon.cc:342
newtonPolygon & operator=(const newtonPolygon &)
Definition: npolygon.cc:385
linearForm * l
Definition: npolygon.h:66
Rational weight_shift(poly, const ring r) const
Definition: npolygon.cc:585
void copy_zero(void)
Definition: npolygon.h:144
Rational weight1(poly, const ring r) const
Definition: npolygon.cc:606
void copy_deep(const newtonPolygon &)
Definition: npolygon.cc:353
#define NULL
Definition: omList.c:12
ostream & operator<<(ostream &s, const spectrum &spec)
Definition: semic.cc:249