Changeset e7ff6b in git for Singular/LIB/lejeune.lib


Ignore:
Timestamp:
Jun 23, 2005, 3:40:16 PM (19 years ago)
Author:
Nadine Cremer <cremer@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
bd0aebb2c1e3b7f2dbd028058ab70ff8f0d5b4d6
Parents:
a789a77f2c934f249a3b434af544b7331a5d7793
Message:
*cremer: formaldiff seems to work,now start putting together... ;-)


git-svn-id: file:///usr/local/Singular/svn/trunk@8384 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/lejeune.lib

    ra789a7 re7ff6b  
    11
    22//-*- mode:C++;-*-
    3 // $Id: lejeune.lib,v 1.3 2005-06-20 10:18:00 cremer Exp $
     3// $Id: lejeune.lib,v 1.4 2005-06-23 13:40:16 cremer Exp $
    44
    55info="
     
    1010PROCEDURES:
    1111    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
    1419  ";
    1520
     
    1924
    2025
    21 proc plugin_coeffs (int i,poly f)
     26
     27
     28proc formaldiff (poly f,int i,int a,int k)
    2229{
    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 t-coeff. 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<=k-1;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);
    2660 
    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);
    3661}
    3762
    3863
    3964
     65proc 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}
    4080
    4181
     82
     83proc 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}
    4291
    4392
     
    87136     for(s=1;s<=i;s++)
    88137      {
    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
    91140     I[t]=sum;
    92141     sum=0;
     
    94143  return(I);
    95144}
     145
     146
     147
     148
     149proc 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   }
     157return(I);
     158}
Note: See TracChangeset for help on using the changeset viewer.