source: git/Singular/LIB/polyclass.lib @ 06808a

spielwiese
Last change on this file since 06808a was 06808a, checked in by Janko Boehm <boehm@…>, 6 years ago
NRF
  • Property mode set to 100644
File size: 6.0 KB
Line 
1//////////////////////////////////////////////////////////////////////////////
2version="version polyclass.lib 4.1.1.0 Dec_2017 "; // $Id$
3category="Commutative Algebra";
4info="
5LIBRARY: polyclass.lib   Data types for normal form equations
6AUTHORS:               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
11OVERVIEW:
12This library implements a ring independent polynomial type used for the return value in
13classify2.lib and realclassify.lib. You can use +,  * and == for addition, multiplication
14and comparison. The key over contains the base ring of the polynomial, the key value its
15value as a polynomial of type poly. The constructor can be called by assigning a polynomial
16of type poly to a polynomial of type Poly via =.
17
18Moreover the library implements a class NormalformEquation consisting out of a string type,
19an integer milnorNumber, a Poly normalFormEquation, and integer modality, a list of numbers
20parameters, a list variables, an integer corank, in the real case, an integer inertiaIndex,
21a list of open intervals represented as lists consisting out of two rationals used to select
22a real root of the minimal polynomial (which is stored in the variable minpoly of the polynomial
23ring containing normalFormEquation, that is, in normalFormEquation.in), or if no minimal
24polynomial is defined then an interval containing the rational parameter value.
25
26Acknowledgements: This research was supported by
27the Staff Exchange Bursary Programme of the University of Pretoria, DFG SPP 1489,
28DFG TRR 195. The financial assistance of the National Research Foundation (NRF),
29South Africa, towards this research is hereby acknowledged. Opinions expressed
30and conclusions arrived at are those of the author and are not necessarily to be
31attributed to the National Research Foundation, South Africa.
32
33
34KEYWORDS:
35polynomials
36
37SEE ALSO: realclassify_lib, classify2_lib
38
39PROCEDURES:
40makePoly(f);  constructor for ring independent polynomial type Poly
41printPoly(f); print routine for polynomial type Poly
42printNormalFormEquation(F); print routine for normal form equations
43";
44
45LIB "sing.lib";
46
47static 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
61proc printNormalFormEquation(NormalFormEquation F)
62"USAGE: printNormalFormEquation(F); F NormalFormEquation
63RETURN: print a normal form equation
64EXAMPLE: example printNormalFormEquation, shows an example"
65{
66def R=basering;
67Poly f=F.normalFormEquation;
68def SS=f.in;
69setring SS;
70"Corank = "+string(F.corank);
71if (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);
76if (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);
94setring R;
95}
96example
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
133proc makePoly(poly f)
134"USAGE: makePoly(f); f poly
135RETURN: make a ring independent Poly from a poly in the basering
136EXAMPLE: example makePoly, shows an example"
137{
138Poly F;
139F.in=basering;
140F.value=f;
141return(F);
142}
143example
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
155static proc printPoly(Poly f)
156"USAGE: printPoly(f); f Poly
157RETURN: print Poly
158EXAMPLE: example printPoly, shows an example"
159{
160def R=basering;
161def SS=f.in;
162setring SS;
163f.value;
164setring R;
165}
166example
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
174static proc stringPoly(Poly f)
175{
176def R=basering;
177def SS=f.in;
178setring SS;
179string st = string(f.value);
180setring R;
181return(st);}
182
183
184static proc addPoly(Poly f,Poly g)
185{
186def R=basering;
187def S1=f.in;
188setring S1;
189Poly fplusg=f.value+g.value;
190setring R;
191return(fplusg);}
192
193static proc multPoly(Poly f,Poly g)
194{
195def R=basering;
196def S1=f.in;
197setring S1;
198Poly ftimesg=(f.value)*(g.value);
199setring R;
200return(ftimesg);}
201
202
203static proc equalPoly(Poly f,Poly g)
204{
205def R=basering;
206def S1=f.in;
207setring S1;
208int fgequal=(f.value)==(g.value);
209setring R;
210return(fequal);}
211
212
213static proc expPoly(Poly f,int n)
214{
215def R=basering;
216def S1=f.in;
217setring S1;
218Poly fexpn=(f.value)^n;
219setring R;
220return(fexpn);}
221
222
223
224
Note: See TracBrowser for help on using the repository browser.