Changeset a4f5ce in git


Ignore:
Timestamp:
Feb 9, 2005, 8:06:35 PM (18 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '7725b5cfc1eaf99630826ecc59f559d3b6831c24')
Children:
33d87254b9d1883fe8b32ec87df6614827559310
Parents:
6582b896a376689038f2f0222fceeac87b3c7075
Message:
*levandov: genericity rwritten, descriptions for it and canonize added


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/control.lib

    r6582b8 ra4f5ce  
    1 version="$Id: control.lib,v 1.19 2004-12-22 18:03:16 levandov Exp $";
     1version="$Id: control.lib,v 1.20 2005-02-09 19:06:35 levandov Exp $";
    22category="Applications";
    33info="
     
    1616autonom(module R);            analysis of autonomy-related properties of R (using Ext modules),
    1717autonom2(module R);           analysis of autonomy-related properties of R (using dimension),
     18
    1819LeftKernel(module R);         a left kernel of R,
    1920RightKernel(module R);        a right kernel of R,
    2021LeftInverse(module R)         a left inverse of matrix (module),
    2122
    22 smith(module M);              a Smith form of a module M.
     23smith(module M);              a Smith form of a module M,
     24
     25genericity(module M);         analysis of the genericity of parameters,
     26
     27canonize(list L);             Groebnerification for modules in the output of control/autonomy procs.
    2328
    2429AUXILIARY PROCEDURES:
    2530declare(string NameOfRing, Variables[,string  Parameters, Ordering]);     defines the ring, optional parametes are strings of parameters and ordering,
    26 view();                      Well-formatted output of lists, modules and matrixes
     31view();                      Well-formatted output of lists, modules and matrices
    2732
    2833NOTE (EXAMPLES): In order to use examples below, execute the commands
     
    774779
    775780proc genericity(matrix M)
    776 "USAGE:  genericity(M), M is a matrix
     781"USAGE:  genericity(M), M is a module/matrix
    777782RETURN:  list of strings with expressions, which have been assumed to be non-zero in the process of computing the Groebner basis
    778 NOTE:  effective with the liftstd procedure for modules with parameters
     783NOTE: we strongly recommend to switch on the redSB and redTail options;
     784the procedure is effective with the lift procedure for modules with parameters
     785EXAMPLE:  example genericity; shows an example
    779786"
    780787{
    781788  // M is a matrix over a ring with params and vars;
    782789  ideal I = ideal(M); // a list of entries
    783   I = simplify(I,2); // throw 0's away
    784   // decompose every coeff
    785   int i; int  cl=1;
     790  I = simplify(I,2); // delete 0's
     791  // decompose every coeff in every poly
     792  int i;
    786793  int s = size(I);
    787   list NM;
     794  ideal NM;
    788795  poly p;
     796  number num;
     797  int  cl=1;
     798  intvec ZeroVec; ZeroVec[nvars(basering)] = 0;
     799  intvec W;
    789800  for (i=1; i<=s; i++)
    790801  {
    791     p = I[i];
     802    // remove contents and add them as polys
     803    p   = I[i];
     804    W   = leadexp(p);
     805    if (W == ZeroVec) // i.e. just a coef
     806    {
     807      num    = denominator(leadcoef(p)); // from poly.lib
     808      p      = p*num;
     809      NM[cl] = p;
     810      cl++;
     811      NM[cl] = num;
     812      cl++;
     813      p = p - lead(p); // for the next cycle
     814    }     
     815    if ( p!= 0)
     816    {
     817      num = content(p);
     818      p   = p/num;
     819      NM[cl] = denominator(num);
     820      cl++;
     821      NM[cl] = numerator(num);
     822      cl++;
     823    }
    792824    while( p != 0)
    793825    {
    794       NM[cl] = leadcoef(p);
     826      NM[cl] = leadcoef(p); // should be all integer
    795827      cl++;
    796828      p = p - lead(p);
    797     };
    798   };
     829    }
     830  }
     831  NM = simplify(NM,4); // delete identical
    799832  string newvars = parstr(basering);
    800833  def save = basering;
     
    803836  // get params as variables
    804837  // create a list of non-monomials
    805   ideal L;
     838  ideal @L;
    806839  ideal F;
    807   list NM = imap(save,NM);
     840  ideal NM = imap(save,NM);
     841  NM = simplify(NM,8); //delete multiples
    808842  poly p,q;
    809843  cl = 1;
     
    824858        if (q!=0)
    825859        {
    826           L[cl] = F[j];
     860          @L[cl] = F[j];
    827861          cl++;
    828862        }
     
    831865  }
    832866  // return the result [in string-format]
    833   L = simplify(L,2+4); // skip zeroes and double entries
     867  @L = simplify(@L,2+4); // skip zeroes and double entries
    834868  list SL;
    835   for (j=1; j<=size(L);j++)
    836   {
    837     SL[j] = string(L[j]);
     869  for (j=1; j<=size(@L);j++)
     870  {
     871    SL[j] = string(@L[j]);
    838872  }
    839873  setring save;
     
    849883    [0, m2*L2^2*Dt^2-m2*L2*g, 0, m2*L2*Dt^2];
    850884  module R = transpose(RR);
    851   matrix T;
    852   module SR = liftstd(R,T);
     885  module SR = std(R);
     886  matrix T = lift(R,SR);
    853887  genericity(T);
    854   //-- The result is different when computing reduced bases:
     888  //-- The result might be different when computing reduced bases:
    855889  matrix T2;
    856890  option(redSB);
    857891  option(redTail);
    858   module SR2 = liftstd(R,T2);
     892  module SR2 = std(R);
     893  T2 =  lift(R,SR2);
    859894  genericity(T2);
    860895}
     
    862897proc canonize(list L)
    863898"USAGE:  canonize(L), L a list
    864 ASSUME:  L is the output of control/autonomy procs
     899ASSUME:  L is the output of control/autonomy procedures
    865900RETURN:  a canonized list, where modules are canonized by computing
    866 their reduced minimal Groebner bases
     901their reduced minimal (= unique in the given ordering) Groebner bases
     902EXAMPLE:  example canonize; shows an example
    867903"
    868904{
Note: See TracChangeset for help on using the changeset viewer.