1 | ////////////////////////////////////////////////////////////////////////////// |
---|
2 | version="version polyclass.lib 4.1.0.3 Nov_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 | KEYWORDS: |
---|
27 | polynomials |
---|
28 | |
---|
29 | SEE ALSO: realclassify_lib, classify2_lib |
---|
30 | |
---|
31 | PROCEDURES: |
---|
32 | makePoly(f); constructor for ring independent polynomial type Poly |
---|
33 | printPoly(f); print routine for polynomial type Poly |
---|
34 | printNormalFormEquation(F); print routine for normal form equations |
---|
35 | "; |
---|
36 | |
---|
37 | |
---|
38 | static proc mod_init() |
---|
39 | { |
---|
40 | LIB "sing.lib"; |
---|
41 | newstruct("Poly","ring in,poly value"); |
---|
42 | newstruct("NormalFormEquation","list vars, string singularityType, int milnorNumber, Poly normalFormEquation, int modality, list parameters, int corank, int inertiaIndex, int determinacy, int realCase"); |
---|
43 | system("install","Poly","print",printPoly,1); |
---|
44 | system("install","Poly","string",stringPoly,1); |
---|
45 | system("install","Poly","+",addPoly,2); |
---|
46 | system("install","Poly","*",multPoly,2); |
---|
47 | system("install","Poly","^",expPoly,2); |
---|
48 | system("install","Poly","==",equalPoly,2); |
---|
49 | system("install","Poly","=",makePoly,1); |
---|
50 | system("install","NormalFormEquation","print",printNormalFormEquation,1); |
---|
51 | } |
---|
52 | |
---|
53 | proc printNormalFormEquation(NormalFormEquation F) |
---|
54 | "USAGE: printNormalFormEquation(F); F NormalFormEquation |
---|
55 | RETURN: print a normal form equation |
---|
56 | EXAMPLE: example printNormalFormEquation, shows an example" |
---|
57 | { |
---|
58 | def R=basering; |
---|
59 | Poly f=F.normalFormEquation; |
---|
60 | def SS=f.in; |
---|
61 | setring SS; |
---|
62 | "Corank = "+string(F.corank); |
---|
63 | if (F.realCase){"Inertia index = "+string(F.inertiaIndex);} |
---|
64 | "Normalform equation of type = "+(F.singularityType); |
---|
65 | "Normalform equation = "+string(f.value); |
---|
66 | "Milnor number = "+string(F.milnorNumber); |
---|
67 | "Modality = "+string(F.modality); |
---|
68 | if (F.modality>=1){ |
---|
69 | if (F.modality==1){ |
---|
70 | "Parameter term = "+string(F.parameters[1][1]); |
---|
71 | } else { |
---|
72 | string paraterms="Parameter terms = "; |
---|
73 | for (int i =1;i<=size(F.parameters);i++){ |
---|
74 | paraterms=paraterms+string(F.parameters[i][1]); |
---|
75 | if (i<size(F.parameters)){paraterms = paraterms +", ";} |
---|
76 | } |
---|
77 | paraterms; |
---|
78 | } |
---|
79 | if (minpoly!=0){"Minimal polynomial = "+string(minpoly);} |
---|
80 | if (F.realCase && minpoly!=0){ |
---|
81 | if (F.modality>1){ERROR("Not implemented");} |
---|
82 | "Interval = ["+string(F.parameters[1][2][1])+", "+string(F.parameters[1][2][2])+"]"; |
---|
83 | } |
---|
84 | } |
---|
85 | "Determinacy <= "+string(F.determinacy); |
---|
86 | setring R; |
---|
87 | } |
---|
88 | example |
---|
89 | { |
---|
90 | "EXAMPLE:"; echo=2; |
---|
91 | ring R=(0,a),(x,y,z,w),ds; |
---|
92 | minpoly = a^2-2; |
---|
93 | Poly f=x^4+x^2*y^2+a*y^8+z^2-w^2; |
---|
94 | NormalFormEquation F; |
---|
95 | F.vars = ringlist(R)[2]; |
---|
96 | F.realCase = 1; |
---|
97 | F.normalFormEquation = f; |
---|
98 | F.modality = 1; |
---|
99 | F.corank = 2; |
---|
100 | F.inertiaIndex = 1; |
---|
101 | F.determinacy = 8; |
---|
102 | F.milnorNumber = milnor(f.value); |
---|
103 | F.parameters = list(list(a*y^8,list(0,2))); |
---|
104 | F.singularityType = "X[13]"; |
---|
105 | F; |
---|
106 | ring R=(0),(x,y,z,w),ds; |
---|
107 | Poly f=x^4+x^2*y^2+7*y^8+z^2-w^2; |
---|
108 | NormalFormEquation F; |
---|
109 | F.vars = ringlist(R)[2]; |
---|
110 | F.realCase = 1; |
---|
111 | F.normalFormEquation = f; |
---|
112 | F.modality = 1; |
---|
113 | F.corank = 2; |
---|
114 | F.inertiaIndex = 1; |
---|
115 | F.determinacy = 8; |
---|
116 | F.milnorNumber = milnor(f.value); |
---|
117 | F.parameters = list(list(7*y^8,list(-6,8))); |
---|
118 | F.singularityType = "X[13]"; |
---|
119 | F; |
---|
120 | |
---|
121 | } |
---|
122 | |
---|
123 | |
---|
124 | |
---|
125 | proc makePoly(poly f) |
---|
126 | "USAGE: makePoly(f); f poly |
---|
127 | RETURN: make a ring independent Poly from a poly in the basering |
---|
128 | EXAMPLE: example makePoly, shows an example" |
---|
129 | { |
---|
130 | Poly F; |
---|
131 | F.in=basering; |
---|
132 | F.value=f; |
---|
133 | return(F); |
---|
134 | } |
---|
135 | example |
---|
136 | { |
---|
137 | "EXAMPLE:"; echo=2; |
---|
138 | ring R=0,(x,y),dp; |
---|
139 | Poly f=3*x^2+x*y+1; |
---|
140 | Poly g=2*x+y^3; |
---|
141 | f*g; |
---|
142 | f+g; |
---|
143 | f^3; |
---|
144 | } |
---|
145 | |
---|
146 | |
---|
147 | static proc printPoly(Poly f) |
---|
148 | "USAGE: printPoly(f); f Poly |
---|
149 | RETURN: print Poly |
---|
150 | EXAMPLE: example printPoly, shows an example" |
---|
151 | { |
---|
152 | def R=basering; |
---|
153 | def SS=f.in; |
---|
154 | setring SS; |
---|
155 | f.value; |
---|
156 | setring R; |
---|
157 | } |
---|
158 | example |
---|
159 | { |
---|
160 | "EXAMPLE:"; echo=2; |
---|
161 | ring R=0,(x,y),dp; |
---|
162 | Poly f=3*x^2+x*y+1; |
---|
163 | f; |
---|
164 | } |
---|
165 | |
---|
166 | static proc stringPoly(Poly f) |
---|
167 | { |
---|
168 | def R=basering; |
---|
169 | def SS=f.in; |
---|
170 | setring SS; |
---|
171 | string st = string(f.value); |
---|
172 | setring R; |
---|
173 | return(st);} |
---|
174 | |
---|
175 | |
---|
176 | static proc addPoly(Poly f,Poly g) |
---|
177 | { |
---|
178 | def R=basering; |
---|
179 | def S1=f.in; |
---|
180 | setring S1; |
---|
181 | Poly fplusg=f.value+g.value; |
---|
182 | setring R; |
---|
183 | return(fplusg);} |
---|
184 | |
---|
185 | static proc multPoly(Poly f,Poly g) |
---|
186 | { |
---|
187 | def R=basering; |
---|
188 | def S1=f.in; |
---|
189 | setring S1; |
---|
190 | Poly ftimesg=(f.value)*(g.value); |
---|
191 | setring R; |
---|
192 | return(ftimesg);} |
---|
193 | |
---|
194 | |
---|
195 | static proc equalPoly(Poly f,Poly g) |
---|
196 | { |
---|
197 | def R=basering; |
---|
198 | def S1=f.in; |
---|
199 | setring S1; |
---|
200 | int fgequal=(f.value)==(g.value); |
---|
201 | setring R; |
---|
202 | return(fequal);} |
---|
203 | |
---|
204 | |
---|
205 | static proc expPoly(Poly f,int n) |
---|
206 | { |
---|
207 | def R=basering; |
---|
208 | def S1=f.in; |
---|
209 | setring S1; |
---|
210 | Poly fexpn=(f.value)^n; |
---|
211 | setring R; |
---|
212 | return(fexpn);} |
---|
213 | |
---|
214 | |
---|
215 | |
---|
216 | |
---|