Changeset e7ff6b in git for Singular/LIB/lejeune.lib
 Timestamp:
 Jun 23, 2005, 3:40:16 PM (18 years ago)
 Branches:
 (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
 Children:
 bd0aebb2c1e3b7f2dbd028058ab70ff8f0d5b4d6
 Parents:
 a789a77f2c934f249a3b434af544b7331a5d7793
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/lejeune.lib
ra789a7 re7ff6b 1 1 2 2 //* mode:C++;* 3 // $Id: lejeune.lib,v 1. 3 20050620 10:18:00cremer Exp $3 // $Id: lejeune.lib,v 1.4 20050623 13:40:16 cremer Exp $ 4 4 5 5 info=" … … 10 10 PROCEDURES: 11 11 variables(k,i); creates k*i new var. t,a(1),..,a(i),..,x(1),..,x(i) 12 a_z(k); returns kth letter of the alphabet 13 tpolys(k,i); creates polyn. a(1)*t+..+a(n)*t^n 12 a_z(k); returns kth letter of the alphabet 13 tpolys(k,i); creates polyn. a(1)*t+..+a(n)*t^n 14 ringchange(i); changes the ring to the one needed in ith step 15 plugin_coeffs(i,f) plugs tpolys into f, up to power i 16 maxidealstep(i,N); returns ideal needed for contraction in ith step; 17 N is number of variables of input f 18 formaldiff(f,k); computes the formal derivatives D_I with I<k 14 19 "; 15 20 … … 19 24 20 25 21 proc plugin_coeffs (int i,poly f) 26 27 28 proc formaldiff (poly f,int i,int a,int k) 22 29 { 23 def r=basering; 24 int k=nvars(r); 25 string str=variables(k,i); 30 int s,t,v; // loop variables 31 int u; 32 def R=plugin_coeffs(f,i); // plugs the power series in... 33 setring R; // changes the ring 34 def Coe=result; 35 matrix coe=Coe; // gives the tcoeff. after plugging in 36 poly fkv; // need this stuff for the following 37 ideal m; // loops... 38 ideal m1,m2,J,resultdiff; 39 for(v=0;v<=k1;v++) // consider the different coeff. 40 { 41 fkv=coe[a+v,1]; 42 m=fkv; 43 J=fkv; // will save the result in this step 44 for(s=1;s<k;s++) 45 { 46 m1=maxidealstep(i,startvar); // computes the corresponding ideal 47 m1=m1^s; 48 u=size(m1); 49 for(t=1;t<=u;t++) 50 { 51 m2=contract(m1[t],m); // actual differentiation 52 J=J,m2; 53 } 54 } 55 resultdiff=resultdiff,J; 56 } 57 resultdiff;~ 58 export(resultdiff); 59 return(R); 26 60 27 def R=changevar(""+varstr(r)+",t,"+variables(k,i)+"");28 setring R;29 ideal I=tpolys(i,k);30 poly g=imap(r,f);31 map h=r,I;32 ideal J=h(f);33 matrix output=coeffs(J[1],t);34 keepring R;35 return(output);36 61 } 37 62 38 63 39 64 65 proc plugin_coeffs (poly f,int i) 66 { 67 def r=basering; 68 def R=ringchange(i); 69 setring R; 70 ideal I=tpolys(i,startvar); 71 poly g=imap(r,f); 72 export(g); 73 map h=r,I; 74 ideal J=h(f); 75 export(h); 76 matrix result=coeffs(J[1],t); 77 export result; 78 return(R); 79 } 40 80 41 81 82 83 proc ringchange (int i) 84 { 85 int startvar=nvars(basering); 86 export(startvar); 87 string str=variables(startvar,i); 88 def R=changevar(""+varstr(r)+",t,"+variables(startvar,i)+""); 89 return(R); 90 } 42 91 43 92 … … 87 136 for(s=1;s<=i;s++) 88 137 { 89 sum=sum+var(1+k+v+s)*var(k+1)^s; // clumsy: working with "var(1)" 90 } 138 sum=sum+var(1+k+v+s)*var(k+1)^s; // clumsy: working with "var(1)", 139 } // depends on form of basering 91 140 I[t]=sum; 92 141 sum=0; … … 94 143 return(I); 95 144 } 145 146 147 148 149 proc maxidealstep (int i,int N) 150 { 151 ideal I=var(N+1+i); 152 int j; 153 for(j=2;j<=N;j++) 154 { 155 I=I,var(N+1+j*i); 156 } 157 return(I); 158 }
Note: See TracChangeset
for help on using the changeset viewer.