source: git/Singular/LIB/classify.lib @ 457e2d7

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