Changeset 10ea86a in git for Singular/iparith.cc


Ignore:
Timestamp:
Feb 10, 2021, 2:21:22 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
128f6e114bf15118ac5e6486fce5d0b0c7b5d099
Parents:
ad3ce5bc5a80205609240191f75599c26d8da182
Message:
format, debug helper (option Imap)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    rad3ce5b r10ea86a  
    21522152    int par_perm_size=0;
    21532153    BOOLEAN bo;
    2154     if ((nMap=n_SetMap(r->cf,currRing->cf))==NULL)
     2154    nMap=n_SetMap(r->cf,currRing->cf);
     2155    if (nMap==NULL)
    21552156    {
    21562157      // Allow imap/fetch to be make an exception only for:
     
    21652166        goto err_fetch;
    21662167      }
     2168    }
     2169    else
     2170    {
     2171      par_perm_size=rPar(r);
    21672172    }
    21682173    if ((iiOp!=FETCH_CMD) || (r->N!=currRing->N) || (rPar(r)!=rPar(currRing)))
     
    22112216      }
    22122217    }
    2213     if ((iiOp==FETCH_CMD) &&(BVERBOSE(V_IMAP)))
     2218    if (BVERBOSE(V_IMAP))
    22142219    {
    22152220      unsigned i;
     
    79207925static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
    79217926{
    7922         unsigned i=1;
    7923         int l = 0;
    7924         int k = 0;
    7925         lists L = (lists)omAllocBin(slists_bin);
    7926         struct blackbox_list *bb_list = NULL;
    7927         unsigned nCount = (sArithBase.nCmdUsed-1) / 3;
    7928 
    7929         if ((3*nCount) < sArithBase.nCmdUsed) {
    7930                 nCount++;
    7931         }
    7932         bb_list = getBlackboxTypes();
    7933         // count the  number of entries;
    7934         for (i=0; i<nCount; i++) {
    7935                 l++;
    7936                 if (i + 1 + nCount < sArithBase.nCmdUsed) {
    7937                         l++;
    7938                 }
    7939                 if(i+1+2*nCount<sArithBase.nCmdUsed) {
    7940                         l++;
    7941                 }
    7942         }
    7943         for (i = 0; i < bb_list->count; i++) {
    7944                 if (bb_list->list[i] != NULL) {
    7945                         l++;
    7946                 }
    7947         }
    7948         // initiate list
    7949         L->Init(l);
    7950         k = 0;
    7951         for (i=0; i<nCount; i++) {
    7952                 L->m[k].rtyp = STRING_CMD;
    7953                 L->m[k].data = omStrDup(sArithBase.sCmds[i+1].name);
    7954                 k++;
    7955                 // Print("%-20s", sArithBase.sCmds[i+1].name);
    7956                 if (i + 1 + nCount < sArithBase.nCmdUsed) {
    7957                         L->m[k].rtyp = STRING_CMD;
    7958                         L->m[k].data = omStrDup(sArithBase.sCmds[i+1+nCount].name);
    7959                         k++;
    7960                         // Print("%-20s", sArithBase.sCmds[i+1 + nCount].name);
    7961                 }
    7962                 if(i+1+2*nCount<sArithBase.nCmdUsed) {
    7963                         L->m[k].rtyp = STRING_CMD;
    7964                         L->m[k].data = omStrDup(sArithBase.sCmds[i+1+2*nCount].name);
    7965                         k++;
    7966                         // Print("%-20s", sArithBase.sCmds[i+1+2*nCount].name);
    7967                 }
    7968                 // PrintLn();
    7969         }
    7970 
    7971         // assign blackbox types
    7972         for (i = 0; i < bb_list->count; i++) {
    7973                 if (bb_list->list[i] != NULL) {
    7974                         L->m[k].rtyp = STRING_CMD;
    7975                         // already used strdup in getBlackBoxTypes
    7976                         L->m[k].data = bb_list->list[i];
    7977                         k++;
    7978                 }
    7979         }
    7980         // free the struct (not the list entries itself, which were allocated
    7981         // by strdup)
    7982         omfree(bb_list->list);
    7983         omfree(bb_list);
    7984 
    7985         // pass the resultant list to the res datastructure
    7986         res->data=(void *)L;
    7987 
    7988         return FALSE;
     7927  unsigned i=1;
     7928  int l = 0;
     7929  int k = 0;
     7930  lists L = (lists)omAllocBin(slists_bin);
     7931  struct blackbox_list *bb_list = NULL;
     7932  unsigned nCount = (sArithBase.nCmdUsed-1) / 3;
     7933
     7934  if ((3*nCount) < sArithBase.nCmdUsed)
     7935  {
     7936    nCount++;
     7937  }
     7938  bb_list = getBlackboxTypes();
     7939  // count the  number of entries;
     7940  for (i=0; i<nCount; i++)
     7941  {
     7942    l++;
     7943    if (i + 1 + nCount < sArithBase.nCmdUsed)
     7944    {
     7945      l++;
     7946    }
     7947    if(i+1+2*nCount<sArithBase.nCmdUsed)
     7948    {
     7949      l++;
     7950    }
     7951  }
     7952  for (i = 0; i < bb_list->count; i++)
     7953  {
     7954    if (bb_list->list[i] != NULL)
     7955    {
     7956      l++;
     7957    }
     7958  }
     7959  // initiate list
     7960  L->Init(l);
     7961  k = 0;
     7962  for (i=0; i<nCount; i++)
     7963  {
     7964    L->m[k].rtyp = STRING_CMD;
     7965    L->m[k].data = omStrDup(sArithBase.sCmds[i+1].name);
     7966    k++;
     7967    // Print("%-20s", sArithBase.sCmds[i+1].name);
     7968    if (i + 1 + nCount < sArithBase.nCmdUsed)
     7969    {
     7970      L->m[k].rtyp = STRING_CMD;
     7971      L->m[k].data = omStrDup(sArithBase.sCmds[i+1+nCount].name);
     7972      k++;
     7973      // Print("%-20s", sArithBase.sCmds[i+1 + nCount].name);
     7974    }
     7975    if(i+1+2*nCount<sArithBase.nCmdUsed)
     7976    {
     7977      L->m[k].rtyp = STRING_CMD;
     7978      L->m[k].data = omStrDup(sArithBase.sCmds[i+1+2*nCount].name);
     7979      k++;
     7980      // Print("%-20s", sArithBase.sCmds[i+1+2*nCount].name);
     7981    }
     7982    // PrintLn();
     7983  }
     7984
     7985  // assign blackbox types
     7986  for (i = 0; i < bb_list->count; i++)
     7987  {
     7988    if (bb_list->list[i] != NULL)
     7989    {
     7990      L->m[k].rtyp = STRING_CMD;
     7991      // already used strdup in getBlackBoxTypes
     7992      L->m[k].data = bb_list->list[i];
     7993      k++;
     7994    }
     7995  }
     7996  // free the struct (not the list entries itself, which were allocated
     7997  // by strdup)
     7998  omfree(bb_list->list);
     7999  omfree(bb_list);
     8000
     8001  // pass the resultant list to the res datastructure
     8002  res->data=(void *)L;
     8003
     8004  return FALSE;
    79898005}
    79908006static BOOLEAN jjSTRING_PL(leftv res, leftv v)
Note: See TracChangeset for help on using the changeset viewer.