Changeset 936ad6 in git


Ignore:
Timestamp:
Jun 24, 2005, 3:40:06 PM (18 years ago)
Author:
Nadine Cremer <cremer@…>
Branches:
(u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
Children:
3781a22b49bf6807b4bfa152e670e186f67e6e1a
Parents:
c3b1728b9644f0affd1ff817d9ed16fc1294f32e
Message:
*cremer: F's are fine, start with G's :-)


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/lejeune.lib

    rc3b172 r936ad6  
    11
    22//-*- mode:C++;-*-
    3 // $Id: lejeune.lib,v 1.10 2005-06-24 12:01:09 cremer Exp $
     3// $Id: lejeune.lib,v 1.11 2005-06-24 13:40:06 cremer Exp $
    44
    55
     
    1818                         N is number of variables of input f
    1919    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
    2122                         M. Lejeune
    2223  ";
    2324
    2425
    25 LIB "ring.lib";                       // need procedures from these libs
     26LIB "ring.lib";
    2627LIB "general.lib";
    27 
    28 
     28LIB "primdec.lib";
     29LIB "standard.lib";
     30
     31////////////////////////////////////////////////////////////////////////////
     32//                 COMPUTATION OF THE F's
     33////////////////////////////////////////////////////////////////////////////
    2934
    3035proc f_set (poly f,intvec H)         // puts together the single steps from
     
    3540  def R=ringchange(b-1);
    3641  setring R;
    37   list l;
     42  ideal J,I;
    3843  for(i=2;i<=b;i++)
    3944   {
     
    4146     def tmp=f_setstep(f,intvec(H[1..i]));
    4247     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     
    4552   }
    46   l;
     53  J=simplify(J,2);
     54  J=slimgb(radical(J));
     55  J;
    4756  return(R);
    4857}
     58
    4959
    5060
     
    5262{
    5363  int p;                              // loop variable
    54   int m_0=ord(f);
     64  int m_0=order(f);
     65  int startvar=nvars(basering);                       
    5566  int b=size(H);
    5667  int c=sum(H,1..b-1);
     
    7687
    7788
    78 
    79 
     89////////////////////////////////////////////////////////////////////////////
     90//              PREPARATORY WORK: plugging in and differentiating
     91////////////////////////////////////////////////////////////////////////////
    8092
    8193proc formaldiff (poly f,int i,int a,int k)
     
    111123  export(resultdiff);                // exports the result
    112124  return(R);                         // return the ring
    113  
    114 }
    115 
     125}
     126
     127
     128////////////////////////////////////////////////////////////////////////////
    116129
    117130
     
    131144  return(R);                        // return ring (ring change!)
    132145}
    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)+"");// change
    142   return(R);                 // return the ring, needed in future proc
    143 }
    144 
    145 
    146 
    147 proc variables (int k,int i)
    148 {
    149   list l;
    150   int s,u;                              // loop variables
    151   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 variables   
    157        l[(u-1)*i+s]=str;                // saves them in a list
    158      }
    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 alphabet
    166 {
    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 }
    176146
    177147
     
    196166}
    197167
    198 
     168////////////////////////////////////////////////////////////////////////////
     169//                     CONSTRUCTING the new ring(s)
     170////////////////////////////////////////////////////////////////////////////
     171
     172proc 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
     180proc 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
     198proc 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////////////////////////////////////////////////////////////////////////////
    199214
    200215
     
    209224return(I);
    210225}
     226
     227
     228
     229proc 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.