Changeset 2f6f3ee in git
- Timestamp:
- Jul 4, 2005, 11:02:47 AM (18 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- cb12e46b8b11ffabebe9caea01c5ddc872568759
- Parents:
- 8de0cee385a202e9f07ff4632113ccb3c0bff430
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/lejeune.lib
r8de0ce r2f6f3ee 1 1 2 2 //-*- mode:C++;-*- 3 // $Id: lejeune.lib,v 1.1 6 2005-07-04 07:58:23cremer Exp $3 // $Id: lejeune.lib,v 1.17 2005-07-04 09:02:47 cremer Exp $ 4 4 5 5 … … 18 18 ringchange(i); changes the ring to the one needed in ith step 19 19 plugin_coeffs(i,f) plugs tpolys into f, up to power i 20 maxidealstep(i,N);returns ideal needed for contraction in ith step20 diffidealstep(i,N); returns ideal needed for contraction in ith step 21 21 N is number of variables of input f 22 formaldiff(f, k); computes the formal derivatives D_I with |I|<k23 f_setstep(f,H); iterates the steps given by H, saved in f_set22 formaldiff(f,H); computes the formal derivatives corresponding to H 23 and the desciption of F 24 24 f_set(f,H); returns the set F corresponding to H as described by 25 25 M. Lejeune 26 "; 26 g_formaldiff(f,H); computes the formal derivatives corresponding to H 27 and the description of G 28 g_set(f,H); returns the set G corresponding to H as described by 29 M. Lejeune 30 "; 27 31 28 32 … … 36 40 //////////////////////////////////////////////////////////////////////////// 37 41 38 proc f_set (poly f,intvec H) // puts together the single steps from 39 { // f_setstep 42 proc f_set (poly f,intvec H) 43 { 44 int p; // loop variable 45 int m_0=order(f); 46 int b=size(H); 47 if(H[1]!=m_0) // input admissible?! 48 { 49 "H[1]=ord(f) notwendig!!"; 50 return(0); 51 } 52 for(p=1;p<b;p++) 53 { 54 if(H[p]<H[p+1]) 55 { 56 "Unzulaessige Eingabe, H[1]<=...<=H[b] notwendig!"; 57 return(0); 58 } 59 } 60 40 61 def r=basering; 41 62 int startvar=nvars(basering); 42 63 export(startvar); 43 int b=size(H);44 int i;45 64 def R=ringchange(b-1); 46 65 setring R; 47 66 ideal J,I; 48 for( i=2;i<=b;i++)49 50 51 def tmp=f_setstep(f,intvec(H[1..i]));52 53 I=imap(tmp, resultf_set);54 55 56 }67 for(p=2;p<=b;p++) 68 { 69 setring r; 70 def tmp=formaldiff(f,intvec(H[1..p])); 71 setring R; 72 I=imap(tmp,resultdiff); 73 kill tmp; 74 J=J,I; 75 } 57 76 J=simplify(J,4); 58 77 J=simplify(J,2); … … 68 87 69 88 70 proc f_setstep (poly f,intvec H) // returns the conditions for one step71 {72 int p; // loop variable73 int m_0=order(f);74 int b=size(H);75 int c=sum(H,1..b-1);76 if(H[1]!=m_0) // input admissible?!77 {78 "H[1]=ord(f) notwendig!!";79 return(0);80 }81 for(p=1;p<b;p++)82 {83 if(H[p]<H[p+1])84 {85 "Unzulaessige Eingabe, H[1]<=...<=H[b] notwendig!";86 return(0);87 }88 }89 def R=formaldiff(f,b-1,c,H[b]); // actual step90 setring R;91 def resultf_set=resultdiff;92 export(resultf_set);93 return(R);94 }95 96 97 89 //////////////////////////////////////////////////////////////////////////// 98 90 // PREPARATORY WORK: plugging in and differentiating … … 100 92 101 93 102 proc formaldiff (poly f,int i,int a,int k)94 proc formaldiff (poly f,intvec H) 103 95 { 104 96 int s,t,v; // loop variables 105 int u; 97 int u; 98 int i=size(H)-1; // need those parameters for computation 99 int c=sum(H,1..i); 100 int k=H[i+1]; 106 101 def R=plugin_coeffs(f,i); // plugs the power series in... 107 102 setring R; // changes the ring 108 103 def Coe=resultplug; 109 104 matrix coe=Coe; // gives the t-coeff. after plugging in 110 poly fkv; // need this stuff for the following 111 ideal m; 112 ideal m1=maxidealstep(i,startvar); // computes the corresponding ideal 113 ideal m3,m2,J,resultdiff; 105 poly fkv; 106 ideal step=diffidealstep(i,startvar); // computes the corresponding ideal 107 ideal m,power,diffstep,J,resultdiff; 114 108 for(v=1;v<=k;v++) // consider the different t-coeff. 115 109 { 116 fkv=coe[ a+v,1];110 fkv=coe[c+v,1]; 117 111 m=fkv; 118 112 J=fkv; // will save the result in this step 119 113 for(s=1;s<=k-v;s++) 120 114 { 121 m3=m1^s;122 u=size( m3);115 power=step^s; 116 u=size(power); 123 117 for(t=1;t<=u;t++) 124 118 { 125 m2=contract(m3[t],m); // actual differentiation126 J=J, m2;119 diffstep=contract(power[t],m); // actual differentiation 120 J=J,diffstep; 127 121 } 128 122 } … … 223 217 224 218 225 226 proc g_set (poly f,intvec H) // puts together the single steps from 227 { // g_setstep 219 proc g_set (poly f,intvec H) 220 { 221 int p; 222 int m_0=order(f); 223 int b=size(H); 224 if(H[1]!=m_0) // input admissible?! 225 { 226 "H[1]=ord(f) notwendig!!"; 227 return(0); 228 } 229 for(p=1;p<b;p++) 230 { 231 if(H[p]<H[p+1]) 232 { 233 "Unzulaessige Eingabe, H[1]<=...<=H[b] notwendig!"; 234 return(0); 235 } 236 } 237 228 238 def r=basering; 229 239 int startvar=nvars(basering); 230 240 export(startvar); 231 int b=size(H); 232 int i; 233 def R=ringchange(b-1); 241 def R=ringchange(b-1); // work in new ring 234 242 setring R; 235 ideal J,I; 236 for(i=2;i<b;i++) // the steps equal to F 237 { 238 setring r; 239 def tmp=f_setstep(f,intvec(H[1..i])); 240 setring R; 241 I=imap(tmp,resultf_set); 242 kill tmp; 243 J=J,I; 244 } 243 ideal I,J; 244 for(p=2;p<=b-1;p++) // steps equal to f_set... 245 { 246 setring r; 247 def tmp=formaldiff(f,intvec(H[1..p])); 248 setring R; 249 I=imap(tmp,resultdiff); 250 kill tmp; 251 J=J,I; 252 } 253 245 254 setring r; // last step, special for G 246 def tmp=g_ setstep(f,H);;255 def tmp=g_formaldiff(f,H);; 247 256 setring R; 248 I=imap(tmp, resultg_set);257 I=imap(tmp,g_resultdiff); 249 258 kill tmp; 250 259 J=J,I; 251 260 252 J=simplify(J,4); 261 J=simplify(J,4); // simplify, keep radical small 253 262 J=simplify(J,2); 254 263 J=idealsimplify(J); … … 263 272 264 273 265 proc g_setstep (poly f,intvec H) // returns the conditions for the last step266 {267 int p; // loop variable268 int m_0=order(f);269 int b=size(H);270 int c=sum(H,1..b-1);271 if(H[1]!=m_0) // input admissible?!272 {273 "H[1]=ord(f) notwendig!!";274 return(0);275 }276 for(p=1;p<b;p++)277 {278 if(H[p]<H[p+1])279 {280 "Unzulaessige Eingabe, H[1]<=...<=H[b] notwendig!";281 return(0);282 }283 }284 def R=g_formaldiff(f,b-1,c,H[b]); // actual computations285 setring R;286 def resultg_set=g_resultdiff;287 export(resultg_set);288 return(R);289 }290 291 292 293 294 295 274 296 275 //////////////////////////////////////////////////////////////////////////// … … 301 280 302 281 303 proc g_formaldiff (poly f,int i,int a,int k)282 proc g_formaldiff (poly f,intvec H) 304 283 { 305 284 int s,t,v; // loop variables 306 int u; 285 int u; 286 int i=size(H)-1; 287 int c=sum(H,1..i); 288 int k=H[i+1]; 307 289 def R=plugin_coeffs(f,i); // plugs the power series in... 308 290 setring R; // changes the ring … … 310 292 matrix coe=Coe; // gives the t-coeff. after plugging in 311 293 poly fkv; // need this stuff for the following 312 ideal m; 313 ideal m1=maxidealstep(i,startvar); 314 ideal m3,m2,J,g_resultdiff; 294 ideal step=diffidealstep(i,startvar); 295 ideal m,power,diffstep,J,g_resultdiff; 315 296 for(v=1;v<=k;v++) // consider the different t-coeff. 316 297 { 317 fkv=coe[ a+v,1];298 fkv=coe[c+v,1]; 318 299 m=fkv; 319 300 J=fkv; 320 301 for(s=1;s<=k-v+1;s++) // remark: "s<=k-v+1" special!for G!!! 321 302 { 322 m3=m1^s;323 u=size( m3);303 power=step^s; 304 u=size(power); 324 305 for(t=1;t<=u;t++) 325 306 { 326 m2=contract(m3[t],m); // actual differentiation327 J=J, m2;307 diffstep=contract(power[t],m); // actual differentiation 308 J=J,diffstep; 328 309 } 329 310 } … … 348 329 349 330 350 proc maxidealstep (int i,int N) // returns ideal needed for331 proc diffidealstep (int i,int N) // returns ideal needed for 351 332 { // differentiation in ith step 352 333 ideal I=var(N+1+i); … … 412 393 return(result); 413 394 } 395 396 397 398
Note: See TracChangeset
for help on using the changeset viewer.