Changeset aa6e78 in git for Singular/LIB


Ignore:
Timestamp:
Jun 18, 1998, 5:45:12 PM (26 years ago)
Author:
Thomas Siebert <siebert@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
bb43f0aa847d97cd59414a2365f67f49a9e8fbd2
Parents:
b3f0b1d84137a0d2ee8fdbd54d767206eb008dcd
Message:
*** empty log message ***


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/standard.lib

    rb3f0b1 raa6e78  
    1 // $Id: standard.lib,v 1.19 1998-06-12 09:33:33 obachman Exp $
     1// $Id: standard.lib,v 1.20 1998-06-18 15:45:12 siebert Exp $
    22//////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: standard.lib,v 1.19 1998-06-12 09:33:33 obachman Exp $";
     4version="$Id: standard.lib,v 1.20 1998-06-18 15:45:12 siebert Exp $";
    55info="
    66LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
     
    1010 groebner(ideal/module) standard basis of ideal or module using a
    1111                        heuristically choosen method
     12 quotient(any,any[,n])  a general quotient procedure calling several algorithms
     13                  allows module/module, ideal/ideal, module/ideal and a
     14                  pre-definition of the algorithm by the parameter n
     15 quotient1(m1,m2) computes quotients by every vector of m2 and intersects them
     16 quotient2(m1,m2) a heuristic variant: the quotient is just defined by a
     17                  (not really) general element of m2 which has to be proved
     18 quotient3(m1,m2) the homogeneous variant of quotient5(m1,m2)
     19 quotient4(m1,m2) the same as quotient5(m1,m2) using the modulo-command
     20                  instead of the quotient-command from the kernel
     21 quotient5(m1,m2) computes with a real general element of m2 by adjoining
     22                  a new variable
    1223";
    1324
     
    449460}
    450461
     462proc quotient (any m1,any m2,list L)
     463USAGE:   quotient(m1, m2[, n]); m1, m2 two submodules of k^s,
     464         n (optional) integer (1<= n <=5)
     465RETURN:  the quotient of m1 and m2
     466EXAMPLE: example quot; shows an example
     467{
     468  if (((typeof(m1)!="ideal") and (typeof(m1)!="module"))
     469     or ((typeof(m2)!="ideal") and (typeof(m2)!="module")))
     470  {
     471    "USAGE:   quot(m1, m2[, n]); m1, m2 two submodules of k^s,";
     472    "         n (optional) integer (1<= n <=5)";
     473    "RETURN:  the quotient of m1 and m2";
     474    "EXAMPLE: example quot; shows an example";
     475    return();
     476  }
     477  if (typeof(m1)!=typeof(m2))
     478  {
     479    return quot(m1,m2);
     480  }
     481  if (size(L)>0)
     482  {
     483    if (typeof(L[1])=="int" )
     484    {
     485      return quot1(m1,m2,L[1]);
     486    }
     487  }
     488  else
     489  {
     490    return quot1(m1,m2,2);
     491  }
     492}
     493example
     494{ "EXAMPLE:"; echo = 2;
     495  ring r=181,(x,y,z),(c,ls);
     496  ideal id1=maxideal(4);
     497  ideal id2=x2+xyz,y2-z3y,z3+y5xz;
     498  option(prot);
     499  ideal id6=quot(id1,id2);
     500  id6;
     501  ideal id7=quotient(id1,id2,1);
     502  id7;
     503  ideal id8=quotient(id1,id2,2);
     504  id8;
     505}
     506
     507static proc quot1 (module m1, module m2,int n)
     508USAGE:   quot1(m1, m2, n); m1, m2 two submodules of k^s,
     509         n integer (1<= n <=5)
     510RETURN:  the quotient of m1 and m2
     511EXAMPLE: example quot; shows an example
     512{
     513  if (n==1)
     514  {
     515    return(quotient1(m1,m2));
     516  }
     517  else
     518  {   
     519    if (n==2)
     520    {
     521      return(quotient2(m1,m2));
     522    }
     523    else
     524    {
     525      if (n==3)
     526      {
     527        return(quotient3(m1,m2));
     528      }
     529      else
     530      {
     531        if (n==4)
     532        {
     533          return(quotient4(m1,m2));
     534        }
     535        else
     536        {
     537          if (n==5)
     538          {
     539            return(quotient5(m1,m2));
     540          }
     541          else
     542          {
     543            return(quotient(m1,m2));
     544          }
     545        }
     546      }
     547    }
     548  }
     549}
     550example
     551{ "EXAMPLE:"; echo = 2;
     552  ring r=181,(x,y,z),(c,ls);
     553  ideal id1=maxideal(4);
     554  ideal id2=x2+xyz,y2-z3y,z3+y5xz;
     555  option(prot);
     556  ideal id6=quot(id1,id2);
     557  id6;
     558  ideal id7=quot1(id1,id2,1);
     559  id7;
     560  ideal id8=quot1(id1,id2,2);
     561  id8;
     562}
     563
     564static proc quotient0(module a,module b)
     565{
     566  module mm=b+a;
     567  resolution rs=system("LaScala",mm);
     568  list I=list(rs);
     569  matrix M=I[2];
     570  matrix A[1][nrows(M)]=M[1..nrows(M),1];
     571  ideal i=A;
     572  return (i);
     573}
     574proc quotient1(module a,module b)  //17sec
     575USAGE:   quotient1(m1, m2); m1, m2 two submodules of k^s,
     576RETURN:  the quotient of m1 and m2
     577{
     578  int i;
     579  a=std(a);
     580  module dummy;
     581  module B=NF(b,a)+dummy;
     582  ideal re=quot(a,module(B[1]));
     583  for(i=2;i<=size(B);i++)
     584  {
     585     re=intersect1(re,quot(a,module(B[i])));
     586  }
     587  return(re);   
     588}
     589proc quotient2(module a,module b)    //13sec
     590USAGE:   quotient2(m1, m2); m1, m2 two submodules of k^s,
     591RETURN:  the quotient of m1 and m2
     592{
     593  a=std(a);
     594  module dummy;
     595  module bb=NF(b,a)+dummy;
     596  int i=size(bb);
     597  ideal re=(quot(a,module(bb[i])));
     598  bb[i]=0;
     599  module temp;
     600  module temp1;
     601  module bbb;
     602  int mx;
     603  i=i-1;
     604  while (1)
     605  {
     606    if (i==0) break;
     607    temp = a+bb*re;
     608    temp1 = lead(interred(temp));
     609    mx=ncols(a);
     610    if (ncols(temp1)>ncols(a))
     611    {
     612      mx=ncols(temp1);
     613    }
     614    temp1 = matrix(temp1,1,mx)-matrix(lead(a),1,mx);
     615    temp1 = dummy+temp1;
     616    if (deg(temp1[1])<0) break;
     617    re=(intersect1(re,quot(a,module(bb[i]))));
     618    bb[i]=0;
     619    i = i-1;
     620  }
     621  return(re);   
     622}
     623proc quotient3(module a,module b)   //89sec
     624USAGE:   quotient3(m1, m2); m1, m2 two submodules of k^s,
     625         only for global rings
     626RETURN:  the quotient of m1 and m2
     627{
     628  string s="ring @newr=("+charstr(basering)+
     629           "),("+varstr(basering)+",@t,@w),dp;";
     630  def @newP=basering;
     631  execute s;
     632  module b=imap(@newP,b);
     633  module a=imap(@newP,a);
     634  int i;
     635  int j=size(b);
     636  vector @b;
     637  for(i=1;i<=j;i++)
     638  {
     639     @b=@b+@t^(i-1)*@w^(j-i+1)*b[i];
     640  }
     641  ideal re=quot(a,module(@b));
     642  setring @newP;
     643  ideal re=imap(@newr,re);
     644  return(re);   
     645}
     646proc quotient5(module a,module b)   //89sec
     647USAGE:   quotient5(m1, m2); m1, m2 two submodules of k^s,
     648         only for global rings
     649RETURN:  the quotient of m1 and m2
     650{
     651  string s="ring @newr=("+charstr(basering)+
     652           "),("+varstr(basering)+",@t),dp;";
     653  def @newP=basering;
     654  execute s;
     655  module b=imap(@newP,b);
     656  module a=imap(@newP,a);
     657  int i;
     658  int j=size(b);
     659  vector @b;
     660  for(i=1;i<=j;i++)
     661  {
     662     @b=@b+@t^(i-1)*b[i];
     663  }
     664  @b=homog(@b,@w);
     665  ideal re=quot(a,module(@b));
     666  setring @newP;
     667  ideal re=imap(@newr,re);
     668  return(re);   
     669}
     670proc quotient4(module a,module b)   //95sec
     671USAGE:   quotient4(m1, m2); m1, m2 two submodules of k^s,
     672         only for global rings
     673RETURN:  the quotient of m1 and m2
     674{
     675  string s="ring @newr=("+charstr(basering)+
     676           "),("+varstr(basering)+",@t),dp;";
     677  def @newP=basering;
     678  execute s;
     679  module b=imap(@newP,b);
     680  module a=imap(@newP,a);
     681  int i;
     682  vector @b=b[1];
     683  for(i=2;i<=size(b);i++)
     684  {
     685     @b=@b+@t^(i-1)*b[i];
     686  }
     687  matrix sy=modulo(@b,a);
     688  ideal re=sy;
     689  setring @newP;
     690  ideal re=imap(@newr,re);
     691  return(re);   
     692}
     693static proc intersect1(ideal i,ideal j)
     694{
     695  def R=basering;
     696  execute "ring gnir = ("+charstr(basering)+"),
     697                       ("+varstr(basering)+",@t),(C,dp);";
     698  ideal i=var(nvars(basering))*imap(R,i)+(var(nvars(basering))-1)*imap(R,j);
     699  ideal j=eliminate(i,var(nvars(basering)));
     700  setring R;
     701  map phi=gnir,maxideal(1);
     702  return(phi(j));
     703}
     704 
    451705/*
    452706proc minres(list #)
Note: See TracChangeset for help on using the changeset viewer.