Changeset 936ad6 in git
- Timestamp:
- Jun 24, 2005, 3:40:06 PM (18 years ago)
- Branches:
- (u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
- Children:
- 3781a22b49bf6807b4bfa152e670e186f67e6e1a
- Parents:
- c3b1728b9644f0affd1ff817d9ed16fc1294f32e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/lejeune.lib
rc3b172 r936ad6 1 1 2 2 //-*- mode:C++;-*- 3 // $Id: lejeune.lib,v 1.1 0 2005-06-24 12:01:09cremer Exp $3 // $Id: lejeune.lib,v 1.11 2005-06-24 13:40:06 cremer Exp $ 4 4 5 5 … … 18 18 N is number of variables of input f 19 19 formaldiff(f,k); computes the formal derivatives D_I with |I|<k 20 f_setstep(f,H); iterates the steps given by H, saved in f_set f_set(f,H); returns the set F corresponding to H as described by 20 f_setstep(f,H); iterates the steps given by H, saved in f_set 21 f_set(f,H); returns the set F corresponding to H as described by 21 22 M. Lejeune 22 23 "; 23 24 24 25 25 LIB "ring.lib"; // need procedures from these libs26 LIB "ring.lib"; 26 27 LIB "general.lib"; 27 28 28 LIB "primdec.lib"; 29 LIB "standard.lib"; 30 31 //////////////////////////////////////////////////////////////////////////// 32 // COMPUTATION OF THE F's 33 //////////////////////////////////////////////////////////////////////////// 29 34 30 35 proc f_set (poly f,intvec H) // puts together the single steps from … … 35 40 def R=ringchange(b-1); 36 41 setring R; 37 list l;42 ideal J,I; 38 43 for(i=2;i<=b;i++) 39 44 { … … 41 46 def tmp=f_setstep(f,intvec(H[1..i])); 42 47 setring R; 43 ideal I=imap(tmp,resultf_set); 44 l[i-1]=I; 48 I=imap(tmp, resultf_set); 49 kill tmp; 50 J=J,I; 51 45 52 } 46 l; 53 J=simplify(J,2); 54 J=slimgb(radical(J)); 55 J; 47 56 return(R); 48 57 } 58 49 59 50 60 … … 52 62 { 53 63 int p; // loop variable 54 int m_0=ord(f); 64 int m_0=order(f); 65 int startvar=nvars(basering); 55 66 int b=size(H); 56 67 int c=sum(H,1..b-1); … … 76 87 77 88 78 79 89 //////////////////////////////////////////////////////////////////////////// 90 // PREPARATORY WORK: plugging in and differentiating 91 //////////////////////////////////////////////////////////////////////////// 80 92 81 93 proc formaldiff (poly f,int i,int a,int k) … … 111 123 export(resultdiff); // exports the result 112 124 return(R); // return the ring 113 114 } 115 125 } 126 127 128 //////////////////////////////////////////////////////////////////////////// 116 129 117 130 … … 131 144 return(R); // return ring (ring change!) 132 145 } 133 134 135 136 proc ringchange (int i)137 {138 int startvar;139 startvar=nvars(basering);140 export(startvar);141 def R=changevar(""+varstr(basering)+",t,"+variables(startvar,i)+"");// change142 return(R); // return the ring, needed in future proc143 }144 145 146 147 proc variables (int k,int i)148 {149 list l;150 int s,u; // loop variables151 string str;152 for (u=1;u<=k;u++)153 {154 for (s=1;s<=i;s++)155 {156 str=""+a_z(u)+"("+string(s)+")"; // creates new variables157 l[(u-1)*i+s]=str; // saves them in a list158 }159 }160 string str1=string(l); // makes the list into a string,161 return(str1); // (needed for ring change)162 }163 164 165 proc a_z (int n) // returns nth letter of the alphabet166 {167 if(1>n>26) // input admissible?168 {169 "n must range between 1 and 26!";170 return(0);171 }172 string s="ring r=0,("+A_Z("a",n)+"),ds;";173 execute(s);174 return (string(var(n)));175 }176 146 177 147 … … 196 166 } 197 167 198 168 //////////////////////////////////////////////////////////////////////////// 169 // CONSTRUCTING the new ring(s) 170 //////////////////////////////////////////////////////////////////////////// 171 172 proc ringchange (int i) 173 { 174 def R=changevar(""+varstr(basering)+",t,"+variables(startvar,i)+"");// change 175 return(R); // return the ring, needed in future proc 176 } 177 178 179 180 proc variables (int k,int i) 181 { 182 list l; 183 int s,u; // loop variables 184 string str; 185 for (u=1;u<=k;u++) 186 { 187 for (s=1;s<=i;s++) 188 { 189 str=""+a_z(u)+"("+string(s)+")"; // creates new variables 190 l[(u-1)*i+s]=str; // saves them in a list 191 } 192 } 193 string str1=string(l); // makes the list into a string, 194 return(str1); // (needed for ring change) 195 } 196 197 198 proc a_z (int n) // returns nth letter of the alphabet 199 { 200 if(1>n>26) // input admissible? 201 { 202 "n must range between 1 and 26!"; 203 return(0); 204 } 205 string s="ring r=0,("+A_Z("a",n)+"),ds;"; 206 execute(s); 207 return (string(var(n))); 208 } 209 210 211 //////////////////////////////////////////////////////////////////////////// 212 // AUXILIARY procedures 213 //////////////////////////////////////////////////////////////////////////// 199 214 200 215 … … 209 224 return(I); 210 225 } 226 227 228 229 proc order (poly f) 230 { 231 poly g=homog(f,var(1)); 232 int k=deg(g); 233 int i; 234 for(i=1;i<k;i++) 235 { 236 if(jet(f,i)!=0) 237 { 238 return(i); 239 } 240 } 241 }
Note: See TracChangeset
for help on using the changeset viewer.