Changeset 87977c7 in git for Singular


Ignore:
Timestamp:
Jul 25, 2013, 12:47:23 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
2ea18609e14482a4ddbe0fd0d68b8d5885268a0c
Parents:
c3066da943ed65e5390f6c04d9a69f7710bfc83547e8b0441e7692a4a4b6c2f23817976fe5203f1c
Message:
Merge pull request #342 from YueRen/spielwiese

Spielwiese
Location:
Singular
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/classify_aeq.lib

    r47e8b04 r87977c7  
    668668{
    669669    def R=basering;
    670     def O=changeord("Ds");
     670    def O=changeord(list(list("Ds",nvars(R))));
    671671    setring O;
    672672    ideal I=imap(R,I);
     
    717717{
    718718  def R=basering;//up till now the ordering of the base ring is ds
    719   def O=changeord("Ds");
     719  def O=changeord(list(list("Ds",nvars(R))));
    720720  setring O;
    721721  ideal I=imap(R,I);
     
    13771377ideal I=4t3,7t6+10t9;
    13781378ideal G=t4,t7+t10;
    1379 sagbiMOD(I,G,18);
     1379sagbiMod(I,G,18);
    13801380*/
    13811381
  • Singular/LIB/gitfan.lib

    rc3066d r87977c7  
    2727
    2828LIB "parallel.lib"; // for parallelWaitAll
     29LIB "general.lib";
    2930
    3031////////////////////////////////////////////////////
    31 proc mod_init()
    32 {
    33   LIB"gfanlib.so";
    34 }
    35 
    36 static proc int2face(int n, int r)
     32
     33proc int2face(int n, int r)
    3734{
    3835  int k = r-1;
     
    4340    while(2^k > n0){
    4441      k--;
    45       //v[size(v)+1] = 0;
    4642    }
    4743
     
    5652/////////////////////////////////
    5753
    58 proc isAface(ideal a, intvec gam0)
     54proc isAface(ideal a, intvec gam0, int n)
    5955"USAGE:  isAface(a,gam0); a: ideal, gam0:intvec
    6056PURPOSE: Checks whether the face of the positive orthant,
     
    6662"
    6763{
    68   poly pz;
    69 
    7064  // special case: gam0 is the zero-cone:
    7165  if (size(gam0) == 1 and gam0[1] == 0){
    72     ideal G;
     66    poly pz; ideal G;
    7367
    7468    // is an a-face if and only if RL0(0,...,0) = const
     
    9387  }
    9488
    95 
    96   // ring is too big: Switch to KK[T_i; e_i\in gam0] instead:
     89  // ring is too big: Switch to KK[T_i | e_i\in gam0] instead:
     90  intvec w=ringlist(basering)[3][1][2];
     91  intvec w0;
    9792  string initNewRing = "ring Rgam0 = 0,(";
    9893
    9994  for (int i=1; i<size(gam0); i++){
    10095    initNewRing = initNewRing + string(var(gam0[i])) + ",";
    101   }
    102 
     96    w0[i]=w[gam0[i]];
     97  }
     98
     99  w0 = w0,w[gam0[i]],1;
     100  initNewRing = initNewRing + string(var(gam0[size(gam0)])) + ",U),Wp("+string(w0)+");";
     101  def R = basering;
     102  execute(initNewRing);
     103
     104  ideal agam0 = imap(R,a);
     105
     106  for (i = 1; i<=size(agam0); i=i+1)
     107  {
     108    if (size(agam0[i]) == 1)
     109    { return(0,0); }
     110  }
     111
     112  poly p = var(1); // first entry of g; p = prod T_i with i element of g
     113  for ( i = 2; i <= nvars(basering); i++ ) {
     114      p = p * var(i);
     115    }
     116  // p is now the product over all T_i, with e_i in gam0
     117
     118  agam0 = agam0, p - 1; // rad-membership
     119  agam0 = timeStd(agam0,5);
     120  // "timestd finished after: "+string(timer-t);
     121  // int timeout = 0;
     122  if (attrib(agam0,"isSB") < 1)
     123  {
     124    kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R;
     125    return(0,1);
     126    // // "timestd failed in "+string(gam0)+", falling back to saturation!";
     127    // setring R; kill Rgam0;
     128
     129    // initNewRing = "ring Rgam0 = 0,(";
     130
     131    // w0 = 0;
     132    // for (i=1; i<size(gam0); i++){
     133    //   initNewRing = initNewRing + string(var(gam0[i])) + ",";
     134    //   w0[i]=w[gam0[i]];
     135    // }
     136
     137    // w0 = w0,w[gam0[i]];
     138    // initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),Wp("+string(w0)+");";
     139    // execute(initNewRing);
     140
     141    // ideal G = imap(R,a);
     142
     143    // timeout = 1;
     144    // int t=rtimer;
     145    // for(int k=nvars(basering); k>0; k--) { G=sat(G,var(k))[1]; }
     146    // t = (rtimer - t) div 1000;
     147    // string(n)+": saturation successful after "+string(t)+" with: "+string(G<>1);
     148  }
     149
     150  // does G contain 1?, i.e. is G = 1?
     151  if(agam0 <> 1) {
     152    kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R;
     153    return(1,0); // true
     154  }
     155
     156  kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R;
     157  return(0,0); // false
     158}
     159example
     160{
     161  echo = 2;
     162
     163  ring R = 0,(T(1..4)),dp;
     164  ideal I = T(1)*T(2)-T(4);
     165
     166  intvec w = 1,4;
     167  intvec v = 1,2,4;
     168
     169  isAface(I,w); // should be 0
     170  "-----------";
     171  isAface(I,v); // should be 1
     172}
     173
     174
     175proc isAfaceNonZero(ideal a, intvec gam0)
     176{
     177  string initNewRing = "ring Rgam0 = 0,(";
     178  for (int i=1; i<size(gam0); i++)
     179    { initNewRing = initNewRing + string(var(gam0[i])) + ","; }
    103180  initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),dp;";
    104181  def R = basering;
     
    107184  ideal agam0 = imap(R,a);
    108185
    109   poly p = var(1); // first entry of g; p = prod T_i with i element of g
    110   for ( i = 2; i <= nvars(basering); i++ ) {
    111       p = p * var(i);
    112     }
    113   // p is now the product over all T_i, with e_i in gam0
    114 
    115   agam0 = agam0, p - 1; // rad-membership
     186  for ( i = 1; i<=size(agam0); i=i+1)
     187    { if (size(agam0[i]) == 1) { return(0); } }
     188
     189  poly p = var(1);
     190  for ( i = 2; i <= nvars(basering); i++ )
     191    { p = p * var(i); }
     192
     193  agam0 = agam0, p - 1;
    116194  ideal G = std(agam0);
    117195
    118   // does G contain 1?, i.e. is G = 1?
    119   if(G <> 1) {
    120     return(1); // true
    121   }
    122 
    123   return(0); // false
    124 }
    125 example
    126 {
    127   echo = 2;
    128 
    129   ring R = 0,(T(1..4)),dp;
    130   ideal I = T(1)*T(2)-T(4);
    131 
    132   intvec w = 1,4;
    133   intvec v = 1,2,4;
    134 
    135   isAface(I,w); // should be 0
    136   "-----------";
    137   isAface(I,v); // should be 1
    138 }
    139 
     196  if(G <> 1)
     197    { return(1); }
     198
     199  return(0);
     200}
    140201////////////////////////////////////////////////////
    141202
     
    145206  list AF;
    146207
    147   for(i = start; i <= end; i++){
     208  for(i = start; i <= end; i=i+1){
    148209    if(i < 2^r){
     210      string(i)+"    "+string(size(AF));
    149211      gam0 = int2face(i,r);
    150212
     
    165227
    166228proc afaces(ideal a, list #)
    167 "USAGE:  afaces(a, b, c); a: ideal, d: int, c: int
     229"USAGE:  afaces(a, b, c); a: ideal, b: int, c: int
    168230PURPOSE: Returns a list of all a-faces (represented by intvecs).
    169231         Moreover, it is possible to specify a dimensional bound b,
     
    210272
    211273  // do remaining ones:
    212   for(i = ncores * step +1; i < 2^r; i++){
     274  for(i = ncores * step +1; i < 2^r; i=i+1){
    213275    "another one needed";
    214276    gam0 = int2face(i,r);
     
    223285  }
    224286
     287  int l;
    225288  // read out afaces of out into AF:
    226   for(i = 1; i <= size(out); i++){
    227     AF = AF + out[i];
     289  for(l = 1; l <= size(out); l++){
     290    AF = AF + out[l];
    228291  }
    229292
  • Singular/fehelp.cc

    r47e8b04 r87977c7  
    9999 *
    100100 *****************************************************************/
    101 // order is improtant -- first possible help is choosen
     101// order is important -- first possible help is chosen
    102102// moved to LIB/help.cnf
    103103static heBrowser_s *heHelpBrowsers=NULL;
     
    117117
    118118  BOOLEAN key_is_regexp = (strchr(str, '*') != NULL);
     119
     120  // try proc help and library help
     121  if (! key_is_regexp && heOnlineHelp(str)) return;
     122
    119123  heEntry_s hentry;
    120124  memset(&hentry,0,sizeof(hentry));
     
    127131    return;
    128132  }
    129 
    130   // try proc help and library help
    131   if (! key_is_regexp && heOnlineHelp(str)) return;
    132133
    133134  // Try to match approximately with key in index file
     
    191192    char *matches=StringEndS();
    192193    PrintS(matches);
     194    omFree(matches);
    193195    PrintLn();
    194     omFree(matches);
    195196    return;
    196197  }
     
    687688static BOOLEAN heOnlineHelp(char* s)
    688689{
    689   idhdl h=IDROOT->get(s,myynest);
    690690  char *ss;
    691 
     691  idhdl h;
     692
     693  if ((ss=strstr(s,"::"))!=NULL)
     694  {
     695    *ss='\0';
     696    ss+=2;
     697    h=ggetid(s);
     698    if (h!=NULL)
     699    {
     700      Print("help for %s from package %s\n",ss,s);
     701      char s_help[200];
     702      strcpy(s_help,ss);
     703      strcat(s_help,"_help");
     704      idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0);
     705      hePrintHelpStr(hh,s_help,s);
     706      return TRUE;
     707    }
     708    else Print("package %s not found\n",s);
     709    return TRUE; /* do not search the manual */
     710  }
     711  h=IDROOT->get(s,myynest);
    692712  // try help for a procedure
    693713  if (h!=NULL)
     
    707727        return TRUE;
    708728      }
    709       else
    710       {
    711         char s_help[200];
    712         strcpy(s_help,s);
    713         strcat(s_help,"_help");
    714         idhdl hh=IDROOT->get(s_help,0);
    715         hePrintHelpStr(hh,s_help,"Top");
    716       }
    717729    }
    718730    else if (IDTYP(h)==PACKAGE_CMD)
     
    720732      idhdl hh=IDPACKAGE(h)->idroot->get("info",0);
    721733      hePrintHelpStr(hh,"info",s);
    722     }
    723     else if ((ss=strstr(s,"::"))!=NULL)
    724     {
    725       *ss='\0';
    726       ss+=2;
    727       h=ggetid(s);
    728       if (h!=NULL)
    729       {
    730         Print("help for %s from package %s\n",ss,s);
    731         char s_help[200];
    732         strcpy(s_help,ss);
    733         strcat(s_help,"_help");
    734         idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0);
    735         hePrintHelpStr(hh,s_help,s);
    736       }
    737       else Print("package %s not found\n",s);
     734      return TRUE;
    738735    }
    739736    return FALSE;
     
    892889               if (feResource(*p, warn) == NULL)
    893890               {
    894                  if (warn) Warn("ressource `%c` not found",*p);
     891                 if (warn) Warn("resource `%c` not found",*p);
    895892                 return FALSE;
    896893               }
     
    899896               if (getenv("DISPLAY") == NULL)
    900897               {
    901                  if (warn) WarnS("ressource `D` not found");
     898                 if (warn) WarnS("resource `D` not found");
    902899                 return FALSE;
    903900               }
     
    984981{
    985982  char sys[MAX_SYSCMD_LEN];
    986   // char url[MAXPATHLEN];
    987983  const char *p=heHelpBrowsers[br].action;
    988984  if (p==NULL) {PrintS("no action ?\n"); return;}
     
    10671063  }
    10681064  Print("running `%s`\n",sys);
    1069   /*int dummy=*/ (void) system(sys);
     1065  (void) system(sys);
    10701066}
    10711067
  • Singular/misc_ip.cc

    r47e8b04 r87977c7  
    4949    && (mpz_cmp_si(n,(long)ui)==0))
    5050    {
    51       L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)ui;
     51      L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)(long)ui;
    5252      return;
    5353    }
     
    6363  if ((((unsigned long)i)==ui) && (((i<<3)>>3)==i))
    6464  {
    65     L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)i;
     65    L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)(long)i;
    6666  }
    6767  else
  • Singular/pcv.cc

    r47e8b04 r87977c7  
    149149    {
    150150      res->rtyp=INT_CMD;
    151       res->data=(void*)pcvMinDeg((poly)h->Data());
     151      res->data=(void*)(long)pcvMinDeg((poly)h->Data());
    152152      return FALSE;
    153153    }
     
    156156    {
    157157      res->rtyp=INT_CMD;
    158       res->data=(void*)pcvMinDeg((matrix)h->Data());
     158      res->data=(void*)(long)pcvMinDeg((matrix)h->Data());
    159159      return FALSE;
    160160    }
     
    400400        int d1=(int)(long)h->Data();
    401401        res->rtyp=INT_CMD;
    402         res->data=(void*)pcvDim(d0,d1);
     402        res->data=(void*)(long)pcvDim(d0,d1);
    403403        return FALSE;
    404404      }
  • Singular/pyobject.cc

    r47e8b04 r87977c7  
    101101  {
    102102    // Sone python modules needs argc, argv set for some reason
    103     char* argv = "";
     103    char* argv = (char*)"";
    104104    PySys_SetArgv(1, &argv);
    105105    PyRun_SimpleString("from sys import path, modules");
     
    256256    PyErr_Fetch(&pType, &pMessage, &pTraceback);
    257257   
    258     Werror("pyobject error occured");
    259     Werror(PyString_AsString(pMessage));
     258    WerrorS("pyobject error occured");
     259    WerrorS(PyString_AsString(pMessage));
    260260   
    261261    Py_XDECREF(pType);
     
    580580    case '<': case '>': case EQUAL_EQUAL: case NOTEQUAL: case GE: case LE:
    581581    {
    582       res->data = (void *)lhs.compare(op, PythonCastDynamic(arg2));
     582      res->data = (void *)(long)(lhs.compare(op, PythonCastDynamic(arg2)));
    583583      res->rtyp = INT_CMD;
    584584      return FALSE;
  • Singular/singular-libs

    r47e8b04 r87977c7  
    4141# for new libs
    4242
    43 SLIB1 = ffsolve.lib decomp.lib template.lib findifs.lib finitediff.lib locnormal.lib modnormal.lib \
     43SLIB1 = classifyci.lib classify_aeq.lib ffsolve.lib decomp.lib template.lib\
     44        findifs.lib finitediff.lib \
     45        locnormal.lib modnormal.lib \
    4446        JMBTest.lib JMSConst.lib multigrading.lib parallel.lib realizationMatroids.lib ringgb.lib \
    4547        schreyer.lib symodstd.lib derham.lib polybori.lib
Note: See TracChangeset for help on using the changeset viewer.