Changeset 95aee2 in git for Singular/LIB/classify.lib
- Timestamp:
- Jan 24, 1997, 11:23:07 AM (27 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- d8481133e44f75748584129b7113d0d4bea86315
- Parents:
- 59aca638db0adc8827cc5d2dc7c24f2b09c83ed7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/classify.lib
r59aca63 r95aee2 1 // $Id: classify.lib,v 1.5 1997-01-24 10:23:07 krueger Exp $ 1 2 //============================================================================= 2 // $Id: classify.lib,v 1.4 1995-02-09 13:52:14 krueger Exp $3 3 // 4 4 // Please send bugs and comments to krueger@mathematik.uni-kl.de 5 5 // 6 6 //============================================================================= 7 LIB "lib0"; 8 LIB "lib1"; 7 // required libraries 8 //LIB "lib0"; 9 //LIB "lib1"; 9 10 LIB "lib_Setring"; 10 11 LIB "lib_ReOrder"; 11 12 LIB "lib_RandomPoly"; 12 LIB "lib_Morse"; 13 LIB "lib_tools"; 14 LIB "lib_Kclass"; 15 LIB "lib_Ausgaben"; 16 LIB "lib_WorkOn"; 17 LIB "lib_HKclass"; 13 LIB "Morse.lib"; 14 LIB "tools.lib"; 15 LIB "Kclass.lib"; 16 LIB "Ausgaben.lib"; 17 LIB "HKclass.lib"; 18 LIB "NFlist.lib"; 19 LIB "Hilbert.lib"; 18 20 19 //============================================================================= 20 // 21 // 22 proc ShowLibs 23 { 24 string @Required = LIB; 25 int @len = size(@Required); 26 int @i; 27 int @k; 28 int @j; 29 string @s; 30 string @s1; 31 32 for(@i=1;@i<@len;@i=@i+@k) { 33 @s = @Required[@i..@len]; 34 @k = find(@s, ","); 35 if(@k>0) { 36 @s = @Required[@i,@k-1]; 37 } 38 else { 39 @k = size(@s); 40 } 41 @s1 = "@j = defined(SLib_"+@s+");"; 42 execute @s1; 43 if( @j != 0) { 44 @s1 = "SLib_"+@s+";"; 45 execute @s1; 46 } 47 } 21 //========================================================================= 22 proc Classify_lib 23 { 24 " 25 Classify(poly f); determine the typ of the singularity f 26 "; 48 27 } 49 28 … … 53 32 proc Classify 54 33 { 55 if( #ARGS!= 1 ) {34 if( size(#) != 1 ) { 56 35 //============================================================================= 57 36 " USAGE: Classify(<poly>)"; … … 63 42 ""; 64 43 " REMARK: This version of Classify is only pre-alpha."; 65 " Please reportsbugs and comments to: ";44 " Please send bugs and comments to: "; 66 45 " \"Kai Krueger\" <krueger@mathematik.uni-kl.de>"; 67 46 ""; … … 71 50 return(); 72 51 } 73 if( typeof(#1) != "poly") { 52 if(system("version")<922) { 53 "Sorry. You need to have at least Singular version 0.9.2.c" 54 return; 55 } 56 if( typeof(#[1]) != "poly") { 74 57 "Classify: argv(1) must be poly"; 75 return(# 1);58 return(#[1]); 76 59 } 77 int @show_nf = 1; // return Normal-form if set to '1' 60 // Get characteristics of ring set it as default. 61 if(defined(CharOfRing) == 1) { kill CharOfRing; } 62 int CharOfRing = char(basering); 63 export CharOfRing; 78 64 79 poly @f_in = #1; 65 if(checkring()) { return(#[1]); } 66 int @show_nf = 1; // return normal form if set to '1' 67 68 poly @f_in = #[1]; 80 69 int @n = nvars(basering); 81 70 … … 86 75 87 76 // if trace/debug mode not set, do it! 88 if( defined(DeBug) == 0) { int DeBug = 0; } 89 if(system("version")>=91) { global DeBug; } 77 if( defined(DeBug) == 0) { 78 string s=system("getenv", "SG_DEBUG"); 79 if( s != "" ) { 80 s="int DeBug="+s; 81 execute s; 82 } 83 else { int DeBug = 0; } 84 } 85 export DeBug; 90 86 91 87 // define new ring 92 88 if( defined(Rtop) == 1) { kill Rtop; } 93 89 execute Setring(@n, "Rtop"); 90 export Rtop; 91 94 92 @tmp = @tmp + string(maxideal(1)) + ";"; 95 93 execute @tmp; 96 if(system("version")>=91) { global Rtop; }97 94 98 95 execute @RingInput; 96 97 if(defined(ShowPoly) == 1) { kill ShowPoly; } 99 98 map ShowPoly=Rtop,maxideal(1); 100 if(system("version")>=91) { global ShowPoly; } 99 export ShowPoly; 100 101 101 setring Rtop; 102 102 init(); 103 103 104 string RingDisplay = @RingInput; 104 if(system("version")>=91) { global RingDisplay; }105 export RingDisplay; 105 106 106 107 string @s1; … … 108 109 string @s3; 109 110 string @s4; 111 //listvar(); 112 //basering; 110 113 @s1,@s2=Klassifiziere(@Conv(@f_in)); 114 // @s1: f nach saemtlichen Koordinatentransformationen 115 // @s2: Typ des Polynoms f z.b: E[18] 111 116 @s4 = "poly @f_out="+@s1+";"; 117 //"Corang:"+ string(CoRang); 112 118 113 setring RingB; 114 execute @s4; 115 setring Rtop; 119 if( @s2[1,2]=="f " || @s2[1,4]=="The " || @s2=="Fehler!" || @s2=="A[0]") { 120 if( @s2 != "Fehler!") { @s2; } 121 if(@s1=="1" || @s2[1,4]=="The " || @s2=="Fehler!" ) { 122 execute @RingInput; 123 return(@f_in); 124 } 125 setring Rtop; 126 execute @s4; 127 map @ConvUp=Rtop,maxideal(1); 128 } 129 else { 130 setring RingB; 131 execute @s4; 132 setring Rtop; 133 map @ConvUp=RingB,maxideal(1); 134 } 135 //"Corang:"+ string(CoRang); 116 136 117 poly @f_nf = NormalForm(@s2); 118 for(@i=5;@i<=@n;@i=@i+1) { 119 @f_nf = @f_nf + x(@i)^2; 137 if(@show_nf==1) { 138 poly @f_nf = NormalForm(@s2); 139 for(@i=4;@i<=@n;@i=@i+1) { 140 @f_nf = @f_nf + x(@i)^2; 141 } 142 if(DeBug>1) { "Normal form NF(f)=", @f_nf; } 120 143 } 121 if(DeBug>1) { "Normal form NF(f)=", @f_nf; } 122 123 map @ConvUp=RingB,maxideal(1); 144 //"Corang:"+ string(CoRang); 145 //listvar(); 146 //"------------------------------"; 147 //"Classify() Controlpoint Test----"; 124 148 poly @f_out = @ConvUp(@f_out); 149 //listvar(); 150 //"------------------------------"; 151 //"Corang:"+ string(CoRang); 152 //"Classify() Controlpoint Test----"; 153 //listvar(); 154 //"------------------------------"; 125 155 for(@i=CoRang+1;@i<=@n;@i=@i+1) { 126 156 @f_out = @f_out + x(@i)^2; 127 157 } 158 //"Classify() Controlpoint Test----"; 128 159 execute @RingInput; 129 160 map @ConvBack=Rtop,maxideal(1); 161 //"Classify() Controlpoint Test----"; 130 162 131 163 if(@show_nf == 1) {
Note: See TracChangeset
for help on using the changeset viewer.