Changeset 8d5c5fe in git for Singular


Ignore:
Timestamp:
Jul 1, 2005, 11:36:55 AM (19 years ago)
Author:
Nadine Cremer <cremer@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
0540757afbdc88eb339dd7280833cf529b3d7010
Parents:
a04d1f9ce550211f34c7952ed8934d6634a90d99
Message:
*cremer:starting to build the G's


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/lejeune.lib

    ra04d1f r8d5c5fe  
    11
    22//-*- mode:C++;-*-
    3 // $Id: lejeune.lib,v 1.13 2005-06-30 15:01:51 cremer Exp $
     3// $Id: lejeune.lib,v 1.14 2005-07-01 09:36:55 cremer Exp $
    44
    55
     
    1212    variables(k,i);      creates k*i new var. t,a(1),..,a(i),..,x(1),..,x(i)
    1313    a_z(k);              returns kth letter of the alphabet
     14    modd(f,g);           modulo-operator for polys
     15    idealsimplify(I)     simplifies ideal- i.o. to avoid/keep small radical
     16
    1417    tpolys(k,i);         creates polyn. a(1)*t+..+a(n)*t^n
    1518    ringchange(i);       changes the ring to the one needed in ith step     
     
    6669
    6770proc f_setstep (poly f,intvec H)      // returns the conditions for one step
    68 { 
     71{
    6972  int p;                              // loop variable
    7073  int m_0=order(f);
     
    8790  setring R;
    8891  def resultf_set=resultdiff;
     92  //resultf_set;~;
    8993  export(resultf_set);
    9094  return(R);   
     
    9599//              PREPARATORY WORK: plugging in and differentiating
    96100////////////////////////////////////////////////////////////////////////////
     101
    97102
    98103proc formaldiff (poly f,int i,int a,int k)
     
    102107  def R=plugin_coeffs(f,i);           // plugs the power series in...
    103108  setring R;                          // changes the ring
    104   def Coe=result;   
     109  def Coe=resultplug;   
    105110  matrix coe=Coe;                     // gives the t-coeff. after plugging in
    106111  poly fkv;                           // need this stuff for the following
     
    112117     m=fkv;                           
    113118     J=fkv;                           // will save the result in this step
    114      for(s=1;s<k;s++)
     119     for(s=1;s<=k-v;s++)
    115120       {
    116121         m1=maxidealstep(i,startvar); // computes the corresponding ideal
     
    127132  resultdiff=simplify(resultdiff,2);
    128133  export(resultdiff);                // exports the result
     134  resultdiff;~;
    129135  return(R);                         // return the ring
    130136}
     
    132138
    133139////////////////////////////////////////////////////////////////////////////
     140
    134141
    135142
     
    145152  ideal J=h(f);                     // gives f with power series plugged in
    146153  export(h);                   
    147   matrix result=coeffs(J[1],t);     // gives the t-coefficients
    148   export result;                    // export it i.o. to use it later on
     154  matrix resultplug=coeffs(J[1],t);     // gives the t-coefficients
     155  export resultplug;                    // export it i.o. to use it later on
    149156  return(R);                        // return ring (ring change!)
    150157}
     
    213220}
    214221
     222////////////////////////////////////////////////////////////////////////////
     223//                      COMPUTING the G's                                 //
     224////////////////////////////////////////////////////////////////////////////
     225
     226
     227proc 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(b-1);
     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
     259proc 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..b-1);
     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,b-1,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
     299proc 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 t-coeff. 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 t-coeff.
     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<=k-v;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
    215344
    216345////////////////////////////////////////////////////////////////////////////
     
    247376
    248377
    249 proc idealsimplify (ideal I)
    250 {
    251   int i,j;
     378proc 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!
    252381  int divisornumber=0;
    253382  int pos;
     
    276405
    277406
    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
     409proc modd (poly f, poly g)      // the modulo-operation for polys
    299410{
    300411  poly result=f-(f/g)*g;
Note: See TracChangeset for help on using the changeset viewer.