Changeset 1593911 in git


Ignore:
Timestamp:
Aug 16, 2019, 2:41:16 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
c8b65d77e75cfce24c257822df19be0d1113e110
Parents:
61805653a98bcb59b2ce76a4d538b2fb05459e28d9e5b0a9e2ca74ac8fcf60a83f008cc393d9278d
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2019-08-16 14:41:16+02:00
git-committer:
GitHub <noreply@github.com>2019-08-16 14:41:16+02:00
Message:
Merge pull request #948 from kabouzeid/stable

lpGkDim in dynamic module
Files:
6 added
10 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpaprops.lib

    r6180565 r1593911  
    2626  lpIsSemiPrime(<GB>);    check whether A/<LM(GB)> is semi-prime
    2727  lpIsPrime(<GB>);        check whether A/<LM(GB)> is prime
    28   lpGkDim(<GB>);          compute the Gelfand Kirillov dimension of A/<GB>
    2928  lpGlDimBound(<GB>);     compute an upper bound for the global dimension of A/<GB>
    3029  lpSubstitute();         substitute a variable with polynomials (ring homomorphism)
     
    4342    example lpIsSemiPrime;
    4443    example lpIsPrime;
    45     example lpGkDim;
    4644    example lpGlDimBound;
    4745    example lpSubstitute;
     
    877875}
    878876
    879 proc lpGkDim(ideal G)
    880 "USAGE: lpGkDim(G); G an ideal in a letterplace ring
    881 RETURN: int
    882 PURPOSE: Determines the Gelfand Kirillov dimension of A/<G>
    883        -1 means positive infinite
    884 ASSUME: - basering is a Letterplace ring
    885       - G is a Groebner basis
    886 "
    887 {
    888   G = lead(G);
    889   G = simplify(G, 2+4+8);
    890 
    891   // check special case 1
    892   int l = 0;
    893   for (int i = 1; i <= size(G); i++) {
    894     // find the max degree in G
    895     int d = deg(G[i]);
    896     if (d > l) {
    897       l = d;
    898     }
    899 
    900     // also if G is the whole ring return minus infinity
    901     if (leadmonom(G[i]) == 1) {
    902       ERROR("GK-Dim not defined for 0-ring")
    903     }
    904     kill d;
    905   } kill i;
    906   // if longest word has length 1, or G is the zero ideal, we handle it as a special case
    907   if (l == 1 || size(G) == 0) {
    908     int n = lpVarBlockSize(basering); // variable count
    909     int k = size(G);
    910     if (k == n) { // V = {1} no edges
    911       return(0);
    912     }
    913     if (k == n-1) { // V = {1} with loop
    914       return(1);
    915     }
    916     if (k <= n-2) { // V = {1} with more than one loop
    917       return(-1);
    918     }
    919   }
    920 
    921   dbprint("computing Ufnarovskii graph");
    922   intmat UG = lpUfGraph(G);
    923   if (printlevel >= voice + 1) {
    924     UG;
    925   }
    926 
    927   // check special case 2
    928   intmat zero[nrows(UG)][ncols(UG)];
    929   if (UG == zero) {
    930     return (0);
    931   }
    932 
    933   // check special case 3
    934   dbprint("topological sorting of Ufnarovskii graph");
    935   UG = topologicalSort(UG);
    936   if (printlevel >= voice + 1) {
    937     UG;
    938   }
    939 
    940   dbprint("check if Ufnarovskii graph is DAG");
    941   if (imIsUpRightTriangle(UG)) {
    942     UG = eliminateZerosUpTriangle(UG);
    943     if (ncols(UG) == 0 || nrows(UG) == 0) { // when the diagonal was zero
    944       return (0)
    945     }
    946     dbprint("DAG detected, using URTNZD growth alg");
    947     return(UfGraphURTNZDGrowth(UG));
    948   }
    949 
    950   // otherwise count cycles in the Ufnarovskij Graph
    951   dbprint("not a DAG, using regular growth alg");
    952   return(UfGraphGrowth(UG));
    953 }
    954 example
    955 {
    956   "EXAMPLE:"; echo = 2;
    957   ring r = 0,(x,y,z),dp;
    958   def R = freeAlgebra(r, 5); // constructs a Letterplace ring
    959   R;
    960   setring R; // sets basering to Letterplace ring
    961   ideal I = z;//an example of infinite GK dimension
    962   lpGkDim(I);
    963   I = x,y,z; // gkDim = 0
    964   lpGkDim(I);
    965   I = x*y, x*z, z*y, z*z;//gkDim = 2
    966   lpGkDim(I);
    967   ideal G = y*x - x*y, z*x - x*z, z*y - y*z; G = std(G);
    968   G;
    969   lpGkDim(G); // 3, as expected for K[x,y,z]
    970 }
     877// lpGkDim now implemented in dynamic module
     878/* proc lpGkDim(ideal G) */
     879/* "USAGE: lpGkDim(G); G an ideal in a letterplace ring */
     880/* RETURN: int */
     881/* PURPOSE: Determines the Gelfand Kirillov dimension of A/<G> */
     882/*        -1 means positive infinite */
     883/* ASSUME: - basering is a Letterplace ring */
     884/*       - G is a Groebner basis */
     885/* " */
     886/* { */
     887/*   G = lead(G); */
     888/*   G = simplify(G, 2+4+8); */
     889
     890/*   // check special case 1 */
     891/*   int l = 0; */
     892/*   for (int i = 1; i <= size(G); i++) { */
     893/*     // find the max degree in G */
     894/*     int d = deg(G[i]); */
     895/*     if (d > l) { */
     896/*       l = d; */
     897/*     } */
     898
     899/*     // also if G is the whole ring return minus infinity */
     900/*     if (leadmonom(G[i]) == 1) { */
     901/*       ERROR("GK-Dim not defined for 0-ring") */
     902/*     } */
     903/*     kill d; */
     904/*   } kill i; */
     905/*   // if longest word has length 1, or G is the zero ideal, we handle it as a special case */
     906/*   if (l == 1 || size(G) == 0) { */
     907/*     int n = lpVarBlockSize(basering); // variable count */
     908/*     int k = size(G); */
     909/*     if (k == n) { // V = {1} no edges */
     910/*       return(0); */
     911/*     } */
     912/*     if (k == n-1) { // V = {1} with loop */
     913/*       return(1); */
     914/*     } */
     915/*     if (k <= n-2) { // V = {1} with more than one loop */
     916/*       return(-1); */
     917/*     } */
     918/*   } */
     919
     920/*   dbprint("computing Ufnarovskii graph"); */
     921/*   intmat UG = lpUfGraph(G); */
     922/*   if (printlevel >= voice + 1) { */
     923/*     UG; */
     924/*   } */
     925
     926/*   // check special case 2 */
     927/*   intmat zero[nrows(UG)][ncols(UG)]; */
     928/*   if (UG == zero) { */
     929/*     return (0); */
     930/*   } */
     931
     932/*   // check special case 3 */
     933/*   dbprint("topological sorting of Ufnarovskii graph"); */
     934/*   UG = topologicalSort(UG); */
     935/*   if (printlevel >= voice + 1) { */
     936/*     UG; */
     937/*   } */
     938
     939/*   dbprint("check if Ufnarovskii graph is DAG"); */
     940/*   if (imIsUpRightTriangle(UG)) { */
     941/*     UG = eliminateZerosUpTriangle(UG); */
     942/*     if (ncols(UG) == 0 || nrows(UG) == 0) { // when the diagonal was zero */
     943/*       return (0) */
     944/*     } */
     945/*     dbprint("DAG detected, using URTNZD growth alg"); */
     946/*     return(UfGraphURTNZDGrowth(UG)); */
     947/*   } */
     948
     949/*   // otherwise count cycles in the Ufnarovskij Graph */
     950/*   dbprint("not a DAG, using regular growth alg"); */
     951/*   return(UfGraphGrowth(UG)); */
     952/* } */
     953/* example */
     954/* { */
     955/*   "EXAMPLE:"; echo = 2; */
     956/*   ring r = 0,(x,y,z),dp; */
     957/*   def R = freeAlgebra(r, 5); // constructs a Letterplace ring */
     958/*   R; */
     959/*   setring R; // sets basering to Letterplace ring */
     960/*   ideal I = z;//an example of infinite GK dimension */
     961/*   lpGkDim(I); */
     962/*   I = x,y,z; // gkDim = 0 */
     963/*   lpGkDim(I); */
     964/*   I = x*y, x*z, z*y, z*z;//gkDim = 2 */
     965/*   lpGkDim(I); */
     966/*   ideal G = y*x - x*y, z*x - x*z, z*y - y*z; G = std(G); */
     967/*   G; */
     968/*   lpGkDim(G); // 3, as expected for K[x,y,z] */
     969/* } */
    971970
    972971proc lpGlDimBound(ideal G)
  • Singular/LIB/tropical.lib

    rd9e5b0 r1593911  
    338338  // we change to a ring where the variables have names t and x(1),...,x(n)
    339339  def ALTERRING=basering;
     340  list RL=ringlist(ALTERRING);
    340341  if (nvars(basering)==2)
    341342  {
    342     execute("ring BASERING=("+charstr(ALTERRING)+"),(t,x(1)),("+ordstr(ALTERRING)+");");
     343    RL[2]=list("t","x(1)");
     344    ring BASERING = ring(RL);
    343345  }
    344346  else
    345347  {
    346     execute("ring BASERING=("+charstr(ALTERRING)+"),(t,x(1.."+string(nvars(ALTERRING)-1)+")),("+ordstr(ALTERRING)+");");
     348    list V = "t";
     349    for (int ii = nvars(ALTERRING)-1; ii > 0; ii--)
     350    {
     351      V[ii+1] = "x("+string(ii)+")";
     352    }
     353    RL[2]=V;
     354    ring BASERING = ring(RL);
    347355  }
    348356  map altphi=ALTERRING,maxideal(1);
     
    466474  // for this, unfortunately, t has to be the last variable !!!
    467475  ideal variablen;
     476  list RL=ringlist(basering);
    468477  for (j=2;j<=nvars(basering);j++)
    469478  {
    470479    variablen=variablen+var(j);
    471   }
    472   execute("ring GRUNDRING=("+charstr(basering)+"),("+string(variablen)+",t),(dp("+string(nvars(basering)-1)+"),lp(1));");
     480    RL[2][j-1]=RL[2][j];
     481  }
     482  RL[2][size(RL[2])]="t";
     483  RL[3]=list(list("dp",1:(nvars(basering)-1)),list("lp",1));
     484  ring GRUNDRING = ring(RL);
     485  list RL=ringlist(GRUNDRING);
     486  list VARIABLEN;
    473487  ideal variablen;
    474488  for (j=1;j<=nvars(basering)-1;j++)
    475489  {
    476490    variablen=variablen+var(j);
     491    VARIABLEN[j]=RL[2][j];
    477492  }
    478493  map GRUNDPHI=BASERING,t,variablen;
     
    497512  if (iszerodim==0) // do so only if is_dim_zero is not set
    498513  {
    499     execute("ring QUOTRING=("+charstr(basering)+",t),("+string(variablen)+"),dp;");
     514    RL=ringlist(basering);
     515    RL[1]=list(RL[1],list("t"),list(list("lp",1)),ideal(0));
     516    RL[2]=VARIABLEN;
     517    RL[3]=list(list("dp",1:size(VARIABLEN)));
     518    ring QUOTRING = ring(RL);
    500519    ideal i=groebner(imap(GRUNDRING,i));
    501520    int dd=dim(i);
     
    573592        // from LIFTRING are present,
    574593        // and where also the variables of CUTDOWNRING live
    575         execute("ring REPLACEMENTRING=("+charstr(LIFTRING)+"),("+varstr(CUTDOWNRING)+"),dp;");
     594        list RL=ringlist(LIFTRING);
     595        list RL2=ringlist(CUTDOWNRING);
     596        RL[2]=RL2[2];
     597        RL[3]=list(list("dp",1:nvars(CUTDOWNRING)));
     598        ring REPLACEMENTRING = ring(RL);
    576599        list repl=imap(CUTDOWNRING,repl); // get the replacement rules
    577600                                          // from CUTDOWNRING
     
    10691092      poly mp=minpoly;
    10701093      def OLDRING=basering;
    1071       execute("ring NEWRING=0,("+varstr(basering)+","+parstr(basering)+"),ds;");
     1094      list RL=ringlist(OLDRING);
     1095      RL[2]=RL[2]+RL[1][2];
     1096      RL[1]=RL[1][1];
     1097      RL[3]=list(list("ds",1:size(RL[2])));
     1098      ring NEWRING=ring(RL);
    10721099      ideal I=imap(OLDRING,mp),imap(OLDRING,f);
    10731100    }
     
    17171744    {
    17181745      string polynomstring=string(f);
    1719       execute("ring drawring=(0,"+parstr(basering)+"),("+varstr(basering)+"),dp;");
     1746      list RL=ringlist(basering);
     1747      RL[1][1]=0;
     1748      RL[3]=list(list("dp",1:nvars(basering)));
     1749      ring drawring = ring(RL);
    17201750      execute("poly f="+polynomstring+";");
    17211751    }
     
    26372667  // THIS IS NOT DOCUMENTED FOR THE GENERAL USER!!!!
    26382668  def BASERING=basering;
     2669  list RL=ringlist(BASERING);
     2670  list VARIABLEN;
    26392671  int j;
    26402672  if (size(#)>0)
     
    26422674    // we first have to move the variable t to the front again
    26432675    ideal variablen=var(nvars(basering));
     2676    VARIABLEN[1]=RL[2][nvars(basering)];
    26442677    for (j=1;j<nvars(basering);j++)
    26452678    {
    26462679      variablen=variablen+var(j);
     2680      VARIABLEN[j+1]=RL[2][j];
    26472681    }
    26482682  }
     
    26502684  {
    26512685    ideal variablen=maxideal(1);
     2686    VARIABLEN=RL[2];
    26522687  }
    26532688  // we want to homogenise the ideal i ....
    2654   execute("ring HOMOGRING=("+charstr(basering)+"),(@s,"+string(variablen)+"),dp;");
     2689  RL=ringlist(basering);
     2690  RL[2]=list("@s")+RL[2];
     2691  RL[3]=list(list("dp",1:size(RL[2])));
     2692  ring HOMOGRING = ring(RL);
    26552693  ideal i=homog(std(imap(BASERING,i)),@s);
    26562694  // ... and compute a standard basis with
     
    26672705  }
    26682706  intmat O=weightVectorToOrderMatrix(whomog);
    2669   execute("ring WEIGHTRING=("+charstr(basering)+"),("+varstr(basering)+"),(M("+string(O)+"));");
     2707  list RL=ringlist(basering);
     2708  RL[3]=list(list("M",O));
     2709  ring WEIGHTRING = ring(RL);
    26702710  // map i to the new ring and compute a GB of i, then dehomogenise i,
    26712711  // so that we can be sure, that the
     
    26742714  // compute the w-initial ideal with the help of the procedure tInitialForm;
    26752715  setring BASERING;
    2676   execute("ring COMPINIRING=("+charstr(basering)+"),("+string(variablen)+"),dp;");
     2716  RL[2]=VARIABLEN;
     2717  RL[3]=list(list("dp",1:size(VARIABLEN)));
     2718  ring COMPINIRING = ring(RL);
    26772719  ideal i=imap(WEIGHTRING,i);
    26782720  ideal ini;
     
    27112753  def BASERING=basering;
    27122754  intmat O=weightVectorToOrderMatrix(w);
    2713   execute("ring INITIALRING=("+charstr(BASERING)+"),("+varstr(basering)+"),M("+string(O)+");");
     2755  list RL=ringlist(basering);
     2756  RL[3]=list(list("M",O));
     2757  ring INITIALRING = ring(RL);
    27142758  poly f=imap(BASERING,f);
    27152759  int GRAD=deg(f);
     
    27842828  def BASERING=basering;
    27852829  intmat O=weightVectorToOrderMatrix(w);
    2786   execute("ring INITIALRING=("+charstr(BASERING)+"),("+varstr(basering)+"),M("+string(O)+");");
     2830  list RL=ringlist(BASERING);
     2831  RL[3]=list(list("M",O));
     2832  ring INITIALRING = ring(RL);
    27872833  ideal i=imap(BASERING,i);
    27882834  i=std(i);
     
    28342880  }
    28352881  def BASERING=basering;
    2836   execute("ring PARAMETERRING=("+string(char(basering))+"),("+parstr(basering)+"),ds;");
     2882  ring PARAMETERRING = create_ring("("+string(char(basering))+")", "("+parstr(basering)+")", "ds");
    28372883  poly den=imap(BASERING,den);
    28382884  poly num=imap(BASERING,num);
     
    34933539{
    34943540  def BASERING=basering;
    3495   execute("ring RADRING=("+charstr(basering)+"),(@T,"+varstr(basering)+"),(dp(1),"+ordstr(basering)+");");
     3541  list RL=ringlist(BASERING);
     3542  RL[2]=list("@T")+RL[2];
     3543  RL[3]=list(list("dp",1:1))+RL[3];
     3544  ring RADRING = ring(RL);
    34963545  ideal I=ideal(imap(BASERING,i))+ideal(1-@T*imap(BASERING,f));
    34973546  if (reduce(1,std(I))==0)
     
    36443693  CHARAKTERISTIK=CHARAKTERISTIK[1..size(CHARAKTERISTIK)-2];
    36453694  def BASERING=basering;
    3646   execute("ring INITIALRING=("+CHARAKTERISTIK+"),("+varstr(basering)+"),("+ordstr(basering)+");");
     3695  ring INITIALRING = create_ring("("+CHARAKTERISTIK+")", "("+varstr(basering)+")", "("+ordstr(basering)+")");
    36473696  list l=solve(imap(BASERING,i));
    36483697  l;
     
    39524001  }
    39534002  def BASERING=basering;
    3954   execute("ring QUOTRING=("+charstr(basering)+",t),("+string(variablen)+"),dp;");
     4003  ring QUOTRING = create_ring("("+charstr(basering)+",t)", "("+string(variablen)+")", "dp");
    39554004  ideal i=subst(imap(BASERING,i),var(j-1),t^(-wj)*var(j-1));
    39564005  for (k=1;k<=size(i);k++)
     
    40074056  list erglini;
    40084057  list ergl;
     4058  list VARIABLEN;
     4059  list RL=ringlist(BASERING);
    40094060  for (j1=1;j1<=nvars(basering)-1;j1++)
    40104061  {
     
    40134064    product=product*var(j1); // make product of all variables
    40144065                             // (needed for the initial-monomial-check later
    4015   }
    4016   execute("ring QUOTRING=("+charstr(basering)+",t),("+string(variablen)+"),dp;");
     4066    VARIABLEN[j1]=RL[2][j1];
     4067  }
     4068  RL[1]=list(RL[1],list("t"),list(list("lp",1:1)),ideal(0));
     4069  RL[2]=VARIABLEN;
     4070  RL[3]=list(list("dp",1:size(VARIABLEN)));
     4071  ring QUOTRING = ring(RL);
    40174072  setring BASERING;
    40184073  // change to quotring where we want to compute the primary decomposition of i
     
    42014256        variablen=0;
    42024257        j2=0;
     4258        VARIABLEN=list();
    42034259        for(j1=1;j1<=nvars(basering)-1;j1++)
    42044260        {
     
    42144270            variablen=variablen+var(j1); // read the set of remaining variables
    42154271                                         // (needed to make quotring later)
     4272            VARIABLEN=VARIABLEN+list(RL[2][j1]);
    42164273          }
    42174274        }
    42184275        // return pideal, the initial and the list ergl which tells us
    42194276        // which variables we replaced by which form
    4220         execute("ring BASERINGLESS1=("+charstr(BASERING)+"),("+string(variablen)+",t),(dp("+string(ncols(variablen))+"),lp(1));");
     4277        RL=ringlist(BASERING);
     4278        RL[2]=VARIABLEN+list("t");
     4279        RL[3]=list(list("dp",1:size(VARIABLEN)),list("lp",1:1));
     4280        ring BASERINGLESS1 = ring(RL);
    42214281        ideal i=imap(BASERING,pideal);
    42224282        ideal ini=imap(BASERING,pini); //ideal ini2=tInitialIdeal(i,wvecp,1);
     
    42954355  }
    42964356  setring BASERING;
    4297   execute("ring BASERINGLESS2=("+charstr(BASERING)+"),("+string(variablen)+",t),(dp("+string(ncols(variablen))+"),lp(1));");
     4357  ring BASERINGLESS2 = create_ring(ringlist(BASERING)[1], "("+string(variablen)+",t)", "(dp("+string(ncols(variablen))+"),lp(1))", "no_minpoly");
    42984358  // using the 0/1-vector which tells us which variables belong
    42994359  // to the set of smallest entries of wvec
     
    46434703  if ((numberdeletedvariables>0) and (anzahlvariablen>1)) // if only t remains,
    46444704  { // all true variables are gone
    4645     execute("ring NEURING=("+charstr(basering)+"),("+string(variablen)+"),(dp("+string(size(variablen)-1)+"),lp(1));");
     4705    ring NEURING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "(dp("+string(size(variablen)-1)+"),lp(1))", "no_minpoly");
    46464706    ideal i=imap(BASERING,i);
    46474707    ideal gesamt_m=imap(BASERING,gesamt_m);
     
    46594719    {
    46604720      // pass to a ring which has variables which are suitable for gfan
    4661       execute("ring GFANRING=("+charstr(basering)+"),(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),dp;");
     4721      ring GFANRING = create_ring(ringlist(basering)[1], "(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z)", "dp", "no_minpoly");
    46624722      ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;
    46634723      phiideal[nvars(PREGFANRING)]=a; // map t to a
     
    48294889    else
    48304890    {
    4831       execute("ring PARARing=("+charstr(basering)+"),t,ls;");
     4891      ring PARARing = create_ring(ringlist(basering)[1], "t", "ls", "no_minpoly");
    48324892    }
    48334893    ideal PARA; // will contain the parametrisation
     
    49174977    variablen=variablen+var(j);
    49184978  }
    4919   execute("ring INITIALRING=("+charstr(basering)+"),("+string(variablen)+"),dp;");
     4979  ring INITIALRING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "dp", "no_minpoly");
    49204980  ideal ini=imap(BASERING,ini);
    49214981  // compute the associated primes of the initialideal
     
    51605220  if (anzahlvariablen<nvars(basering))
    51615221  {
    5162     execute("ring TINRING=("+charstr(basering)+","+string(Parameter)+"),("+string(variablen)+"),dp;");
     5222    ring TINRING = create_ring("("+charstr(basering)+","+string(Parameter)+")", "("+string(variablen)+")", "dp");
    51635223  }
    51645224  else
    51655225  {
    5166     execute("ring TINRING=("+charstr(basering)+"),("+string(variablen)+"),dp;");
     5226    ring TINRING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "dp", "no_minpoly");
    51675227  }
    51685228  ideal tin=imap(BASERING,tin);
     
    51855245  string PMet=string(par(1));
    51865246  def BASERING=basering;
    5187   execute("ring r=0,"+PMet+",ls;");
     5247  ring r = create_ring(0, PMet, "ls");
    51885248  execute("poly denomi="+denom+";");
    51895249  execute("poly numer="+num+";");
     
    55435603    if (size(#)>0) // noAbs was used
    55445604    {
    5545       execute("ring NOQRing=("+string(char(LIFTRing))+"),("+varstr(basering)+","+parstr(LIFTRing)+"),dp;");
     5605      ring NOQRing = create_ring("("+string(char(LIFTRing))+")", "("+varstr(basering)+","+parstr(LIFTRing)+")", "dp");
    55465606      execute("qring TESTRing=std("+#[1]+");");
    55475607      ideal i=imap(BASERING,i);
     
    55515611      setring LIFTRing;
    55525612      poly mp=minpoly;
    5553       execute("ring TESTRing=("+charstr(LIFTRing)+"),("+varstr(BASERING)+"),dp;");
     5613      ring TESTRing = create_ring(ringlist(LIFTRing)[1], "("+varstr(BASERING)+")", "dp", "no_minpoly");
    55545614      minpoly=number(imap(LIFTRing,mp));
    55555615      ideal i=imap(BASERING,i);
     
    57185778        {
    57195779          // pass to a ring which has variables which are suitable for gfan
    5720           execute("ring GFANRING=("+string(char(basering))+"),(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),dp;");
     5780          ring GFANRING = create_ring(string(char(basering)), "(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z)", "dp");
    57215781          ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;
    57225782          phiideal[nvars(PREGFANRING)]=a; // map t to a
     
    59345994        if (anzahlvariablen<nvars(basering))
    59355995        {
    5936           execute("ring PARARing=("+string(char(basering))+",@a),t,ls;");
     5996          ring PARARing = create_ring("("+string(char(basering))+",@a)", "t", "ls");
    59375997          minpoly=number(imap(PREGFANRING,m));
    59385998        }
    59395999        else
    59406000        {
    5941           execute("ring PARARing=("+charstr(basering)+"),t,ls;");
     6001          ring PARARing = create_ring(ringlist(basering)[1], "t", "ls", "no_minpoly");
    59426002        }
    59436003        ideal PARA; // will contain the parametrisation
     
    62006260        else
    62016261        {
    6202           execute("ring SATURATERING=("+charstr(basering)+"),("+varstr(basering)+"),("+ordstr(basering)+");");
     6262          ring SATURATERING = create_ring(ringlist(basering)[1], "("+varstr(basering)+")", "("+ordstr(basering)+")", "no_minpoly");
    62036263          ideal i=imap(BASERING,i);
    62046264          export(i);
     
    63086368  def BASERING=basering;
    63096369  string tvar=string(var(nvars(basering)));
     6370  list RL_BASERING=ringlist(BASERING);
     6371  list TVAR=RL_BASERING[2];
    63106372  int j,k,l; // indices
    63116373  // store the weighted degrees of the elements of i in an integer vector
     
    63346396  // collect the true variables x_1,...,x_n plus @a, if it is defined in BASERING
    63356397  ideal variablen;
     6398  list VARIABLEN;
     6399  list RL=ringlist(basering);
    63366400  for (j=1;j<=nvars(basering)-1;j++)
    63376401  {
    63386402    variablen=variablen+var(j);
     6403    VARIABLEN[j]=RL[2][j];
    63396404  }
    63406405  // move to a polynomial ring with global monomial ordering
    63416406  // - the variable t is superflous,
    63426407  // the variable @a is not if it was already present
    6343   execute("ring INITIALRING=("+charstr(basering)+"),("+string(variablen)+"),dp;");
     6408  RL[2]=VARIABLEN;
     6409  RL[3]=list(list("dp",1:size(VARIABLEN)));
     6410  ring INITIALRING = ring(RL);
    63446411  ideal ini=imap(BASERING,ini);
    63456412  // compute the minimal associated primes of the
     
    63576424  }
    63586425  list extensionringlist; // contains the rings which are to be returned
     6426  list RL;
    63596427  for (j=1;j<=size(maximalideals);j++)
    63606428  {
     
    63636431    // if some of the maximal ideals needs a field extension,
    63646432    // then everything will live in this ring
     6433    RL=ringlist(BASERING);
    63656434    if ((maximalideals[j][1]!=0) and (nvars(BASERING)==anzahlvariablen))
    63666435    {
    63676436      // define the extension ring which contains
    63686437      // the new variable @a, if it is not yet present
    6369       execute("ring EXTENSIONRING=("+charstr(BASERING)+"),("+string(imap(BASERING,variablen))+",@a,"+tvar+"),(dp("+string(anzahlvariablen-1)+"),dp(1),lp(1));");
     6438      RL[2]=VARIABLEN+list("@a")+TVAR;
     6439      RL[3]=list(list("dp",1:(anzahlvariablen-1)),list("dp",1:1),list("lp",1:1));
     6440      ring EXTENSIONRING = ring(RL);
    63706441      // phi maps x_i to x_i, @a to @a (if present in the ring),
    63716442      // and the additional variable
     
    63786449    else // @a was already present in the BASERING or no
    63796450    { // field extension is necessary
    6380       execute("ring EXTENSIONRING=("+charstr(BASERING)+"),("+varstr(BASERING)+"),("+ordstr(BASERING)+");");
     6451      ring EXTENSIONRING = ring(RL);
    63816452      // phi maps x_i to x_i, @a to @a (if present in the ring),
    63826453      // and the additional variable
     
    72557326{
    72567327  def BASERING=basering;
    7257   execute("ring INTERRING=0,("+varstr(basering)+"),("+ordstr(basering)+");");
     7328  ring INTERRING = create_ring(0, "("+varstr(basering)+")", "("+ordstr(basering)+")");
    72587329  poly n=imap(BASERING,n);
    7259   execute("ring REALRING=(real,50,100),("+varstr(basering)+"),("+ordstr(basering)+");");
     7330  ring REALRING = create_ring("(real,50,100)", "("+varstr(basering)+")", "("+ordstr(basering)+")");
    72607331  map phi=INTERRING,maxideal(1);
    72617332  string s=string(phi(n));
     
    78737944  {
    78747945    def BASERING=basering;
    7875     execute("ring TRING="+string(char(BASERING))+",t,ds;");
     7946    ring TRING = create_ring(string(char(BASERING)), "t", "ds");
    78767947    poly hn=imap(BASERING,hn);
    78777948    poly c4=imap(BASERING,c4);
  • Singular/dyn_modules/freealgebra/freealgebra.cc

    r6180565 r1593911  
    11#include "Singular/libsingular.h"
     2#include <vector>
    23
    34#ifdef HAVE_SHIFTBBA
     
    8485}
    8586
     87static BOOLEAN p_LPDivisibleBy(ideal I, poly p, ring r)
     88{
     89  for(int i = 0; i < IDELEMS(I); i++)
     90  {
     91    if (p_LPDivisibleBy(I->m[i], p, r))
     92    {
     93      return TRUE;
     94    }
     95  }
     96  return FALSE;
     97}
     98
    8699static BOOLEAN lpLmDivides(leftv res, leftv h)
    87100{
     
    101114    poly q=(poly)h->next->Data();
    102115    res->rtyp = INT_CMD;
    103     for(int i=0;i<IDELEMS(I);i++)
    104     {
    105       if (p_LPDivisibleBy(I->m[i],q, currRing))
    106       {
    107         res->data=(void*)(long)1;
    108         return FALSE;
    109       }
    110     }
    111     res->data=(void*)(long)0;
     116    res->data=(void*)(long) p_LPDivisibleBy(I, q, currRing);
    112117    return FALSE;
    113118  }
     
    128133  else return TRUE;
    129134}
     135
     136static void _computeStandardWords(ideal words, int n, ideal M, int& last)
     137{
     138  if (n <= 0){
     139    words->m[0] = pOne();
     140    last = 0;
     141    return;
     142  }
     143
     144  _computeStandardWords(words, n - 1, M, last);
     145
     146  int nVars = currRing->isLPring;
     147
     148  for (int j = nVars - 1; j >= 0; j--)
     149  {
     150    for (int i = last; i >= 0; i--)
     151    {
     152      int index = (j * (last + 1)) + i;
     153
     154      if (words->m[i] != NULL)
     155      {
     156        if (j > 0) {
     157          words->m[index] = pCopy(words->m[i]);
     158        }
     159
     160        int varOffset = ((n - 1) * nVars) + 1;
     161        pSetExp(words->m[index], varOffset + j, 1);
     162        pSetm(words->m[index]);
     163        pTest(words->m[index]);
     164
     165        if (p_LPDivisibleBy(M, words->m[index], currRing))
     166        {
     167          pDelete(&words->m[index]);
     168          words->m[index] = NULL;
     169        }
     170      }
     171    }
     172  }
     173
     174  last = nVars * last + nVars - 1;
     175}
     176
     177static ideal computeStandardWords(int n, ideal M)
     178{
     179  int nVars = currRing->isLPring;
     180
     181  int maxElems = 1;
     182  for (int i = 0; i < n; i++) // maxElems = nVars^n
     183    maxElems *= nVars;
     184  ideal words = idInit(maxElems);
     185  int last;
     186  _computeStandardWords(words, n, M, last);
     187  idSkipZeroes(words);
     188  return words;
     189}
     190
     191// NULL if graph is undefined
     192static intvec* ufnarovskiGraph(ideal G)
     193{
     194  long l = 0;
     195  for (int i = 0; i < IDELEMS(G); i++)
     196    l = si_max(pTotaldegree(G->m[i]), l);
     197  l--;
     198  if (l <= 0)
     199  {
     200    WerrorS("Ufnarovski graph not implemented for l <= 0");
     201    return NULL;
     202  }
     203  int lV = currRing->isLPring;
     204
     205  ideal standardWords = computeStandardWords(l, G);
     206
     207  int n = IDELEMS(standardWords);
     208  intvec* UG = new intvec(n, n, 0);
     209  for (int i = 0; i < n; i++)
     210  {
     211    for (int j = 0; j < n; j++)
     212    {
     213      poly v = standardWords->m[i];
     214      poly w = standardWords->m[j];
     215
     216      // check whether v*x1 = x2*w (overlap)
     217      bool overlap = true;
     218      for (int k = 1; k <= (l - 1) * lV; k++)
     219      {
     220        if (pGetExp(v, k + lV) != pGetExp(w, k)) {
     221          overlap = false;
     222          break;
     223        }
     224      }
     225
     226      if (overlap)
     227      {
     228        // create the overlap
     229        poly p = pMult(pCopy(v), p_LPVarAt(w, l, currRing));
     230
     231        // check whether the overlap is normal
     232        bool normal = true;
     233        for (int k = 0; k < IDELEMS(G); k++)
     234        {
     235          if (p_LPDivisibleBy(G->m[k], p, currRing))
     236          {
     237            normal = false;
     238            break;
     239          }
     240        }
     241
     242        if (normal)
     243        {
     244          IMATELEM(*UG, i + 1, j + 1) = 1;
     245        }
     246      }
     247    }
     248  }
     249  return UG;
     250}
     251
     252static std::vector<int> countCycles(const intvec* _G, int v, std::vector<int> path, std::vector<BOOLEAN> visited, std::vector<BOOLEAN> cyclic, std::vector<int> cache)
     253{
     254  intvec* G = ivCopy(_G); // modifications must be local
     255
     256  if (cache[v] != -2) return cache; // value is already cached
     257
     258  visited[v] = TRUE;
     259  path.push_back(v);
     260
     261  int cycles = 0;
     262  for (int w = 0; w < G->cols(); w++)
     263  {
     264    if (IMATELEM(*G, v + 1, w + 1)) // edge v -> w exists in G
     265    {
     266      if (!visited[w])
     267      { // continue with w
     268        cache = countCycles(G, w, path, visited, cyclic, cache);
     269        if (cache[w] == -1)
     270        {
     271          cache[v] = -1;
     272          return cache;
     273        }
     274        cycles = si_max(cycles, cache[w]);
     275      }
     276      else
     277      { // found new cycle
     278        int pathIndexOfW = -1;
     279        for (int i = path.size() - 1; i >= 0; i--) {
     280          if (cyclic[path[i]] == 1) { // found an already cyclic vertex
     281            cache[v] = -1;
     282            return cache;
     283          }
     284          cyclic[path[i]] = TRUE;
     285
     286          if (path[i] == w) { // end of the cycle
     287            assume(IMATELEM(*G, v + 1, w + 1) != 0);
     288            IMATELEM(*G, v + 1, w + 1) = 0; // remove edge v -> w
     289            pathIndexOfW = i;
     290            break;
     291          } else {
     292            assume(IMATELEM(*G, path[i - 1] + 1, path[i] + 1) != 0);
     293            IMATELEM(*G, path[i - 1] + 1, path[i] + 1) = 0; // remove edge vi-1 -> vi
     294          }
     295        }
     296        assume(pathIndexOfW != -1); // should never happen
     297        for (int i = path.size() - 1; i >= pathIndexOfW; i--) {
     298          cache = countCycles(G, path[i], path, visited, cyclic, cache);
     299          if (cache[path[i]] == -1)
     300          {
     301            cache[v] = -1;
     302            return cache;
     303          }
     304          cycles = si_max(cycles, cache[path[i]] + 1);
     305        }
     306      }
     307    }
     308  }
     309  cache[v] = cycles;
     310
     311  delete G;
     312  return cache;
     313}
     314
     315// -1 is infinity
     316static int graphGrowth(const intvec* G)
     317{
     318  // init
     319  int n = G->cols();
     320  std::vector<int> path;
     321  std::vector<BOOLEAN> visited;
     322  std::vector<BOOLEAN> cyclic;
     323  std::vector<int> cache;
     324  visited.resize(n, FALSE);
     325  cyclic.resize(n, FALSE);
     326  cache.resize(n, -2);
     327
     328  // get max number of cycles
     329  int cycles = 0;
     330  for (int v = 0; v < n; v++)
     331  {
     332    cache = countCycles(G, v, path, visited, cyclic, cache);
     333    if (cache[v] == -1)
     334      return -1;
     335    cycles = si_max(cycles, cache[v]);
     336  }
     337  return cycles;
     338}
     339
     340// -1 is infinity, -2 is error
     341static int gkDim(const ideal _G)
     342{
     343  if (rField_is_Ring(currRing)) {
     344      WerrorS("GK-Dim not implemented for rings");
     345      return -2;
     346  }
     347
     348  for (int i=IDELEMS(_G)-1;i>=0; i--)
     349  {
     350    if (pGetComp(_G->m[i]) != 0)
     351    {
     352      WerrorS("GK-Dim not implemented for modules");
     353      return -2;
     354    }
     355  }
     356
     357  ideal G = id_Head(_G, currRing); // G = LM(G) (and copy)
     358  idSkipZeroes(G); // remove zeros
     359  id_DelLmEquals(G, currRing); // remove duplicates
     360
     361  // get the max deg
     362  long maxDeg = 0;
     363  for (int i = 0; i < IDELEMS(G); i++)
     364  {
     365    maxDeg = si_max(maxDeg, pTotaldegree(G->m[i]));
     366
     367    // also check whether G = <1>
     368    if (pIsConstantComp(G->m[i]))
     369    {
     370      WerrorS("GK-Dim not defined for 0-ring");
     371      return -2;
     372    }
     373  }
     374
     375  // early termination if G \subset X
     376  if (maxDeg <= 1)
     377  {
     378    int lV = currRing->isLPring;
     379    if (IDELEMS(G) == lV) // V = {1} no edges
     380      return 0;
     381    if (IDELEMS(G) == lV - 1) // V = {1} with loop
     382      return 1;
     383    if (IDELEMS(G) <= lV - 2) // V = {1} with more than one loop
     384      return -1;
     385  }
     386
     387  intvec* UG = ufnarovskiGraph(G);
     388  if (errorreported || UG == NULL) return -2;
     389  return graphGrowth(UG);
     390}
     391
     392
     393static BOOLEAN lpGkDim(leftv res, leftv h)
     394{
     395  const short t[]={1,IDEAL_CMD};
     396  if (iiCheckTypes(h,t,1))
     397  {
     398    assumeStdFlag(h);
     399    ideal G = (ideal) h->Data();
     400    res->rtyp = INT_CMD;
     401    res->data = (void*)(long) gkDim(G);
     402    if (errorreported) return TRUE;
     403    return FALSE;
     404  }
     405  else return TRUE;
     406}
    130407#endif
    131408
     
    138415  p->iiAddCproc("freealgebra.so","lpLmDivides",FALSE,lpLmDivides);
    139416  p->iiAddCproc("freealgebra.so","lpVarAt",FALSE,lpVarAt);
     417  p->iiAddCproc("freealgebra.so","lpGkDim",FALSE,lpGkDim);
     418
    140419  p->iiAddCproc("freealgebra.so","stest",TRUE,stest);
    141420  p->iiAddCproc("freealgebra.so","btest",TRUE,btest);
  • Singular/iparith.cc

    rd9e5b0 r1593911  
    10231023      }
    10241024      res->data = (char *)(pp_Mult_qq( a, b, currRing));
    1025       pNormalize((poly)res->data);
    10261025      return FALSE;
    10271026    }
     
    10361035    }
    10371036    res->data = (char *)(pMult( a, b));
    1038     pNormalize((poly)res->data);
    10391037    return jjOP_REST(res,u,v);
    10401038  }
     
    10511049  }
    10521050  res->data = (char *)(pMult( a, b));
    1053   pNormalize((poly)res->data);
    10541051  return jjOP_REST(res,u,v);
    10551052}
     
    10571054{
    10581055  res->data = (char *)idMult((ideal)u->Data(),(ideal)v->Data());
    1059   id_Normalize((ideal)res->data,currRing);
    10601056  if ((v->next!=NULL) || (u->next!=NULL))
    10611057    return jjOP_REST(res,u,v);
     
    11061102  ideal I= (ideal)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
    11071103  if (r>0) I->rank=r;
    1108   id_Normalize(I,currRing);
    11091104  res->data = (char *)I;
    11101105  return FALSE;
     
    11161111  ideal I= (ideal)pMultMp(p,(matrix)v->CopyD(MATRIX_CMD),currRing);
    11171112  if (r>0) I->rank=r;
    1118   id_Normalize(I,currRing);
    11191113  res->data = (char *)I;
    11201114  return FALSE;
     
    11251119  poly p=pNSet(n);
    11261120  res->data = (char *)mp_MultP((matrix)u->CopyD(MATRIX_CMD),p,currRing);
    1127   id_Normalize((ideal)res->data,currRing);
    11281121  return FALSE;
    11291122}
     
    11351128{
    11361129  res->data = (char *)mp_MultI((matrix)u->CopyD(MATRIX_CMD),(int)(long)v->Data(),currRing);
    1137   id_Normalize((ideal)res->data,currRing);
    11381130  return FALSE;
    11391131}
     
    11521144     return TRUE;
    11531145  }
    1154   id_Normalize((ideal)res->data,currRing);
    11551146  if ((v->next!=NULL) || (u->next!=NULL))
    11561147    return jjOP_REST(res,u,v);
     
    11671158     return TRUE;
    11681159  }
    1169   id_Normalize((ideal)res->data,currRing);
    11701160  if ((v->next!=NULL) || (u->next!=NULL))
    11711161    return jjOP_REST(res,u,v);
     
    13171307    }
    13181308  }
    1319   id_Normalize((ideal)mm,currRing);
    13201309  res->data=(char *)mm;
    13211310  return FALSE;
     
    39743963
    39753964/// Return the denominator of the input number
    3976 /// NOTE: the input number is normalized as a side effect
    39773965static BOOLEAN jjDENOMINATOR(leftv res, leftv v)
    39783966{
    3979   number n = reinterpret_cast<number>(v->Data());
     3967  number n = reinterpret_cast<number>(v->CopyD());
    39803968  res->data = reinterpret_cast<void*>(n_GetDenom(n, currRing->cf));
     3969  n_Delete(&n,currRing);
    39813970  return FALSE;
    39823971}
    39833972
    39843973/// Return the numerator of the input number
    3985 /// NOTE: the input number is normalized as a side effect
    39863974static BOOLEAN jjNUMERATOR(leftv res, leftv v)
    39873975{
    3988   number n = reinterpret_cast<number>(v->Data());
     3976  number n = reinterpret_cast<number>(v->CopyD());
    39893977  res->data = reinterpret_cast<void*>(n_GetNumerator(n, currRing->cf));
     3978  n_Delete(&n,currRing);
    39903979  return FALSE;
    39913980}
     
    45294518  else
    45304519  {
     4520    nNormalize(pGetCoeff(p));
    45314521    res->data=(char *)nCopy(pGetCoeff(p));
    45324522  }
  • Singular/ipshell.cc

    rd9e5b0 r1593911  
    16921692        case ringorder_Ds:
    16931693        case ringorder_lp:
     1694        case ringorder_rp:
     1695        case ringorder_ls:
    16941696          for(;j>=0; j--) (*iv)[j]=1;
    16951697          break;
     
    22052207        case ringorder_Ds:
    22062208        case ringorder_lp:
     2209        case ringorder_ls:
     2210        case ringorder_rp:
    22072211          for(;j>=0; j--) (*iv)[j]=1;
    22082212          break;
     
    23992403        {
    24002404          ch=TRUE;
    2401           Warn("name conflict var(%d) and var(%d): `%s`, rename to `@%s`",i+1,j+1,R->names[i],R->names[i]);
     2405          Warn("name conflict var(%d) and var(%d): `%s`, rename to `@%s`in >>%s<<\nin %s:%d",i+1,j+1,R->names[i],R->names[i],my_yylinebuf,currentVoice->filename,yylineno);
    24022406          omFree(R->names[j]);
    24032407          R->names[j]=(char *)omAlloc(2+strlen(R->names[i]));
     
    24142418      if (strcmp(rParameter(R)[i],R->names[j])==0)
    24152419      {
    2416         Warn("name conflict par(%d) and var(%d): `%s`, renaming the VARIABLE to `@@(%d)`",i+1,j+1,R->names[j],i+1);
     2420        Warn("name conflict par(%d) and var(%d): `%s`, rename the VARIABLE to `@@(%d)`in >>%s<<\nin %s:%d",i+1,j+1,R->names[j],i+1,my_yylinebuf,currentVoice->filename,yylineno);
    24172421//        omFree(rParameter(R)[i]);
    24182422//        rParameter(R)[i]=(char *)omAlloc(10);
     
    25322536          continue;
    25332537        }
    2534         if ((vv->m[1].Typ()!=INTVEC_CMD) && (vv->m[1].Typ()!=INT_CMD))
     2538        if ((vv->m[1].Typ()!=INTVEC_CMD) && (vv->m[1].Typ()!=INT_CMD)
     2539        && (vv->m[1].Typ()!=INTMAT_CMD))
    25352540        {
    25362541          PrintS(lString(vv));
     
    25622567        intvec *iv;
    25632568        if (vv->m[1].Typ()==INT_CMD)
    2564           iv=new intvec((int)(long)vv->m[1].Data(),(int)(long)vv->m[1].Data());
     2569        {
     2570          int l=si_max(1,(int)(long)vv->m[1].Data());
     2571          iv=new intvec(l);
     2572          for(int i=0;i<l;i++) (*iv)[i]=1;
     2573        }
    25652574        else
    2566           iv=ivCopy((intvec*)vv->m[1].Data()); //assume INTVEC
     2575          iv=ivCopy((intvec*)vv->m[1].Data()); //assume INTVEC/INTMAT
    25672576        int iv_len=iv->length();
    25682577        if (iv_len==0)
    25692578        {
    2570           Werror("empty intvec for ordering %d (%s)",j_in_R,rSimpleOrdStr(R->order[j_in_R]));
     2579          Werror("empty intvec for ordering %d (%s)",j_in_R+1,rSimpleOrdStr(R->order[j_in_R]));
    25712580          return TRUE;
     2581        }
     2582        if (R->order[j_in_R]==ringorder_M)
     2583        {
     2584          if (vv->m[1].rtyp==INTMAT_CMD) iv->makeVector();
     2585          iv_len=iv->length();
    25722586        }
    25732587        if ((R->order[j_in_R]!=ringorder_s)
     
    26202634             R->wvhdl[j_in_R] =( int *)omAlloc((iv->length())*sizeof(int));
    26212635             for (i=0; i<iv->length();i++) R->wvhdl[j_in_R][i]=(*iv)[i];
    2622              R->block1[j_in_R]=si_max(R->block0[j_in_R],R->block0[j_in_R]+(int)sqrt((double)(iv->length()-1)));
     2636             R->block1[j_in_R]=si_max(R->block0[j_in_R],R->block0[j_in_R]+(int)sqrt((double)(iv->length())));
    26232637             if (R->block1[j_in_R]>R->N)
    26242638             {
    2625                WerrorS("ordering matrix too big");
    2626                return TRUE;
     2639               R->block1[j_in_R]=R->N;
    26272640             }
    26282641             break;
     
    26362649           case ringorder_Dp:
    26372650           case ringorder_rp:
     2651             #if 0
     2652             for (i=0; i<iv_len;i++)
     2653             {
     2654               if (((*iv)[i]!=1)&&(iv_len!=1))
     2655               {
     2656                 iv->show(1);
     2657                 Warn("ignore weight %d for ord %d (%s) at pos %d\n>>%s<<",
     2658                   (*iv)[i],j_in_R+1,rSimpleOrdStr(R->order[j_in_R]),i+1,my_yylinebuf);
     2659                 break;
     2660               }
     2661             }
     2662             #endif // break absfact.tst
    26382663             break;
    26392664           case ringorder_S:
  • Tst/Letterplace.lst

    r6180565 r1593911  
    99Manual/makeLetterplaceRing.tst
    1010Manual/serreRelations.tst
     11Manual/lpGkDim.tst
    1112Manual/lpKDim.tst
    1213Manual/lpMonomialPrinting.tst
     
    1819Manual/lpSickleDim.tst
    1920Manual/lpHilbert.tst
     21Manual/lpLmDivisible.tst
  • Tst/Manual/letterplace_std.res.gz.uu

    r6180565 r1593911  
    1 begin 640 letterplace_std.res.gz
    2 M'XL(",KG3EP"`VQE='1E<G!L86-E7W-T9"YR97,`39%=:X,P%(;O_16'L@N-
    3 M6HS6?B`&-GIC&;MH=S>DZ$Q%$%<T97&_?B?1-KT0S7N>]SD$3Y_[[`,`*(/W
    4 M[`T68A#+MBD7">#7N>D:83N)I=[`&+1<"-Y?V^*;GP=1+3O^NQQ$(:S3K`EG
    5 MS:7GO"XGTV,8,>B;KH8>4@@\6WJC]^=X^ZLA5@R:3D#%:^R?RY];5R$;&R!F
    6 M.+S`$5.UXK6M>=D7=N_%CH'6#`8N]*JC23?HKGC10H9E7Y+1WY"1C&Y$))$>
    7 M8$"DCP\936=[[QRP@Q>VLZ<U.P:'Q#I\T3S5#N/$,,S3,%0R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P'@$<A.)%C9#>X1'*;'F"*#(&A15RB3$!FV7UYCLAM;1=7)$,?XAAX0)BP
     49M6>*)U;-R2&C9:.`<S15<#R.X(3"B+G@-?!X(59`_*6V5S6"`/H>(,!(H60G0
     50M1SQ)43P!`,'.:.P4,8`T9$`21H'"MX._6%#EHSYCL5"`6%Z!#O:#";#41*CB
     51M=@`N+\1LFP*Z:%"(Q`2%T/$`[F%F8D/,DD.'XV,9890L5<G581)/0TNC,!$A
     52M0(@"=9`XM<K00R-L$F7%*C?#F=*G4@SH(=:7*@8S`3R(12)GFR#Q9)!!OFM$
     53MK,YFY)(B72:V$PB3X'T!;#B71G=H2,DA36$$H%4&Z`(FR!.0&18OH.B:*:KM
     54M)6T`D5QIV(TM:?61F#EI0LR][*(I"-^Q"\O5LY'*HP*W5A=G:B!/9>FBFP@J
     55MJ6GEA'PH$V(:HH(1V340RPB$%?LWA%451755PBX8EX29ZE)2J6DEXM[L@6Z)
     56M<ZXT,1A=SV"=:RB7Q?.$J%A#L0`^=F-:<,-NKI[AB-9X5^1=0G`)<T8%++$T
     57M*V07C$9.F;":7;*"V]FGJ*&"P+RZ-G>1&D2>IB!&A%"[J-W&S7SGXK2[?5P)
     58M`I,_I#ZDO7@WFG,@(-L$*8%R-#J!719[2JOJ4Q:FR[+B40D!WHZXBVYJ_6J8
     59M9=2`'*-\3*"JA@`-V`H,I;)JJYX3^P!*XHD_X$%<0"5U)05=5=[TL(_JZ<#D
     60M#,8DMC*A,M43A!N7*=I0%UB7[['A5'Z1/<:,FY$QUK:C;%BL3Z#].'9PR_=#
     61MDJ+<<H6)VX/@Q542!D0J:J71634$!2@AUJO[!=]A60:>HI[215%2DSO<$_B)
     62MU;)FY3<Y9LFO"I0XAGEMH%"5`M8D(J;+`!HN9R.&5-3VXCE[[^JC0A@NG173
     63M7K)!YZ23#,ENDH\"D^#,7(^:'/(*!L1:Q<B49YS"!4P9.!!P,+P)*V`@[$?X
     64M'7A2J<FZ-PM:/>&37>21JCLF+93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2DNXT"D
     113MSKZMXIF@*;].[:VK;0_F:M_?&CF8S[NPP@]](0%TX'FF;F?E'M58M]K>;?L&
     114MC"?[1$J,ZY"^VAHD*0PJ#<93+<7R&#;Y_=MDZ6@_&HI.ZYV.?-?>0TUE6_2K
     115MB-U>M5HV(!IL+TA[1-C802D)'X0`0-]@F#N.!RM-`_4E1(-8&_M*ERJ=`GJ]
     116MI:"<\HR^A'T8-"6^0$CP]O;0'[?[RG:M>E=K?=^R!%ILI)`2+L%CMOWA()K#
     117M5R;.YZQJWX?^A_6D?9YI+G3Q]J&%`8(4@<1""'JW/9_;PSD\P(H_@F=3MH`,
     118MI_Y8(&7?&/2]C(`-2EGD9^MJLU6^+&AFNS*6@G;@+=,7RN9[^>#!B3TZSQ*#
     119M?09[AKM$]]!%\*VK11I\=6.%9]@E>%N]KFH_76S'2YX!SM5GN<OKXALDI:PF
     120M%^'AV6%:DGG'6D<T</)PRY<P1"R+R+EO<I[6D9HZT$;\ZH#AG=+W[<X,UGM0
     121MC?.(>JM\*'L=D.Y;Q$L\V;2P%S4\(O>4I(Z]3$)R$AH`RRCKZ-?"CRR=H<;]
     122M&7[R#).5@8V>QK3S09Q=\=SW^;GTFKTEK>$A>5WHC._K^)V0\5TC]8:"M?K6
     123M&+!5[G7[N98<RKF\R@3/VV"6<BXX\SU2K;,<9X8]H(5U4K;/5IPH>J));3MV
     124M:\75JMDGK?U(6[(.(JEY,&^IM]-!Z6B1%ZR75EFL\BG3PY2=V(I'SSN'[1.%
     125M.`+)/*^E['M(>-,W7SP78\;I>S1S[@^KCE!=]_P(`0*5K^X^(I'@VY]*+#%?
     126M/9+R;1!%DIH_UOTK(=E>D3RU#NK7^Y&RU_"ECWV[?V3?5%CUJ:]LV,FK=E9'
     127M?1"X^-M^H\=;S5/7ZBM0OGB!-?>.O[Z7W+8WRE-_L_X;!/_[@K__]BI^^]T_
     128+?/,_T)H[0:XP````
    10129`
    11130end
  • Tst/Manual/letterplace_std.stat

    r6180565 r1593911  
    1 1 >> tst_memory_0 :: 1548675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:331856
    2 1 >> tst_memory_1 :: 1548675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:2150160
    3 1 >> tst_memory_2 :: 1548675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:2191264
    4 1 >> tst_timer_1 :: 1548675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:6
     11 >> tst_memory_0 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:20013576
     21 >> tst_memory_1 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:21011760
     31 >> tst_memory_2 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:21068800
     41 >> tst_timer_1 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:22
  • Tst/Manual/letterplace_std.tst

    r6180565 r1593911  
    11LIB "tst.lib"; tst_init();
    22LIB "freegb.lib";
     3
     4// 1
    35ring r = 0,(x,y,z),Dp;
    46int degree_bound = 5;
     
    68setring R;
    79ideal I = -x*y-7*y*y+3*x*x, x*y*x-y*x*y;
    8 ideal J = std(I);
    9 J;
     10std(I);
     11
     12kill r;
     13kill R;
     14
     15// 2 (c_4_1_7_W)
     16ring r = 0,(x4,x3,x2,x1),Dp;
     17def R = freeAlgebra(r, 7);
     18setring(R);
     19ideal I = x4*x4-25*x4*x2-x1*x4-6*x1*x3-9*x1*x2+x1*x1,
     20x4*x3+13*x4*x2+12*x4*x1-9*x3*x4+4*x3*x2+41*x3*x1-7*x1*x4-x1*x2,
     21x3*x3-9*x3*x2+2*x1*x4+x1*x1,
     2217*x4*x2-5*x2*x2-41*x1*x4,
     23x2*x2-13*x2*x1-4*x1*x3+2*x1*x2-x1*x1,
     24x2*x1+4*x1*x2-3*x1*x1;
     25std(I);
     26
    1027tst_status(1);$
  • libpolys/polys/shiftop.cc

    r6180565 r1593911  
    1313 * -> wait until the new interface is released
    1414*/
    15 #define SHIFT_MULT_COMPAT_MODE
     15#define SHIFT_MULT_COMPAT_MODE // ncHilb.lib still relies on it
    1616
    1717#ifdef SHIFT_MULT_DEBUG
     
    756756BOOLEAN _p_LPLmDivisibleByNoComp(poly a, poly b, const ring r)
    757757{
    758   if(p_LmIsConstantComp(a, r))
    759     return TRUE;
    760758#ifdef SHIFT_MULT_COMPAT_MODE
    761759  a = p_Head(a, r);
     
    764762  p_mLPunshift(b, r);
    765763#endif
    766   int i = (r->N / r->isLPring) - p_LastVblock(a, r);
    767   do {
    768     int j = r->N - (i * r->isLPring);
     764  for (int i = (r->N / r->isLPring) - p_LastVblock(a, r); i >= 0; i--)
     765  {
    769766    bool divisible = true;
    770     do
     767    for (int j = r->N - (i * r->isLPring); j >= 0; j--)
    771768    {
    772769      if (p_GetExp(a, j, r) > p_GetExp(b, j + (i * r->isLPring), r))
     
    775772        break;
    776773      }
    777       j--;
    778     }
    779     while (j);
     774    }
    780775    if (divisible) return TRUE;
    781     i--;
    782   }
    783   while (i > -1);
     776  }
    784777#ifdef SHIFT_MULT_COMPAT_MODE
    785778  p_Delete(&a, r);
Note: See TracChangeset for help on using the changeset viewer.