source: git/Singular/LIB/classify.lib @ 18dd47

spielwiese
Last change on this file since 18dd47 was f0bce7, checked in by Kai Krüger <krueger@…>, 27 years ago
Aenderung en fuer Singular 1.0 git-svn-id: file:///usr/local/Singular/svn/trunk@606 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.8 KB
Line 
1// $Id: classify.lib,v 1.7 1997-08-10 08:49:30 krueger Exp $
2//=============================================================================
3//
4// Please send bugs and comments to krueger@mathematik.uni-kl.de
5//
6//=============================================================================
7
8LIBRARY:  Classify.lib
9
10 Classify(f);
11// required libraries
12
13LIB "lib_Setring";
14LIB "lib_ReOrder";
15LIB "lib_RandomPoly";
16LIB "Morse.lib";
17LIB "tools.lib";
18LIB "Kclass.lib";
19LIB "Ausgaben.lib";
20LIB "HKclass.lib";
21LIB "NFlist.lib";
22LIB "Hilbert.lib";
23
24//=========================================================================
25//=========================================================================
26proc Classify_lib
27{
28"
29  Classify(poly f);    determine the typ of the singularity f
30";
31}
32
33//=============================================================================
34// TopLevel Funktion of the Arnold-Classifier.
35//
36proc Classify (poly @f_in)
37USAGE:   Classify(f);  f=poly
38COMPUTE: Normalform and singularity type of f
39RETURN:  Normalform of f
40EXAMPLE: example Classify; shows an example
41REMARK:  This version of Classify is only alpha.
42         Please send bugs and comments to:
43         "Kai Krueger" <krueger@mathematik.uni-kl.de>
44NOTE:    The procedure init_debug(n); is usefull as trace-mode.
45         n may range from 0 to 10, higher values of n give more informations.
46{
47//         or set the shell-variable SG_DEBUG to the debugging level.
48  if(system("version")<922) {
49    "Sorry. You need to have at least Singular version 0.9.2.c"
50    return;
51  }
52
53  def ring_top=basering;
54  // Get characteristics of ring set it as default.
55  if(defined(CharOfRing) == 1) { kill CharOfRing; }
56  int CharOfRing = char(basering);
57  export CharOfRing;
58
59  if(checkring()) { return(@f_in); }
60  int @show_nf = 1;    // return normal form if set to '1'
61
62  int @n = nvars(basering);
63
64  // Save the name of initial ring
65  int @i;
66
67  // if trace/debug mode not set, do it!
68  init_debug();
69
70  // define new ring
71  if( defined(Rtop) == 1) { kill Rtop; }
72  ring Rtop=char(basering),(x(1..@n)),(c,ds);
73  export Rtop;
74
75  map @Conv=ring_top,maxideal(1);
76  setring ring_top;
77
78  if(defined(ShowPoly) == 1) { kill ShowPoly; }
79  map ShowPoly=Rtop,maxideal(1);
80  export ShowPoly;
81  setring Rtop;
82  init();
83
84  string RingDisplay = "ring_top";
85  export RingDisplay;
86
87  string @s1;
88  string @s2;
89  string @s3;
90  string @s4;
91  @s1,@s2=Klassifiziere(@Conv(@f_in));
92  // @s1: f nach saemtlichen Koordinatentransformationen
93  // @s2: Typ des Polynoms f z.b: E[18]
94  @s4 = "poly @f_out="+@s1+";";
95//"Corang:"+ string(CoRang);
96  debug_log(10, "S1=", @s1);
97  debug_log(10, "S2=", @s2);
98
99  if( @s2[1,2]=="f " || @s2[1,4]=="The " || @s2=="Fehler!" || @s2=="A[0]") {
100    if( @s2 != "Fehler!") { @s2; }
101    if(@s1=="1" || @s2[1,4]=="The " || @s2=="Fehler!" ) {
102      setring ring_top;
103      return(@f_in);
104    }
105    setring Rtop;
106    execute @s4;
107    map @ConvUp=Rtop,maxideal(1);
108  }
109  else {
110    setring RingB;
111    execute @s4;
112    setring Rtop;
113    map @ConvUp=RingB,maxideal(1);
114  }
115  if(@show_nf==1) {
116    poly @f_nf = NormalForm(@s2);
117    for(@i=4;@i<=@n;@i=@i+1) {
118      @f_nf = @f_nf + x(@i)^2;
119    }
120    if(DeBug>1) { "Normal form NF(f)=", @f_nf; }
121  }
122  poly @f_out = @ConvUp(@f_out);
123//listvar();
124//"------------------------------";
125//"Corang:"+ string(CoRang);
126//"Classify() Controlpoint Test----";
127//listvar();
128//"------------------------------";
129  for(@i=CoRang+1;@i<=@n;@i=@i+1) {
130    @f_out = @f_out + x(@i)^2;
131  }
132//"Classify() Controlpoint Test----";
133  setring ring_top;
134  map @ConvBack=Rtop,maxideal(1);
135//"Classify() Controlpoint Test----";
136
137  if(@show_nf == 1) {
138    return(@ConvBack(@f_nf));
139  }
140  else { return(@ConvBack(@f_out)); }
141}
142example
143{"EXAMPLE"; echo=2;
144   ring r=0,(x,y,z),ds;
145   init_debug(2);
146   poly f=(x2+3y-2z)^2+xyz-(x-y3+x2*z3)^3;
147   poly g=Classify(f);
148}
149// E n d   O f   F i l e
Note: See TracBrowser for help on using the repository browser.