source: git/Singular/LIB/classify.lib @ f988c9

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