1 | ////////////////////////////////////////////////////////////////////////////// |
---|
2 | version="version polyclass.lib 4.1.1.0 Dec_2017 "; // $Id$ |
---|
3 | category="Commutative Algebra"; |
---|
4 | info=" |
---|
5 | LIBRARY: polyclass.lib Data types for normal form equations |
---|
6 | AUTHORS: Janko Boehm, email: boehm@mathematik.uni-kl.de |
---|
7 | Magdaleen Marais, email: magdaleen.marais@up.ac.za |
---|
8 | Gerhard Pfister, email: pfister@mathematik.uni-kl.de |
---|
9 | |
---|
10 | |
---|
11 | OVERVIEW: |
---|
12 | This library implements a ring independent polynomial type used for the return value in |
---|
13 | classify2.lib and realclassify.lib. You can use +, * and == for addition, multiplication |
---|
14 | and comparison. The key over contains the base ring of the polynomial, the key value its |
---|
15 | value as a polynomial of type poly. The constructor can be called by assigning a polynomial |
---|
16 | of type poly to a polynomial of type Poly via =. |
---|
17 | |
---|
18 | Moreover the library implements a class NormalformEquation consisting out of a string type, |
---|
19 | an integer milnorNumber, a Poly normalFormEquation, and integer modality, a list of numbers |
---|
20 | parameters, a list variables, an integer corank, in the real case, an integer inertiaIndex, |
---|
21 | a list of open intervals represented as lists consisting out of two rationals used to select |
---|
22 | a real root of the minimal polynomial (which is stored in the variable minpoly of the polynomial |
---|
23 | ring containing normalFormEquation, that is, in normalFormEquation.in), or if no minimal |
---|
24 | polynomial is defined then an interval containing the rational parameter value. |
---|
25 | |
---|
26 | Acknowledgements: This research was supported by |
---|
27 | the Staff Exchange Bursary Programme of the University of Pretoria, DFG SPP 1489, |
---|
28 | DFG TRR 195. The financial assistance of the National Research Foundation (NRF), |
---|
29 | South Africa, towards this research is hereby acknowledged. Opinions expressed |
---|
30 | and conclusions arrived at are those of the author and are not necessarily to be |
---|
31 | attributed to the National Research Foundation, South Africa. |
---|
32 | |
---|
33 | |
---|
34 | KEYWORDS: |
---|
35 | polynomials |
---|
36 | |
---|
37 | SEE ALSO: realclassify_lib, classify2_lib |
---|
38 | |
---|
39 | PROCEDURES: |
---|
40 | makePoly(f); constructor for ring independent polynomial type Poly |
---|
41 | printPoly(f); print routine for polynomial type Poly |
---|
42 | printNormalFormEquation(F); print routine for normal form equations |
---|
43 | "; |
---|
44 | |
---|
45 | LIB "sing.lib"; |
---|
46 | |
---|
47 | static proc mod_init() |
---|
48 | { |
---|
49 | newstruct("Poly","ring in,poly value"); |
---|
50 | newstruct("NormalFormEquation","list vars, string singularityType, int milnorNumber, Poly normalFormEquation, int modality, list parameters, int corank, int inertiaIndex, int determinacy, int realCase"); |
---|
51 | system("install","Poly","print",printPoly,1); |
---|
52 | system("install","Poly","string",stringPoly,1); |
---|
53 | system("install","Poly","+",addPoly,2); |
---|
54 | system("install","Poly","*",multPoly,2); |
---|
55 | system("install","Poly","^",expPoly,2); |
---|
56 | system("install","Poly","==",equalPoly,2); |
---|
57 | system("install","Poly","=",makePoly,1); |
---|
58 | system("install","NormalFormEquation","print",printNormalFormEquation,1); |
---|
59 | } |
---|
60 | |
---|
61 | proc printNormalFormEquation(NormalFormEquation F) |
---|
62 | "USAGE: printNormalFormEquation(F); F NormalFormEquation |
---|
63 | RETURN: print a normal form equation |
---|
64 | EXAMPLE: example printNormalFormEquation, shows an example" |
---|
65 | { |
---|
66 | def R=basering; |
---|
67 | Poly f=F.normalFormEquation; |
---|
68 | def SS=f.in; |
---|
69 | setring SS; |
---|
70 | "Corank = "+string(F.corank); |
---|
71 | if (F.realCase){"Inertia index = "+string(F.inertiaIndex);} |
---|
72 | "Normalform equation of type = "+(F.singularityType); |
---|
73 | "Normalform equation = "+string(f.value); |
---|
74 | "Milnor number = "+string(F.milnorNumber); |
---|
75 | "Modality = "+string(F.modality); |
---|
76 | if (F.modality>=1){ |
---|
77 | if (F.modality==1){ |
---|
78 | "Parameter term = "+string(F.parameters[1][1]); |
---|
79 | } else { |
---|
80 | string paraterms="Parameter terms = "; |
---|
81 | for (int i =1;i<=size(F.parameters);i++){ |
---|
82 | paraterms=paraterms+string(F.parameters[i][1]); |
---|
83 | if (i<size(F.parameters)){paraterms = paraterms +", ";} |
---|
84 | } |
---|
85 | paraterms; |
---|
86 | } |
---|
87 | if (minpoly!=0){"Minimal polynomial = "+string(minpoly);} |
---|
88 | if (F.realCase && minpoly!=0){ |
---|
89 | if (F.modality>1){ERROR("Not implemented");} |
---|
90 | "Interval = ["+string(F.parameters[1][2][1])+", "+string(F.parameters[1][2][2])+"]"; |
---|
91 | } |
---|
92 | } |
---|
93 | "Determinacy <= "+string(F.determinacy); |
---|
94 | setring R; |
---|
95 | } |
---|
96 | example |
---|
97 | { |
---|
98 | "EXAMPLE:"; echo=2; |
---|
99 | ring R=(0,a),(x,y,z,w),ds; |
---|
100 | minpoly = a^2-2; |
---|
101 | Poly f=x^4+x^2*y^2+a*y^8+z^2-w^2; |
---|
102 | NormalFormEquation F; |
---|
103 | F.vars = ringlist(R)[2]; |
---|
104 | F.realCase = 1; |
---|
105 | F.normalFormEquation = f; |
---|
106 | F.modality = 1; |
---|
107 | F.corank = 2; |
---|
108 | F.inertiaIndex = 1; |
---|
109 | F.determinacy = 8; |
---|
110 | F.milnorNumber = milnor(f.value); |
---|
111 | F.parameters = list(list(a*y^8,list(0,2))); |
---|
112 | F.singularityType = "X[13]"; |
---|
113 | F; |
---|
114 | ring R=(0),(x,y,z,w),ds; |
---|
115 | Poly f=x^4+x^2*y^2+7*y^8+z^2-w^2; |
---|
116 | NormalFormEquation F; |
---|
117 | F.vars = ringlist(R)[2]; |
---|
118 | F.realCase = 1; |
---|
119 | F.normalFormEquation = f; |
---|
120 | F.modality = 1; |
---|
121 | F.corank = 2; |
---|
122 | F.inertiaIndex = 1; |
---|
123 | F.determinacy = 8; |
---|
124 | F.milnorNumber = milnor(f.value); |
---|
125 | F.parameters = list(list(7*y^8,list(-6,8))); |
---|
126 | F.singularityType = "X[13]"; |
---|
127 | F; |
---|
128 | |
---|
129 | } |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | proc makePoly(poly f) |
---|
134 | "USAGE: makePoly(f); f poly |
---|
135 | RETURN: make a ring independent Poly from a poly in the basering |
---|
136 | EXAMPLE: example makePoly, shows an example" |
---|
137 | { |
---|
138 | Poly F; |
---|
139 | F.in=basering; |
---|
140 | F.value=f; |
---|
141 | return(F); |
---|
142 | } |
---|
143 | example |
---|
144 | { |
---|
145 | "EXAMPLE:"; echo=2; |
---|
146 | ring R=0,(x,y),dp; |
---|
147 | Poly f=3*x^2+x*y+1; |
---|
148 | Poly g=2*x+y^3; |
---|
149 | f*g; |
---|
150 | f+g; |
---|
151 | f^3; |
---|
152 | } |
---|
153 | |
---|
154 | |
---|
155 | static proc printPoly(Poly f) |
---|
156 | "USAGE: printPoly(f); f Poly |
---|
157 | RETURN: print Poly |
---|
158 | EXAMPLE: example printPoly, shows an example" |
---|
159 | { |
---|
160 | def R=basering; |
---|
161 | def SS=f.in; |
---|
162 | setring SS; |
---|
163 | f.value; |
---|
164 | setring R; |
---|
165 | } |
---|
166 | example |
---|
167 | { |
---|
168 | "EXAMPLE:"; echo=2; |
---|
169 | ring R=0,(x,y),dp; |
---|
170 | Poly f=3*x^2+x*y+1; |
---|
171 | f; |
---|
172 | } |
---|
173 | |
---|
174 | static proc stringPoly(Poly f) |
---|
175 | { |
---|
176 | def R=basering; |
---|
177 | def SS=f.in; |
---|
178 | setring SS; |
---|
179 | string st = string(f.value); |
---|
180 | setring R; |
---|
181 | return(st);} |
---|
182 | |
---|
183 | |
---|
184 | static proc addPoly(Poly f,Poly g) |
---|
185 | { |
---|
186 | def R=basering; |
---|
187 | def S1=f.in; |
---|
188 | setring S1; |
---|
189 | Poly fplusg=f.value+g.value; |
---|
190 | setring R; |
---|
191 | return(fplusg);} |
---|
192 | |
---|
193 | static proc multPoly(Poly f,Poly g) |
---|
194 | { |
---|
195 | def R=basering; |
---|
196 | def S1=f.in; |
---|
197 | setring S1; |
---|
198 | Poly ftimesg=(f.value)*(g.value); |
---|
199 | setring R; |
---|
200 | return(ftimesg);} |
---|
201 | |
---|
202 | |
---|
203 | static proc equalPoly(Poly f,Poly g) |
---|
204 | { |
---|
205 | def R=basering; |
---|
206 | def S1=f.in; |
---|
207 | setring S1; |
---|
208 | int fgequal=(f.value)==(g.value); |
---|
209 | setring R; |
---|
210 | return(fequal);} |
---|
211 | |
---|
212 | |
---|
213 | static proc expPoly(Poly f,int n) |
---|
214 | { |
---|
215 | def R=basering; |
---|
216 | def S1=f.in; |
---|
217 | setring S1; |
---|
218 | Poly fexpn=(f.value)^n; |
---|
219 | setring R; |
---|
220 | return(fexpn);} |
---|
221 | |
---|
222 | |
---|
223 | |
---|
224 | |
---|