Changeset 8d5c5fe in git
 Timestamp:
 Jul 1, 2005, 11:36:55 AM (18 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 0540757afbdc88eb339dd7280833cf529b3d7010
 Parents:
 a04d1f9ce550211f34c7952ed8934d6634a90d99
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/lejeune.lib
ra04d1f r8d5c5fe 1 1 2 2 //* mode:C++;* 3 // $Id: lejeune.lib,v 1.1 3 20050630 15:01:51cremer Exp $3 // $Id: lejeune.lib,v 1.14 20050701 09:36:55 cremer Exp $ 4 4 5 5 … … 12 12 variables(k,i); creates k*i new var. t,a(1),..,a(i),..,x(1),..,x(i) 13 13 a_z(k); returns kth letter of the alphabet 14 modd(f,g); modulooperator for polys 15 idealsimplify(I) simplifies ideal i.o. to avoid/keep small radical 16 14 17 tpolys(k,i); creates polyn. a(1)*t+..+a(n)*t^n 15 18 ringchange(i); changes the ring to the one needed in ith step … … 66 69 67 70 proc f_setstep (poly f,intvec H) // returns the conditions for one step 68 { 71 { 69 72 int p; // loop variable 70 73 int m_0=order(f); … … 87 90 setring R; 88 91 def resultf_set=resultdiff; 92 //resultf_set;~; 89 93 export(resultf_set); 90 94 return(R); … … 95 99 // PREPARATORY WORK: plugging in and differentiating 96 100 //////////////////////////////////////////////////////////////////////////// 101 97 102 98 103 proc formaldiff (poly f,int i,int a,int k) … … 102 107 def R=plugin_coeffs(f,i); // plugs the power series in... 103 108 setring R; // changes the ring 104 def Coe=result ;109 def Coe=resultplug; 105 110 matrix coe=Coe; // gives the tcoeff. after plugging in 106 111 poly fkv; // need this stuff for the following … … 112 117 m=fkv; 113 118 J=fkv; // will save the result in this step 114 for(s=1;s< k;s++)119 for(s=1;s<=kv;s++) 115 120 { 116 121 m1=maxidealstep(i,startvar); // computes the corresponding ideal … … 127 132 resultdiff=simplify(resultdiff,2); 128 133 export(resultdiff); // exports the result 134 resultdiff;~; 129 135 return(R); // return the ring 130 136 } … … 132 138 133 139 //////////////////////////////////////////////////////////////////////////// 140 134 141 135 142 … … 145 152 ideal J=h(f); // gives f with power series plugged in 146 153 export(h); 147 matrix result =coeffs(J[1],t); // gives the tcoefficients148 export result ; // export it i.o. to use it later on154 matrix resultplug=coeffs(J[1],t); // gives the tcoefficients 155 export resultplug; // export it i.o. to use it later on 149 156 return(R); // return ring (ring change!) 150 157 } … … 213 220 } 214 221 222 //////////////////////////////////////////////////////////////////////////// 223 // COMPUTING the G's // 224 //////////////////////////////////////////////////////////////////////////// 225 226 227 proc g_set (poly f,intvec H) // puts together the single steps from 228 { // f_setstep 229 def r=basering; 230 int startvar=nvars(basering); 231 export(startvar); 232 int b=size(H); 233 int i; 234 def R=ringchange(b1); 235 setring R; 236 ideal J,I; 237 for(i=2;i<=b;i++) 238 { 239 setring r; 240 def tmp=g_setstep(f,intvec(H[1..i])); 241 setring R; 242 I=imap(tmp, resultg_set); 243 kill tmp; 244 J=J,I; 245 } 246 J=simplify(J,4); 247 J=simplify(J,2); 248 J=idealsimplify(J); 249 option(redSB); 250 J=std(J); 251 J=idealsimplify(J); 252 J=radical(simplify(J,4)); 253 J; 254 return(R); 255 } 256 257 258 259 proc g_setstep (poly f,intvec H) // returns the conditions for one step 260 { 261 int p; // loop variable 262 int m_0=order(f); 263 int b=size(H); 264 int c=sum(H,1..b1); 265 if(H[1]!=m_0) // input admissible?! 266 { 267 "H[1]=ord(f) notwendig!!"; 268 return(0); 269 } 270 for(p=1;p<b;p++) 271 { 272 if(H[p]<H[p+1]) 273 { 274 "Unzulaessige Eingabe, H[1]<=...<=H[b] notwendig!"; 275 return(0); 276 } 277 } 278 def R=g_formaldiff(f,b1,c,H[b]); // actual step 279 setring R; 280 def resultg_set=g_resultdiff; 281 export(resultg_set); 282 return(R); 283 } 284 285 286 287 288 289 290 291 292 //////////////////////////////////////////////////////////////////////////// 293 // PREPARATORY work: differentiating // 294 //////////////////////////////////////////////////////////////////////////// 295 296 297 298 299 proc g_formaldiff (poly f,int i,int a,int k) 300 { "k=";k;~; 301 int s,t,v; // loop variables 302 int u; 303 def R=plugin_coeffs(f,i); // plugs the power series in... 304 setring R; // changes the ring 305 def Coe=resultplug; 306 matrix coe=Coe; // gives the tcoeff. after plugging in 307 poly fkv; // need this stuff for the following 308 ideal m; 309 ideal m1=maxidealstep(i,startvar); 310 ideal m2,J,g_resultdiff; 311 for(v=1;v<=k;v++) // consider the different tcoeff. 312 { "v=";v;~; 313 fkv=coe[a+v,1]; 314 m=fkv; "m=";m;~; 315 if(v<k) 316 { 317 J=fkv; 318 } 319 for(s=1;s<=kv;s++) 320 { "s=";s;~; 321 m1=m1^s;"m1=";m1;~; 322 u=size(m1); 323 for(t=1;t<=u;t++) 324 { 325 m2=contract(m1[t],m); // actual differentiation 326 J=J,m2;m2;~; 327 } 328 } 329 g_resultdiff=g_resultdiff,J; 330 } 331 g_resultdiff=simplify(g_resultdiff,2); 332 //g_resultdiff;~; 333 export(g_resultdiff); // exports the result 334 return(R); // return the ring 335 } 336 337 338 339 340 341 342 343 215 344 216 345 //////////////////////////////////////////////////////////////////////////// … … 247 376 248 377 249 proc idealsimplify (ideal I) 250 { 251 int i,j; 378 proc idealsimplify (ideal I) // simplifies the ideal according to our 379 { // purposes  to avoid the radical or at 380 int i,j; // least to keep the computations small! 252 381 int divisornumber=0; 253 382 int pos; … … 276 405 277 406 278 proc nonzerosize (intvec v) 279 { 280 int k=size(v); 281 int i; 282 int zaehler=0; 283 int sum=0; 284 for(i=1;i<=k;i++) 285 { 286 if(v[i]!=0) 287 { 288 zaehler++; 289 sum=sum+v[i]; 290 } 291 } 292 list l=zaehler,sum; 293 return(l); 294 } 295 296 297 298 proc modd (poly f, poly g) 407 408 409 proc modd (poly f, poly g) // the modulooperation for polys 299 410 { 300 411 poly result=f(f/g)*g;
Note: See TracChangeset
for help on using the changeset viewer.