1 | //============================================================================= |
---|
2 | // $Id: classify.lib,v 1.1 1995-01-02 22:58:50 krueger Exp $ |
---|
3 | // |
---|
4 | //============================================================================= |
---|
5 | // Library-loader. |
---|
6 | // |
---|
7 | proc Lib_lib_Classify |
---|
8 | { |
---|
9 | if(defined(SLib_lib_Classify) == 1) { return(); } |
---|
10 | string SLib_lib_Classify="$Id: classify.lib,v 1.1 1995-01-02 22:58:50 krueger Exp $"; |
---|
11 | verbose (noloadLib); |
---|
12 | // string @Required="lib0,lib1,lib_Classify"; |
---|
13 | // @Required=@Required+",lib_Setring,lib_ReOrder,lib_RandomPoly,lib_Morse"; |
---|
14 | // @Required=@Required+",lib_tools,lib_Kclass,lib_Ausgaben,lib_WorkOn"; |
---|
15 | // @Required=@Required+",lib_HKclass"; |
---|
16 | // int @len = size(@Required); |
---|
17 | // int @i; |
---|
18 | // int @k; |
---|
19 | // string @s; |
---|
20 | |
---|
21 | // for(@i=1;@i<@len;@i=@i+@k) { |
---|
22 | // @s = @Required[@i..@len-@i]; |
---|
23 | // @k = substring(",", @s); |
---|
24 | // @s = @Required[@i..@i+@k-2]; |
---|
25 | // @s; |
---|
26 | // @i; |
---|
27 | // } |
---|
28 | if(defined(SLib_lib0) == 0) { LIB "lib0"; Lib_lib0(); } |
---|
29 | if(defined(SLib_lib1) == 0) { LIB "lib1"; Lib_lib1(); } |
---|
30 | if(defined(SLib_lib_Classify) == 0){LIB "lib_Classify"; Lib_lib_Classify(); } |
---|
31 | if(defined(SLib_lib_Setring) == 0) {LIB "lib_Setring"; Lib_lib_Setring(); } |
---|
32 | if(defined(SLib_lib_ReOrder) == 0) {LIB "lib_ReOrder"; Lib_lib_ReOrder(); } |
---|
33 | if(defined(SLib_lib_RandomPoly)==0){LIB"lib_RandomPoly";Lib_lib_RandomPoly();} |
---|
34 | if(defined(SLib_lib_Morse) == 0) {LIB "lib_Morse"; Lib_lib_Morse(); } |
---|
35 | if(defined(SLib_lib_Kclass) == 0) {LIB "lib_Kclass"; Lib_lib_Kclass(); } |
---|
36 | if(defined(SLib_lib_tools) == 0) {LIB "lib_tools"; Lib_lib_tools(); } |
---|
37 | if(defined(SLib_lib_Ausgaben) == 0){LIB "lib_Ausgaben"; Lib_lib_Ausgaben(); } |
---|
38 | if(defined(SLib_lib_WorkOn) == 0) {LIB "lib_WorkOn"; Lib_lib_WorkOn(); } |
---|
39 | if(defined(SLib_lib_HKclass) == 0) {LIB "lib_HKclass"; Lib_lib_HKclass(); } |
---|
40 | // if(defined(SLib_) == 0) { LIB ""; Lib_(); } |
---|
41 | // if(defined(SLib_) == 0) { LIB ""; Lib_(); } |
---|
42 | } |
---|
43 | |
---|
44 | //============================================================================= |
---|
45 | // |
---|
46 | // |
---|
47 | proc ShowLibs |
---|
48 | { |
---|
49 | } |
---|
50 | proc Lib_lib0 |
---|
51 | { |
---|
52 | string SLib_lib0="Nix"; |
---|
53 | } |
---|
54 | proc Lib_lib1 |
---|
55 | { |
---|
56 | string SLib_lib1="Nix"; |
---|
57 | } |
---|
58 | |
---|
59 | |
---|
60 | //============================================================================= |
---|
61 | // TopLevel Funktion of the Arnold-Classifier. |
---|
62 | // |
---|
63 | proc Classify |
---|
64 | { |
---|
65 | if( #ARGS != 1 ) { |
---|
66 | //============================================================================= |
---|
67 | " USAGE: Classify(<poly>)"; |
---|
68 | " RETURN: Normal-Form of <poly>"; |
---|
69 | " NOTE: Tells the typ of f"; |
---|
70 | " EXAMPLE: ring r;"; |
---|
71 | " //int DeBug=1 / 6 / 11; |
---|
72 | " poly g=Classify(f);"; |
---|
73 | //============================================================================= |
---|
74 | return(#1); |
---|
75 | } |
---|
76 | if( typeof(#1) != "poly") { |
---|
77 | "Classify: argv(1) must be poly"; |
---|
78 | return(#1); |
---|
79 | } |
---|
80 | Lib_lib_Classify(); |
---|
81 | |
---|
82 | poly @f_in = #1; |
---|
83 | int @n = nvars(basering); |
---|
84 | string @RingInput = "setring " + nameof(basering) + ";"; |
---|
85 | string @tmp = "map @Conv=" + nameof(basering) + ","; |
---|
86 | int @i; |
---|
87 | |
---|
88 | if( defined(Rtop) == 1) { kill Rtop; } |
---|
89 | execute Setring(@n, "Rtop"); |
---|
90 | @tmp = @tmp + string(maxideal(1)) + ";"; |
---|
91 | execute @tmp; |
---|
92 | execute RingInput; |
---|
93 | map ShowPoly=Rtop,maxideal(1); |
---|
94 | setring Rtop; |
---|
95 | init(); |
---|
96 | string RingDisplay = @RingInput; |
---|
97 | |
---|
98 | string @s1; |
---|
99 | string @s2; |
---|
100 | string @s3; |
---|
101 | @s1,@s2=Klassifiziere(@Conv(@f_in)); |
---|
102 | @s3 = "poly @f_out="+@s1+";"; |
---|
103 | setring RingB; |
---|
104 | execute @s3; |
---|
105 | setring Rtop; |
---|
106 | map @ConvUp=RingB,maxideal(1); |
---|
107 | poly @f_out = @ConvUp(@f_out); |
---|
108 | for(@i=CoRang+1;@i<=@n;@i=@i+1) { |
---|
109 | @f_out = @f_out + x(@i)^2; |
---|
110 | } |
---|
111 | execute @RingInput; |
---|
112 | map @ConvBack=Rtop,maxideal(1); |
---|
113 | // @s2; |
---|
114 | return(@ConvBack(@f_out)); |
---|
115 | } |
---|
116 | // lib0: map SHB=r,A_Z("x",@n); |
---|