Changeset 1bc7201 in git


Ignore:
Timestamp:
Oct 19, 2012, 6:38:35 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
c879eea1669e963fb4c7287a3963abb287d00a49
Parents:
b37b3984a12e1552c7bafc9fd5a7849240ea79806bbe944402dfca102dcc3e036c4f2f119be41e44
Message:
Merge pull request #192 from mmklee/algExtGCD_sw

Alg ext gcd sw
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r6bbe94 r1bc7201  
    439439          #endif
    440440          #ifdef TEST_MAC_ORDER
    441             TEST_FOR("MAC_ORDER");
     441            TEST_FOR("MAC_ORDER")
    442442          #endif
    443443          // unconditional since 3-1-0-6
    444             TEST_FOR("Namespaces");
     444            TEST_FOR("Namespaces")
    445445          #ifdef HAVE_DYNAMIC_LOADING
    446             TEST_FOR("DynamicLoading");
     446            TEST_FOR("DynamicLoading")
    447447          #endif
    448448          #ifdef HAVE_EIGENVAL
    449             TEST_FOR("eigenval");
     449            TEST_FOR("eigenval")
    450450          #endif
    451451          #ifdef HAVE_GMS
    452             TEST_FOR("gms");
     452            TEST_FOR("gms")
    453453          #endif
    454454          #ifdef OM_NDEBUG
    455             TEST_FOR("om_ndebug");
     455            TEST_FOR("om_ndebug")
    456456          #endif
    457457          #ifdef NDEBUG
    458             TEST_FOR("ndebug");
     458            TEST_FOR("ndebug")
    459459          #endif
    460460            ;
     
    22972297           test_PosInL=NULL;
    22982298         }
    2299          verbose|=Sy_bit(23);
     2299         si_opt_2|=Sy_bit(23);
    23002300         return FALSE;
    23012301      }
     
    26482648        if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    26492649        {
    2650           int i=0;
    26512650          if (h->next!=NULL)
    26522651          {
     
    26702669        if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    26712670        {
    2672           int i=0;
    26732671          if (h->next!=NULL)
    26742672          {
     
    30643062      if (strcmp(sys_cmd, "minor")==0)
    30653063      {
    3066         ring r = currRing;
    30673064        matrix a = (matrix) h->Data();
    30683065        h = h->next;
     
    33213318      {
    33223319        int start,end;
    3323         int is;
    33243320        if ((h!=NULL) && (h->Typ()==POLY_CMD))
    33253321        {
     
    34263422      if (strcmp(sys_cmd, "unifastmult")==0)
    34273423      {
    3428         ring r = currRing;
    34293424        poly f = (poly)h->Data();
    34303425        h=h->next;
     
    34373432      if (strcmp(sys_cmd, "multifastmult")==0)
    34383433      {
    3439         ring r = currRing;
    34403434        poly f = (poly)h->Data();
    34413435        h=h->next;
     
    34663460      if (strcmp(sys_cmd, "normalpower")==0)
    34673461      {
    3468         ring r = currRing;
    34693462        poly f = (poly)h->Data();
    34703463        h=h->next;
  • Singular/feOpt.cc

    r6bbe94 r1bc7201  
    219219      case FE_OPT_QUIET:
    220220        if (feOptSpec[FE_OPT_QUIET].value)
    221           verbose &= ~(Sy_bit(0)|Sy_bit(V_LOAD_LIB));
    222         else
    223           verbose |= Sy_bit(V_LOAD_LIB)|Sy_bit(0);
     221          si_opt_2 &= ~(Sy_bit(0)|Sy_bit(V_LOAD_LIB));
     222        else
     223          si_opt_2 |= Sy_bit(V_LOAD_LIB)|Sy_bit(0);
    224224        return NULL;
    225225
  • Singular/iparith.cc

    r6bbe94 r1bc7201  
    24902490static BOOLEAN jjLIFT(leftv res, leftv u, leftv v)
    24912491{
    2492   BITSET save_test=test;
    24932492  int ul= IDELEMS((ideal)u->Data());
    24942493  int vl= IDELEMS((ideal)v->Data());
     
    24972496  if (m==NULL) return TRUE;
    24982497  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
    2499   test=save_test;
    25002498  return FALSE;
    25012499}
     
    34163414      }
    34173415    }
    3418     BITSET save_test=test;
    3419     test|=Sy_bit(OPT_SB_1);
     3416    BITSET save1;
     3417    SI_SAVE_OPT1(save1);
     3418    si_opt_1|=Sy_bit(OPT_SB_1);
    34203419    /* ii0 appears to be the position of the first element of il that
    34213420       does not belong to the old SB ideal */
    34223421    result=kStd(i1,currQuotient,hom,&w,NULL,0,ii0);
    3423     test=save_test;
     3422    SI_RESTORE_OPT1(save1);
    34243423    idDelete(&i1);
    34253424    idSkipZeroes(result);
     
    64136412{
    64146413  if (w->rtyp!=IDHDL) return TRUE;
    6415   BITSET save_test=test;
    64166414  int ul= IDELEMS((ideal)u->Data());
    64176415  int vl= IDELEMS((ideal)v->Data());
     
    64216419  if (m==NULL) return TRUE;
    64226420  res->data = (char *)id_Module2formatedMatrix(m,ul,vl,currRing);
    6423   test=save_test;
    64246421  return FALSE;
    64256422}
     
    72377234    Kstd1_deg=(int)(long)u3->Data();
    72387235    kModW=(intvec *)u4->Data();
    7239     BITSET save=verbose;
    7240     verbose|=Sy_bit(V_DEG_STOP);
     7236    BITSET save2;
     7237    SI_SAVE_OPT2(save2);
     7238    si_opt_2|=Sy_bit(V_DEG_STOP);
    72417239    u2->next=NULL;
    72427240    BOOLEAN r=jjCALL2ARG(res,u);
    72437241    kModW=NULL;
    72447242    Kstd1_deg=save_d;
    7245     verbose=save;
     7243    SI_RESTORE_OPT2(save2);
    72467244    u->next->next=u3;
    72477245    return r;
     
    76517649    i0=idInit(1,i1->rank);
    76527650    i0->m[0]=(poly)v->Data();
    7653     BOOLEAN cleanup_i0=TRUE;
     7651    cleanup_i0=TRUE;
    76547652  }
    76557653  else if (r==IDEAL_CMD)/* IDEAL */
     
    76857683    }
    76867684  }
    7687   BITSET save_test=test;
    7688   test|=Sy_bit(OPT_SB_1);
     7685  BITSET save1;
     7686  SI_SAVE_OPT1(save1);
     7687  si_opt_1|=Sy_bit(OPT_SB_1);
    76897688  result=kStd(i1,
    76907689              currQuotient,
     
    76957694              IDELEMS(i1)-ii0,      // new ideal
    76967695              vw);                  // weights of vars
    7697   test=save_test;
     7696  SI_RESTORE_OPT1(save1);
    76987697  idDelete(&i1);
    76997698  idSkipZeroes(result);
  • Singular/ipassign.cc

    r6bbe94 r1bc7201  
    9292  Kstd1_deg=(int)((long)(a->Data()));
    9393  if (Kstd1_deg!=0)
    94     test |=Sy_bit(OPT_DEGBOUND);
     94    si_opt_1 |=Sy_bit(OPT_DEGBOUND);
    9595  else
    96     test &=(~Sy_bit(OPT_DEGBOUND));
    97   return FALSE;
    98 }
    99 static BOOLEAN jjMAXMULT(leftv res, leftv a)
     96    si_opt_1 &=(~Sy_bit(OPT_DEGBOUND));
     97  return FALSE;
     98}
     99static BOOLEAN jjMAXMULT(leftv, leftv a)
    100100{
    101101  Kstd1_mu=(int)((long)(a->Data()));
    102102  if (Kstd1_mu!=0)
    103     test |=Sy_bit(OPT_MULTBOUND);
     103    si_opt_1 |=Sy_bit(OPT_MULTBOUND);
    104104  else
    105     test &=(~Sy_bit(OPT_MULTBOUND));
     105    si_opt_1 &=(~Sy_bit(OPT_MULTBOUND));
    106106  return FALSE;
    107107}
     
    381381  return FALSE;
    382382}
    383 static BOOLEAN jiA_NUMBER(leftv res, leftv a, Subexpr e)
     383static BOOLEAN jiA_NUMBER(leftv res, leftv a, Subexpr)
    384384{
    385385  number p=(number)a->CopyD(NUMBER_CMD);
     
    430430  return FALSE;
    431431}
    432 static BOOLEAN jiA_LIST_RES(leftv res, leftv a,Subexpr e)
     432static BOOLEAN jiA_LIST_RES(leftv res, leftv a,Subexpr)
    433433{
    434434  syStrategy r=(syStrategy)a->CopyD(RESOLUTION_CMD);
     
    441441  return FALSE;
    442442}
    443 static BOOLEAN jiA_LIST(leftv res, leftv a,Subexpr e)
     443static BOOLEAN jiA_LIST(leftv res, leftv a,Subexpr)
    444444{
    445445  lists l=(lists)a->CopyD(LIST_CMD);
     
    565565  return FALSE;
    566566}
    567 static BOOLEAN jiA_PROC(leftv res, leftv a, Subexpr e)
     567static BOOLEAN jiA_PROC(leftv res, leftv a, Subexpr)
    568568{
    569569  extern procinfo *iiInitSingularProcinfo(procinfo *pi, const char *libname,
     
    585585  return FALSE;
    586586}
    587 static BOOLEAN jiA_INTVEC(leftv res, leftv a, Subexpr e)
     587static BOOLEAN jiA_INTVEC(leftv res, leftv a, Subexpr)
    588588{
    589589  //if ((res->data==NULL) || (res->Typ()==a->Typ()))
     
    608608#endif
    609609}
    610 static BOOLEAN jiA_BIGINTMAT(leftv res, leftv a, Subexpr e)
     610static BOOLEAN jiA_BIGINTMAT(leftv res, leftv a, Subexpr)
    611611{
    612612  if (res->data!=NULL) delete ((bigintmat *)res->data);
     
    615615  return FALSE;
    616616}
    617 static BOOLEAN jiA_IDEAL(leftv res, leftv a, Subexpr e)
     617static BOOLEAN jiA_IDEAL(leftv res, leftv a, Subexpr)
    618618{
    619619  if (res->data!=NULL) idDelete((ideal*)&res->data);
     
    633633  return FALSE;
    634634}
    635 static BOOLEAN jiA_RESOLUTION(leftv res, leftv a, Subexpr e)
     635static BOOLEAN jiA_RESOLUTION(leftv res, leftv a, Subexpr)
    636636{
    637637  if (res->data!=NULL) syKillComputation((syStrategy)res->data);
     
    640640  return FALSE;
    641641}
    642 static BOOLEAN jiA_MODUL_P(leftv res, leftv a, Subexpr e)
     642static BOOLEAN jiA_MODUL_P(leftv res, leftv a, Subexpr)
    643643{
    644644  if (res->data!=NULL) idDelete((ideal*)&res->data);
     
    655655  return FALSE;
    656656}
    657 static BOOLEAN jiA_IDEAL_M(leftv res, leftv a, Subexpr e)
     657static BOOLEAN jiA_IDEAL_M(leftv res, leftv a, Subexpr)
    658658{
    659659  if (res->data!=NULL) idDelete((ideal*)&res->data);
     
    667667  return FALSE;
    668668}
    669 static BOOLEAN jiA_LINK(leftv res, leftv a, Subexpr e)
     669static BOOLEAN jiA_LINK(leftv res, leftv a, Subexpr)
    670670{
    671671  si_link l=(si_link)res->data;
     
    691691}
    692692// assign map -> map
    693 static BOOLEAN jiA_MAP(leftv res, leftv a, Subexpr e)
     693static BOOLEAN jiA_MAP(leftv res, leftv a, Subexpr)
    694694{
    695695  if (res->data!=NULL)
     
    704704}
    705705// assign ideal -> map
    706 static BOOLEAN jiA_MAP_ID(leftv res, leftv a, Subexpr e)
     706static BOOLEAN jiA_MAP_ID(leftv res, leftv a, Subexpr)
    707707{
    708708  map f=(map)res->data;
     
    812812  return FALSE;
    813813}
    814 static BOOLEAN jiA_PACKAGE(leftv res, leftv a, Subexpr e)
     814static BOOLEAN jiA_PACKAGE(leftv res, leftv a, Subexpr)
    815815{
    816816  res->data=(void *)a->CopyD(PACKAGE_CMD);
     
    18801880  }
    18811881}
    1882 BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v)
     1882BOOLEAN jjIMPORTFROM(leftv, leftv u, leftv v)
    18831883{
    18841884  //Print("importfrom %s::%s ->.\n",v->Name(),u->Name() );
  • Singular/ipshell.cc

    r6bbe94 r1bc7201  
    426426  BOOLEAN all = typ<0;
    427427  BOOLEAN really_all=FALSE;
    428   BOOLEAN do_packages=FALSE;
    429 
    430   if ( typ == -1 ) do_packages=TRUE;
     428
    431429  if ( typ==0 )
    432430  {
     
    508506    if (ii < 32)
    509507    {
    510       test &= ~Sy_bit(ii);
     508      si_opt_1 &= ~Sy_bit(ii);
    511509    }
    512510    else if (ii < 64)
    513511    {
    514       verbose &= ~Sy_bit(ii-32);
     512      si_opt_2 &= ~Sy_bit(ii-32);
    515513    }
    516514    else
     
    523521    {
    524522      Warn("Gerhard, use the option command");
    525       test |= Sy_bit(ii);
     523      si_opt_1 |= Sy_bit(ii);
    526524    }
    527525    else if (Sy_bit(ii) & validOpts)
    528       test |= Sy_bit(ii);
     526      si_opt_1 |= Sy_bit(ii);
    529527  }
    530528  else if (i<64)
    531529  {
    532530    ii=i-32;
    533     verbose |= Sy_bit(ii);
     531    si_opt_2 |= Sy_bit(ii);
    534532  }
    535533  else
     
    25302528          {
    25312529            par_perm_size=rPar(orig_ring);
    2532             BITSET save_test=test;
    25332530
    25342531//            if ((orig_ring->minpoly != NULL) || (orig_ring->qideal != NULL))
     
    25372534
    25382535            nSetChar(currRing->cf);
    2539             test=save_test;
    25402536          }
    25412537          else
     
    50555051  int float_len2=0;
    50565052  ring R = NULL;
    5057   BOOLEAN ffChar=FALSE;
     5053  //BOOLEAN ffChar=FALSE;
    50585054
    50595055  /* ch -------------------------------------------------------*/
     
    52515247  else
    52525248  {
    5253     sleftv* p = pn;
    52545249    Werror("Wrong or unknown ground field specification");
    52555250#ifndef NDEBUG
     5251    sleftv* p = pn;
    52565252    while (p != NULL)
    52575253    {
  • Singular/links/ndbm.cc

    r6bbe94 r1bc7201  
    6161static  datum makdatum(char buf[PBLKSIZ], int n);
    6262static  int finddatum(char buf[PBLKSIZ], datum item);
    63 static  long hashinc(register DBM *db, long hash);
    6463static  long dcalchash(datum item);
    6564static  int delitem(char buf[PBLKSIZ], int n);
     
    449448};
    450449
    451 static long hashinc(register DBM *db, long hash)
    452 {
    453   long bit;
    454 
    455   hash &= db->dbm_hmask;
    456   bit = db->dbm_hmask+1;
    457   for (;;)
    458   {
    459     bit >>= 1;
    460     if (bit == 0)
    461       return (0L);
    462     if ((hash & bit) == 0)
    463       return (hash | bit);
    464     hash &= ~bit;
    465   }
    466 }
    467 
    468450static long dcalchash(datum item)
    469451{
  • Singular/links/silink.cc

    r6bbe94 r1bc7201  
    236236leftv slRead(si_link l, leftv a)
    237237{
    238   char *mode;
    239238  leftv v = NULL;
    240239  if( ! SI_LINK_R_OPEN_P(l)) // open r ?
     
    381380
    382381/* =============== ASCII ============================================= */
    383 BOOLEAN slOpenAscii(si_link l, short flag, leftv h)
     382BOOLEAN slOpenAscii(si_link l, short flag, leftv)
    384383{
    385384  const char *mode;
     
    546545
    547546  if (currRingHdl != rh) rSetHdl(rh);
    548   fprintf(fd, "option(set, intvec(%d, %d));\n", test, verbose);
     547  fprintf(fd, "option(set, intvec(%d, %d));\n", si_opt_1, si_opt_2);
    549548  fprintf(fd, "RETURN();\n");
    550549  fflush(fd);
     
    665664        lists l = IDLIST(h);
    666665        int i, nl = l->nr + 1;
    667         char *name;
    668666
    669667        for (i=0; i<nl; i++)
     
    740738  else  if (type_id == STRING_CMD)
    741739  {
    742     char *pstr = IDSTRING(h), c;
     740    char *pstr = IDSTRING(h);
    743741    fputc('"', fd);
    744742    while (*pstr != '\0')
     
    753751  {
    754752    procinfov pi = IDPROC(h);
    755     if (pi->language == LANG_SINGULAR) {
     753    if (pi->language == LANG_SINGULAR)
     754    {
    756755      if( pi->data.s.body==NULL) iiGetLibProcBuffer(pi);
    757       char *pstr = pi->data.s.body, c;
     756      char *pstr = pi->data.s.body;
    758757      fputc('"', fd);
    759       while (*pstr != '\0') {
     758      while (*pstr != '\0')
     759      {
    760760        if (*pstr == '"' || *pstr == '\\') fputc('\\', fd);
    761761        fputc(*pstr, fd);
     
    763763      }
    764764      fputc('"', fd);
    765     } else fputs("(null)", fd);
     765    }
     766    else fputs("(null)", fd);
    766767  }
    767768  else
  • Singular/links/ssiLink.cc

    r6bbe94 r1bc7201  
    243243}
    244244
    245 void ssiWritePoly(ssiInfo *d, int typ, poly p)
     245void ssiWritePoly(ssiInfo *d, poly p)
    246246{
    247247  SSI_BLOCK_CHLD;
     
    267267void ssiWriteIdeal(ssiInfo *d, int typ,ideal I)
    268268{
    269    // syntax: 7 # of elements <poly 1> <poly2>.....
    270    // syntax: 8 <rows> <cols> <poly 1> <poly2>.....
     269   // syntax ideal/module: 7 # of elements <poly 1> <poly2>.....
     270   // syntax matrix: 8 <rows> <cols> <poly 1> <poly2>.....
    271271   matrix M=(matrix)I;
    272272   SSI_BLOCK_CHLD;
     
    278278
    279279   int i;
    280    int tt;
    281    if (typ==MODUL_CMD) tt=VECTOR_CMD;
    282    else                tt=POLY_CMD;
    283280
    284281   for(i=0;i<IDELEMS(I);i++)
    285282   {
    286      ssiWritePoly(d,tt,I->m[i]);
     283     ssiWritePoly(d,I->m[i]);
    287284   }
    288285}
     
    516513  //Print("poly: terms:%d\n",n);
    517514  poly p;
    518   int j;
    519   j=0;
    520515  poly ret=NULL;
    521516  poly prev=NULL;
     
    944939        SI_LINK_SET_RW_OPEN_P(l);
    945940        d->send_quit_at_exit=1;
    946         fprintf(d->f_write,"98 %d %d %u %u\n",SSI_VERSION,MAX_TOK,test,verbose);
     941        fprintf(d->f_write,"98 %d %d %u %u\n",SSI_VERSION,MAX_TOK,si_opt_1,si_opt_2);
    947942      }
    948943      // ----------------------------------------------------------------------
     
    10211016          {
    10221017            d->f_write = outfile;
    1023             fprintf(d->f_write,"98 %d %d %u %u\n",SSI_VERSION,MAX_TOK,test,verbose);
     1018            fprintf(d->f_write,"98 %d %d %u %u\n",SSI_VERSION,MAX_TOK,si_opt_1,si_opt_2);
    10241019          }
    10251020        }
     
    12101205                  Print("// opening ssi-%d, MAX_TOK=%d\n",n98_v,n98_m);
    12111206                #endif
    1212                 test=n98_o1;
    1213                 verbose=n98_o2;
     1207                si_opt_1=n98_o1;
     1208                si_opt_2=n98_o2;
    12141209                return ssiRead1(l);
    12151210             }
     
    12801275                        if(tt==POLY_CMD) fputs("6 ",d->f_write);
    12811276                        else             fputs("9 ",d->f_write);
    1282                         ssiWritePoly(d,tt,(poly)dd);
     1277                        ssiWritePoly(d,(poly)dd);
    12831278                        break;
    12841279          case IDEAL_CMD:
     
    17961791**/
    17971792/*---------------------------------------------------------------------*/
    1798 void sig_chld_hdl(int sig)
     1793void sig_chld_hdl(int)
    17991794{
    18001795  pid_t kidpid;
  • Singular/misc_ip.cc

    r6bbe94 r1bc7201  
    562562    {
    563563      intvec *w=new intvec(2);
    564       (*w)[0]=test;
    565       (*w)[1]=verbose;
     564      (*w)[0]=si_opt_1;
     565      (*w)[1]=si_opt_2;
    566566      res->rtyp=INTVEC_CMD;
    567567      res->data=(void *)w;
     
    575575        v=v->next;
    576576        intvec *w=(intvec*)v->Data();
    577         test=(*w)[0];
    578         verbose=(*w)[1];
     577        si_opt_1=(*w)[0];
     578        si_opt_2=(*w)[1];
    579579#if 0
    580580        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
     
    584584#endif
    585585        ) {
    586           test &=~Sy_bit(OPT_INTSTRATEGY);
     586          si_opt_1 &=~Sy_bit(OPT_INTSTRATEGY);
    587587        }
    588588#endif
     
    592592    if(strcmp(n,"none")==0)
    593593    {
    594       test=0;
    595       verbose=0;
     594      si_opt_1=0;
     595      si_opt_2=0;
    596596      goto okay;
    597597    }
     
    602602        if (optionStruct[i].setval & validOpts)
    603603        {
    604           test |= optionStruct[i].setval;
     604          si_opt_1 |= optionStruct[i].setval;
    605605          // optOldStd disables redthrough
    606606          if (optionStruct[i].setval == Sy_bit(OPT_OLDSTD))
    607             test &= ~Sy_bit(OPT_REDTHROUGH);
     607            si_opt_1 &= ~Sy_bit(OPT_REDTHROUGH);
    608608        }
    609609        else
     
    626626        if (optionStruct[i].setval & validOpts)
    627627        {
    628           test &= optionStruct[i].resetval;
     628          si_opt_1 &= optionStruct[i].resetval;
    629629        }
    630630        else
     
    637637      if (strcmp(n,verboseStruct[i].name)==0)
    638638      {
    639         verbose |= verboseStruct[i].setval;
     639        si_opt_2 |= verboseStruct[i].setval;
    640640        #ifdef YYDEBUG
    641641        #if YYDEBUG
     
    651651      && (strcmp(n+2,verboseStruct[i].name)==0))
    652652      {
    653         verbose &= verboseStruct[i].resetval;
     653        si_opt_2 &= verboseStruct[i].resetval;
    654654        #ifdef YYDEBUG
    655655        #if YYDEBUG
     
    666666  okay:
    667667    if (currRing != NULL)
    668       currRing->options = test & TEST_RINGDEP_OPTS;
     668      currRing->options = si_opt_1 & TEST_RINGDEP_OPTS;
    669669    omFree((ADDRESS)n);
    670670    v=v->next;
     
    687687
    688688  StringSetS("//options:");
    689   if ((test!=0)||(verbose!=0))
    690   {
    691     tmp=test;
     689  if ((si_opt_1!=0)||(si_opt_2!=0))
     690  {
     691    tmp=si_opt_1;
    692692    if(tmp)
    693693    {
    694694      for (i=0; optionStruct[i].setval!=0; i++)
    695695      {
    696         if (optionStruct[i].setval & test)
     696        if (optionStruct[i].setval & tmp)
    697697        {
    698698          StringAppend(" %s",optionStruct[i].name);
     
    705705      }
    706706    }
    707     tmp=verbose;
     707    tmp=si_opt_2;
    708708    if (tmp)
    709709    {
     
    723723    return omStrDup(StringAppendS(""));
    724724  }
    725   else
    726     return omStrDup(StringAppendS(" none"));
     725  return omStrDup(StringAppendS(" none"));
    727726}
    728727
     
    11441143  if (! feOptValue(FE_OPT_NO_STDLIB))
    11451144  {
    1146     int vv=verbose;
    1147     verbose &= ~Sy_bit(V_LOAD_LIB);
     1145    BITSET save1,save2;
     1146    SI_SAVE_OPT(save1,save2);
     1147    si_opt_2 &= ~Sy_bit(V_LOAD_LIB);
    11481148    iiLibCmd(omStrDup("standard.lib"), TRUE,TRUE,TRUE);
    1149     verbose=vv;
     1149    SI_RESTORE_OPT(save1,save2);
    11501150  }
    11511151  errorreported = 0;
  • Singular/walk.cc

    r6bbe94 r1bc7201  
    123123}
    124124
     125#if 0 /*unused*/
    125126/*2
    126127*construct the set s from F u {P}
     
    273274#endif
    274275}
     276#endif
    275277
    276278/*2
     
    351353}
    352354
     355#if 0 /*unused*/
    353356static void TimeString(clock_t tinput, clock_t tostd, clock_t tif,clock_t tstd,
    354357                       clock_t tlf,clock_t tred, clock_t tnw, int step)
     
    388391        ((((double) xtextra)/1000000)/totm)*100);
    389392}
    390 
     393#endif
     394
     395#if 0 /*unused*/
    391396static void TimeStringFractal(clock_t tinput, clock_t tostd, clock_t tif,clock_t tstd,
    392397                       clock_t textra, clock_t tlf,clock_t tred, clock_t tnw)
     
    415420        ostd,totm,mostd,mif,mstd,mextra,mlf,mred,mnw,tot,res);
    416421}
     422#endif
    417423
    418424static void idString(ideal L, const char* st)
     
    427433}
    428434
     435#if 0 /*unused*/
    429436static void headidString(ideal L, char* st)
    430437{
     
    437444  Print(" %s;", pString(pHead(L->m[nL-1])));
    438445}
    439 
     446#endif
     447
     448#if 0 /*unused*/
    440449static void idElements(ideal L, char* st)
    441450{
     
    467476  omFree(K);
    468477}
    469 
     478#endif
    470479
    471480
     
    481490}
    482491
     492#if 0 /*unused*/
    483493static void MivString(intvec* iva, intvec* ivb, intvec* ivc)
    484494{
     
    498508  Print("%d)", (*ivc)[nV]);
    499509}
    500 
     510#endif
    501511
    502512// returns gcd of integers a and b
     
    534544}
    535545
     546#if 0 /*unused*/
    536547/* 23.07.03 */
    537548static int isVectorNeg(intvec* omega)
     
    545556  return 0;
    546557}
     558#endif
    547559
    548560/********************************************************************
     
    826838static ideal MstdCC(ideal G)
    827839{
    828   int save_test=test;
    829   test|=(Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_REDSB));
     840  BITSET save1,save2;
     841  SI_SAVE_OPT(save1,save2);
     842  si_opt_1|=(Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_REDSB));
    830843  ideal G1 = kStd(G, NULL, testHomog, NULL);
    831   test=save_test;
     844  SI_RESTORE_OPT(save1,save2);
    832845
    833846  idSkipZeroes(G1);
     
    839852static ideal MstdhomCC(ideal G)
    840853{
    841   int save_test=test;
    842   test|=(Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_REDSB));
     854  BITSET save1,save2;
     855  SI_SAVE_OPT(save1,save2);
     856  si_opt_1|=(Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_REDSB));
    843857  ideal G1 = kStd(G, NULL, isHomog, NULL);
    844   test=save_test;
     858  SI_RESTORE_OPT(save1,save2);
    845859
    846860  idSkipZeroes(G1);
     
    889903
    890904/**** 28.10.02  print the max total degree and the max coefficient of G***/
     905#if 0 /*unused*/
    891906static void checkComplexity(ideal G, char* cG)
    892907{
     
    924939  PrintLn();
    925940}
    926 
     941#endif
    927942
    928943
     
    12321247}
    12331248
     1249#if 0 /*unused*/
    12341250static intvec* MatrixOrderdp(int nV)
    12351251{
     
    12451261  return(ivM);
    12461262}
     1263#endif
    12471264
    12481265intvec* MivUnit(int nV)
     
    14641481
    14651482
     1483#if 0 /*unused*/
    14661484static void checkidealCC(ideal G, char* Ch)
    14671485{
     
    14851503  PrintLn();
    14861504}
    1487 
     1505#endif
     1506
     1507#if 0 /*unused*/
    14881508static void HeadidString(ideal L, char* st)
    14891509{
     
    14961516  Print(" %s;\n", pString(pHead(L->m[nL])));
    14971517}
     1518#endif
    14981519
    14991520static inline int MivComp(intvec* iva, intvec* ivb)
     
    21042125}
    21052126
     2127#if 0 /*unused*/
    21062128/* check wheather one or more components of a vector are zero */
    21072129static int isNolVector(intvec* hilb)
     
    21142136  return 0;
    21152137}
     2138#endif
    21162139
    21172140
     
    24592482}
    24602483
     2484#if 0 /*unused*/
    24612485/* 19.11.01 */
    24622486/* find the maximal total degree of polynomials in G */
     
    24782502  return result;
    24792503}
     2504#endif
    24802505
    24812506/* perturb the weight vector iva w.r.t. the ideal G.
     
    24862511*/
    24872512
     2513#if 0 /*unused*/
    24882514//GMP
    24892515static intvec* TranPertVector(ideal G, intvec* iva)
     
    26122638  return repr_vector;
    26132639}
    2614 
    2615 
    2616 
     2640#endif
     2641
     2642
     2643
     2644#if 0 /*unused*/
    26172645static intvec* TranPertVector_lp(ideal G)
    26182646{
     
    27022730  return repr_vector;
    27032731}
    2704 
    2705 
     2732#endif
     2733
     2734
     2735#if 0 /*unused*/
    27062736//GMP
    27072737static intvec* RepresentationMatrix_Dp(ideal G, intvec* M)
     
    27892819  return repvector;
    27902820}
     2821#endif
    27912822
    27922823
     
    28042835
    28052836// 19 Juni 2003
     2837#if 0 /* unused*/
    28062838static int testnegintvec(intvec* v)
    28072839{
     
    28142846  return(0);
    28152847}
     2848#endif
    28162849
    28172850
  • Singular/walk_ip.cc

    r6bbe94 r1bc7201  
    6464{
    6565    WalkState state = WalkOk;
    66     BITSET saveTest=test;
    67     test &= (~Sy_bit(OPT_REDSB)); //make sure option noredSB is set
     66    BITSET save1,save2;
     67    SI_SAVE_OPT(save1,save2);
     68    si_opt_1 &= (~Sy_bit(OPT_REDSB)); //make sure option noredSB is set
    6869
    6970    ring destRing = currRing;
     
    108109    }
    109110
    110     test=saveTest;//making sure options are as before function call
     111    SI_RESTORE_OPT(save1,save2);//making sure options are as before function call
    111112
    112113    ring almostDestRing=currRing;
     
    177178
    178179    WalkState state = WalkOk;
    179     BITSET saveTest=test;
    180     test &= (~Sy_bit(OPT_REDSB)); //make sure option noredSB is set
     180    BITSET save1,save2;
     181    SI_SAVE_OPT(save1,save2);
     182    si_opt_1 &= (~Sy_bit(OPT_REDSB)); //make sure option noredSB is set
    181183
    182184    ring destRing = currRing;
     
    212214    }
    213215
    214     test=saveTest;//making sure options are as before functiocall
     216    SI_RESTORE_OPT(save1,save2);//making sure options are as before functiocall
    215217
    216218     if ( state == WalkOk )
  • Tst/Short/bug_55.res.gz.uu

    r6bbe94 r1bc7201  
    1 begin 640 bug_55.res.gz
    2 M'XL(")QK;4H``V)U9U\U-2YR97,`[57/;YLP%+[S5SQ5DPI-XL4&3$(4#MLN
    3 MJ:I-:JH=5G45`3>Q1@!ADPZI?_QLAT!%]N.TR[1W,/;S][[W_/`GK^\^K#X"
    4 M`([@9O4.+J20*..;BX6U;G=(!,KYR',N;6=AZ2]$$6SJ[:/OHYP](R%CV<'=
    5 M"+JYA^#M6XT$GH,HL@/KMGRD\UT8YR`AC:#B^1:JY73<C-.RWPDBX"F+,U@M
    6 M&SKR:..-?#)OR`@33(,>-XN@*"4O<KNL"NGT&_-(%R1V19VEL.4'!E3756NL
    7 MT$6^/T'Q%!TKME<J_IY@+_!F+O6"$#]08=GK<.I8%C(VL@XIWR^!]FMMGP=A
    8 MOJ#"1X'PT$RX:"X(PE.!!Z".>M+:2S^Q[O%#:*ECV!."Z)SZ\V"&1_S*13B@
    9 M/B73P%%LYY#)`.*V$'Y%D>N[F'C84V[O%#GP^ZW_UX3T##&HRE)=OS3MO(2D
    10 M8K%D*<3F+X]UUY]W/-DI1\:%A/6G&RB>(*_W&U8)L.6.05+LRXQ][_^5HQFY
    11 M`"&+BJ5(K^X*B).$"0$ZPE`IFK/(,<BF9.KP3P:7QWL&M_`<"XB%X-N<I9I,
    12 M%F:W8K*N<CC$6<T<<T9C@DES0V\7NMH%Z`B`9!=7<2)9I5+S!$*8@MVF#V>0
    13 M\BV7*GN<IEP7HF[QR>D<XS&4BF#/%(-.$@)OB?<\+XNL.64/5?%?U9UOPXZ-
    14 MTF<]Q*I?(>"CW]@F*Y)OACN$HDJ9*3LK7R%Z"TTSA)XV/Z$@KREZG>"3)J^7
    15 M=C/!SI4:B1E=,WIF],U(>REB\B<I?NF@[DF*UW]7B@C_7HTO`TV^G`D3=_HC
    16 LG<S<3EE>IR6_TPS]KXU_5QM>_Q9B]>#I9U2_E;6PL;-X8_T`7=GBXWP'````
     1begin 644 bug_55.res.gz
     2M'XL("/+2?U```V)U9U\U-2YR97,`[57+;MLP$+SK*Q9!@4BQS9AZ4+8,Z]#V
     3MXB!H@3CHH4$:R!)C$Y5%0:2<"LC'EZ3U".P6/?52=`\4N9R=7:XXX/K^X^H3
     4M`.`8;E?OX4(*B7*VN5A8ZW;'C4$YGUC!I.TL+/V%.(9-O7T*`E30%R1D(GNX
     5M%T,_]Q%<7VLDL`($SP^TWPJ0SG=AG"<)20P5*[90+:?C9IR5PTX8`\MHDL-J
     6MV9"13QI_%+CSQAUA%Y-PP,UBX*5DO+#+BDMGV)C'NB"QXW6>P98=*!!=5ZVQ
     7M0A?YH8/B*3I6;*]4_(.+_="?><0/(_Q(A&6OHZEC6<C8R#ID;+\$,JRU?3D)
     8M"P01`0J%CV;"0W/A(CP5V+(FK;T.$^L!/T:6*MB>N(C,23`/9WC$KCR$0Q(0
     9M=QHZBOP<,CF!>"V$71'D!1YV?>PKM]]%GOB#UO][0G*&.*G*4OV]-(V[A+2B
     10MB:09).9_CG5_7W8LW2E'SH2$]>=;X,]0U/L-K038<D<AY?LRIS^&O^)H1B9`
     11M2%[1#.G5/8<D3:D0H",,E:(YBQR#;$JJ#O]L<$6RIW`'+XF`1`BV+6BFR20W
     12MNQ65=57`(<EKZI@S&A-4FKMXM]#5+D!'`*2[I$I222N5FJ40P13L-GTT@XQM
     13MF539DRQCNA!U7SNG<XS'4"J"/54,.DD$K"7>LZ+D>=-ECU3QW]3M;L..C=)G
     14M/22J7Q'@H]_8)N?I=\,=`:\R:LK.RS>(P2+3#*&GS2\HW+<4@R)PI[Z;I=U,
     15ML'.E1M>,GAE],P9F)(/HL/LGT7WMH5XGNIN_*SJ$.]V]GJCO]4R"N%>:VPO*
     16IZS7D]ZH)>G60_RKX=U7@#^\;5H^8?AKU^U<+&SN+=]9/YL0I)U`'````
    1717`
    1818end
  • Tst/Short/bug_55.stat

    r6bbe94 r1bc7201  
    1 1 >> tst_memory_0 :: 1248684956:3104-2009072709:3-1-0:ix86-Linux:nepomuck:229764 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:242880
    2 1 >> tst_memory_1 :: 1248684956:3104-2009072709:3-1-0:ix86-Linux:nepomuck:748056 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:682684
    3 1 >> tst_memory_2 :: 1248684956:3104-2009072709:3-1-0:ix86-Linux:nepomuck:748056 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:751584
    4 1 >> tst_timer_1 :: 1248684956:3104-2009072709:3-1-0:ix86-Linux:nepomuck:6 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:11
     11 >> tst_memory_0 :: 1350554354:0- spielwiese :spielwiese:version:mamawutz:192636
     21 >> tst_memory_1 :: 1350554354:0- spielwiese :spielwiese:version:mamawutz:655360
     31 >> tst_memory_2 :: 1350554354:0- spielwiese :spielwiese:version:mamawutz:707456
     41 >> tst_timer_1 :: 1350554354:0- spielwiese :spielwiese:version:mamawutz:7
  • Tst/Short/bug_qring.res.gz.uu

    r6bbe94 r1bc7201  
    1 begin 640 bug_qring.res.gz
    2 M'XL("*+AGDX``V)U9U]Q<FEN9RYR97,`K51-;Z,P$+WG5XRJ/4!P*)BDS8?@
    3 MT%U5JK3*)7M;-9$=2-?:!!(PK,BO[X#YBAJJ5EVDQ)8]\^;-FQFO?OUX6@*`
    4 M[<'/IP>XD8DT]X+?+`:KZH9Z@(<;$0JIZ8M!L8+G`4]?-J=8A"]F&/PS$\ED
    5 MX^%XT.S')MS>0AC%![:''2[`0A^VT>&X#V0`RT<0(90XR;QQFI@MP)T)Q2T<
    6 M78MH.3F3E&0Z\8\MP7L/HJ,44:C%@;]ZT-N;J:>@X>0FTM>$'["]EALI-=+,
    7 M(>?B7^^8S]!\,4"Z`-L_+&9;&<0BD6(+<[#4>9@>>!!#M(.,Q0F>C]5Y^?%]
    8 MM/U;:(GG4>P'96C_V+%HOSF$[!`DQ3:',Z2070&B7:#OA<$IC:0(0JDTV<71
    9 M`<JL!IO?]K.+B>6C,^XI[C/'*+;.LYMGSNA<_-(Z5=ORE!\(%S5M)+"Q#4JE
    10 M4)42<90;%1[BUD;8$<M'3=D12R\E&PYA`R+!2B,`EIC%/G"6B.0='.P3$:+&
    11 M6+8*K0Y;V>:*?^4\OG`>(]-`JM9H^4\N\B*7M6[-[OI:QKYO!'A;,X!K[%*J
    12 MN&&`!F5:*K0A_5WWB4QG'Y3I"A%J=7S;FKU#ZPUTC62W0TUI-9,QN$")Q@CP
    13 MBY&D3I^^=-PAI"BP-25LR`U<F^B,J_",-HZ39I9/&+7-@*^I4;D3MN[.,\4J
    14 MGWH'FO8,-/WZ0#/@_V&8&>;%#4Z5$KRM:>][1Z<?$K>&1)%KQUE;7,<RR_>^
    15 2>-'31+/UQ;?!*X`@S@HE!@``
     1begin 644 bug_qring.res.gz
     2M'XL("$[3?U```V)U9U]Q<FEN9RYR97,`K53?;YM`#'[/7V%5>X!PI7"0-C\$
     3M#]U4J=*4E^QM:J*[0+K3DB.!@XG\]3,'`;*.;M*&E)SELS_;G^U;??GTO`0`
     4M-X3/SX]PHS)E[P6_68Q6S0T-`94;(84RS,6H.B$,@>>OFU,JY*LMXQ]VIIAJ
     5M/;P06MFWX>X.9)(>V!YV>`"3$6R3PW$?JQB63R`D:)QLWCI-[`[@WH;J%HZ!
     6M0XR2G$E."I-$QR[!AQ"2HQ*)--(X6CV:W<TTK*'A%&0J,D04L[U16CFU\L(C
     7MY^K?[)G/T'PQPG0!MM]8RK8J3D6FQ!;FX-1ZF1]XG$*R@X*E&>K]6J\_OD^V
     8MWRLN49^D4:Q#1\>>1??-0;)#G%5B"6?(H?@-$.T#?:P,3GFB1"Q5S<DN30Z@
     9MJQIMOKHO`196WIY1IB@7GE6)WDM0%M[MN?KEEU)=)ZS]0`3(:4N!BV.@F4)6
     10M-.)M:35XB'LQPHE8/AFU'7%,3=EX#!L0&78:`;#%+(V`LTQD[^#@G`B)'&/;
     11M&K1+V,:V;$U]S"M6]2!TV4ZNJB#7G>W,[H<&Q'UHRWW;(8!?<M%<YA1/7]/;
     12MHDPU'QLR/&-OZM)8#2G^%2FS/Y,RE`AU>KY=A]Y):XAOZG8K3&FS@2D$0(G!
     13M"/"K!:3>$+_4[R54I\#6E+`QM_!LHS->AV>T=9RTFWO"J%T%?$VMQIVP=7][
     14M*7;Y-+B^=&!]Z;^O+P/^'U:785W<XK1F@G<]'7S=Z/2OR+U`(LD7QUG77,^Q
     155]>M>O=]Y9KCFXL/H)U7L&M03!@``
    1616`
    1717end
  • Tst/Short/bug_qring.stat

    r6bbe94 r1bc7201  
    1 1 >> tst_memory_0 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:174416
    2 1 >> tst_memory_1 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:666332
    3 1 >> tst_memory_2 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:699116
    4 1 >> tst_timer_1 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:8
     11 >> tst_memory_0 :: 1350554446:0- spielwiese :spielwiese:version:mamawutz:123692
     21 >> tst_memory_1 :: 1350554446:0- spielwiese :spielwiese:version:mamawutz:655360
     31 >> tst_memory_2 :: 1350554446:0- spielwiese :spielwiese:version:mamawutz:658204
     41 >> tst_timer_1 :: 1350554446:0- spielwiese :spielwiese:version:mamawutz:2
  • dyn_modules/syzextra/myNF.cc

    r6bbe94 r1bc7201  
    224224  //strat->ak = id_RankFreeModule(F, RING!);
    225225  /*- creating temp data structures------------------- -*/
    226   BITSET save_test=test;
    227   test|=Sy_bit(OPT_REDTAIL);
     226  BITSET save1;
     227  SI_SAVE_OPT1(save1);
     228  si_opt_1|=Sy_bit(OPT_REDTAIL);
    228229  initBuchMoraCrit(strat);
    229230  strat->initEcart = initEcartBBA;
     
    260261#endif
    261262    {
    262       BITSET save=test;
    263       test &= ~Sy_bit(OPT_INTSTRATEGY);
     263      si_opt_1 &= ~Sy_bit(OPT_INTSTRATEGY);
    264264      p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0);
    265       test=save;
    266265    }
    267266  }
     
    277276  omfree(strat->fromQ);
    278277  idDelete(&strat->Shdl);
    279   test=save_test;
     278  SI_RESTORE_OPT1(save1);
    280279  if (TEST_OPT_PROT) PrintLn();
    281280  return p;
  • factory/algext.cc

    rb37b398 r1bc7201  
    548548        return;
    549549      m *= (x - alpha);
    550       if(gnew == gm) // gnew did not change
    551       {
    552         cf = tryvcontent(gm, Variable(2), M, fail);
     550      if((firstLC(gnew) == gamma) || (gnew == gm)) // gnew did not change
     551      {
     552        cf = tryvcontent(gnew, Variable(2), M, fail);
    553553        if(fail)
    554554          return;
    555555        divides = true;
    556         g_image= gm;
     556        g_image= gnew;
    557557        g_image.tryDiv (cf, M, fail);
    558558        if(fail)
     
    692692  }
    693693  // here: a is the biggest alg. var in f and g AND some of f,g is in extension
    694   // (in the sequel b is used to swap alg/poly vars)
    695694  setReduce(a,false); // do not reduce expressions modulo mipo
    696695  tmp = getMipo(a);
     
    703702    mv = i;
    704703  // here: mv is level of the largest variable in f, g
    705   b = Variable(mv+1);
    706704  bound = new int[mv+1]; // 'bound' could be indexed from 0 to mv, but we will only use from 1 to mv
    707705  other = new int[mv+1];
     
    750748    if(isEqual(bound, other, 1, mv)) // equal
    751749    {
    752       chineseRemainder( D, q, replacevar( mapinto(Dp), a, b ), p, tmp, newq );
     750      chineseRemainder( D, q, mapinto(Dp), p, tmp, newq );
    753751      // tmp = Dp mod p
    754752      // tmp = D mod q
     
    758756        D = tmp;
    759757      On( SW_RATIONAL );
    760       tmp = replacevar( Farey( D, q ), b, a ); // Farey and switch back to alg var
     758      tmp = Farey( D, q ); // Farey
     759      tmp *= bCommonDen (tmp);
    761760      setReduce(a,true); // reduce expressions modulo mipo
    762761      On( SW_RATIONAL ); // needed by fdivides
     
    780779    // here: isLess(other, bound, 1, mv) ) ==> all previous primes unlucky
    781780    q = p;
    782     D = replacevar( mapinto(Dp), a, b ); // shortcut CRA // shortcut CRA
     781    D = mapinto(Dp); // shortcut CRA // shortcut CRA
    783782    for(int i=1; i<=mv; i++) // tighten bound
    784783      bound[i] = other[i];
  • factory/cf_chinese.cc

    rb37b398 r1bc7201  
    227227          }
    228228          else
     229            result += power( x, i.exp() ) * Farey(c,q);
     230#else
     231          if (c.inZ())
     232            result += power( x, i.exp() ) * Farey_n(c,q);
     233          else
     234            result += power( x, i.exp() ) * Farey(c,q);
    229235#endif
    230             result += power( x, i.exp() ) * Farey_n(c,q);
    231236        }
    232237        else
  • factory/cf_gcd_smallp.cc

    r6bbe94 r1bc7201  
    42294229  Evaluation result= Evaluation (A.min(), A.max());
    42304230  ASSERT (A.min() == 2, "expected A.min() == 2");
    4231   ASSERT (A.max() >= n, "expected A.max() >= n");
    42324231  int max_deg;
    42334232  int k= n;
  • factory/facFqBivarUtil.cc

    r6bbe94 r1bc7201  
    519519  }
    520520
    521   q= newtonDiv (bufF, G, xToLOldL);
     521  if (l-oldL > 0)
     522    q= newtonDiv (bufF, G, xToLOldL);
     523  else
     524    q= 0;
    522525  q *= xToOldL;
    523526  q += oldQ;
  • factory/facFqSquarefree.h

    r6bbe94 r1bc7201  
    1818#include "cf_factory.h"
    1919#include "fac_sqrfree.h"
     20#include "cf_factory.h"
    2021
    2122/// squarefree factorization over a finite field
  • factory/facHensel.cc

    r6bbe94 r1bc7201  
    544544  }
    545545
     546  setReduce (alpha, false);
    546547  for (k= 0; k < factors.length(); k++)
    547548  {
     
    554555    }
    555556  }
     557  setReduce (alpha, true);
    556558  setCharacteristic(0);
    557559
     
    591593  }
    592594  setCharacteristic (p);
     595  setReduce (alpha, false);
    593596  recResult= mapinto (recResult);
     597  setReduce (alpha, true);
    594598  if (mipoHasDen)
    595599  {
     
    606610    coeffE= div (e, modulus);
    607611    setCharacteristic (p);
     612    if (mipoHasDen)
     613      setReduce (gamma, false);
     614    else
     615      setReduce (alpha, false);
    608616    coeffE= coeffE.mapinto();
     617    if (mipoHasDen)
     618      setReduce (gamma, true);
     619    else
     620      setReduce (alpha, true);
    609621    if (mipoHasDen)
    610622      coeffE= replacevar (coeffE, gamma, beta);
     
    619631      {
    620632        setCharacteristic (p);
     633        setReduce (alpha, false);
    621634        g= mulNTL (coeffE, j.getItem());
    622635        g= modNTL (g, bufFactors[ii]);
     636        setReduce (alpha, true);
    623637        setCharacteristic (0);
    624638        if (mipoHasDen)
    625639        {
     640          setReduce (beta, false);
    626641          k.getItem() += replacevar (g.mapinto()*modulus, beta, gamma);
    627642          e -= mulNTL (replacevar (g.mapinto(), beta, gamma)*modulus,
    628643                                   l.getItem(), b);
     644          setReduce (beta, true);
    629645        }
    630646        else
  • factory/facMul.cc

    r6bbe94 r1bc7201  
    404404      {
    405405        ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
    406         ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     406        CanonicalForm mipo= getMipo (alpha);
     407        bool is_rat= isOn (SW_RATIONAL);
     408        if (!is_rat)
     409          On (SW_RATIONAL);
     410        mipo *=bCommonDen (mipo);
     411        if (!is_rat)
     412          Off (SW_RATIONAL);
     413        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (mipo));
    407414        ZZ_pE::init (NTLmipo);
    408415        ZZ_pEX NTLg= convertFacCF2NTLZZ_pEX (G, NTLmipo);
  • factory/fac_ezgcd.cc

    r6bbe94 r1bc7201  
    215215  Evaluation result= Evaluation (A.min(), A.max());
    216216  ASSERT (A.min() == 2, "expected A.min() == 2");
    217   ASSERT (A.max() == n, "expected A.max() == n");
    218217  int max_deg;
    219218  int k= n;
  • kernel/fast_maps.cc

    r6bbe94 r1bc7201  
    6767  poly max_pi_i, max_map_i;
    6868
    69   int i, j;
     69  int i;
    7070  for (i=0; i<IDELEMS(map_id); i++)
    7171  {
  • kernel/ideals.cc

    r6bbe94 r1bc7201  
    130130}
    131131
    132 
    133 /*3
    134 *multiplies p with t (!cas) or  (t-1)
    135 *the index of t is:1, so we have to shift all variables
    136 *p is NOT in the actual ring, it has no t
    137 */
    138 static poly pMultWithT (poly p,BOOLEAN cas)
    139 {
    140   /*qp is the working pointer in p*/
    141   /*result is the result, qresult is the working pointer*/
    142   /*pp is p in the actual ring(shifted), qpp the working pointer*/
    143   poly result,qp,pp;
    144   poly qresult=NULL;
    145   poly qpp=NULL;
    146   int  i,j,lex;
    147   number n;
    148 
    149   pp = NULL;
    150   result = NULL;
    151   qp = p;
    152   while (qp != NULL)
    153   {
    154     i = 0;
    155     if (result == NULL)
    156     {/*first monomial*/
    157       result = pInit();
    158       qresult = result;
    159     }
    160     else
    161     {
    162       qresult->next = pInit();
    163       pIter(qresult);
    164     }
    165     for (j=(currRing->N)-1; j>0; j--)
    166     {
    167       lex = pGetExp(qp,j);
    168       pSetExp(qresult,j+1,lex);/*copy all variables*/
    169     }
    170     lex = pGetComp(qp);
    171     pSetComp(qresult,lex);
    172     n=nCopy(pGetCoeff(qp));
    173     pSetCoeff0(qresult,n);
    174     qresult->next = NULL;
    175     pSetm(qresult);
    176     /*qresult is now qp brought into the actual ring*/
    177     if (cas)
    178     { /*case: mult with t-1*/
    179       pSetExp(qresult,1,0);
    180       pSetm(qresult);
    181       if (pp == NULL)
    182       { /*first monomial*/
    183         pp = pCopy(qresult);
    184         qpp = pp;
    185       }
    186       else
    187       {
    188         qpp->next = pCopy(qresult);
    189         pIter(qpp);
    190       }
    191       pGetCoeff(qpp)=nNeg(pGetCoeff(qpp));
    192       /*now qpp contains -1*qp*/
    193     }
    194     pSetExp(qresult,1,1);/*this is mult. by t*/
    195     pSetm(qresult);
    196     pIter(qp);
    197   }
    198   /*
    199   *now p is processed:
    200   *result contains t*p
    201   * if cas: pp contains -1*p (in the new ring)
    202   */
    203   if (cas)  qresult->next = pp;
    204   /*  else      qresult->next = NULL;*/
    205   return result;
    206 }
    207132
    208133/*2
     
    850775  }
    851776
    852   BITSET save_verbose=verbose;
     777  BITSET save2;
     778  SI_SAVE_OPT2(save2);
    853779
    854780  k=si_max(1,(int)id_RankFreeModule(h1,currRing));
    855781
    856   if ((k==1) && (!lift3)) verbose |=Sy_bit(V_IDLIFT);
     782  if ((k==1) && (!lift3)) si_opt_2 |=Sy_bit(V_IDLIFT);
    857783
    858784  ring orig_ring = currRing;
     
    974900
    975901  if (syz_ring!=orig_ring) rDelete(syz_ring);
    976   verbose = save_verbose;
     902  SI_RESTORE_OPT2(save2);
    977903  return s_h3;
    978904}
     
    13741300    }
    13751301    h4->m[IDELEMS(h4)-1] = p;
    1376     test |= Sy_bit(OPT_SB_1);
     1302    si_opt_1 |= Sy_bit(OPT_SB_1);
    13771303  }
    13781304  idDelete(&temph1);
     
    13971323    return res;
    13981324  }
    1399   BITSET old_test=test;
     1325  BITSET old_test1;
     1326  SI_SAVE_OPT1(old_test1);
    14001327  int i, kmax;
    14011328  BOOLEAN  addOnlyOne=TRUE;
     
    14311358    s_h3 = kStd(s_h4,currQuotient,hom,&weights1,NULL,kmax-1);
    14321359  }
    1433   test = old_test;
     1360  SI_RESTORE_OPT1(old_test1);
    14341361  #if 0
    14351362  // only together with the above debug stuff
     
    16721599#if 1
    16731600  //rWrite(tmpR);PrintLn();
    1674   BITSET save=test;
    1675   //test |=1;
     1601  //BITSET save1;
     1602  //SI_SAVE_OPT1(save1);
     1603  //si_opt_1 |=1;
    16761604  //Print("h: %d gen, rk=%d\n",IDELEMS(h),h->rank);
    16771605  //extern char * showOption();
    16781606  //Print("%s\n",showOption());
    16791607  hh = kStd(h,NULL,hom,&w,hilb);
    1680   test=save;
     1608  //SI_RESTORE_OPT1(save1);
    16811609  idDelete(&h);
    16821610#else
     
    21942122  {
    21952123    if ((s_temp1->m[i]!=NULL)
    2196     && (pGetComp(s_temp1->m[i])<=length))
     2124    && (((int)pGetComp(s_temp1->m[i]))<=length))
    21972125    {
    21982126      p_Delete(&(s_temp1->m[i]),currRing);
  • kernel/kInline.h

    r6bbe94 r1bc7201  
    591591  else
    592592  {
     593    if (lq<=0) lq= ::pLength(q);
    593594    poly _p = (t_p != NULL ? t_p : p);
    594595    assume(_p != NULL);
  • kernel/kstd1.cc

    r6bbe94 r1bc7201  
    12341234  int red_result = 1;
    12351235  int hilbeledeg=1,hilbcount=0;
    1236   int save_test=test;
     1236  BITSET save1;
     1237  SI_SAVE_OPT1(save1);
    12371238  if (currRing->MixedOrder)
    12381239  {
    1239     test &= ~Sy_bit(OPT_REDSB);
    1240     test &= ~Sy_bit(OPT_REDTAIL);
     1240    si_opt_1 &= ~Sy_bit(OPT_REDSB);
     1241    si_opt_1 &= ~Sy_bit(OPT_REDTAIL);
    12411242  }
    12421243
     
    14551456//  }
    14561457  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
    1457   test=save_test;
     1458  SI_RESTORE_OPT1(save1);
    14581459  idTest(strat->Shdl);
    14591460  return (strat->Shdl);
     
    14751476  int   o;
    14761477  LObject   h;
    1477   BITSET save_test=test;
     1478  BITSET save1;
     1479  SI_SAVE_OPT1(save1);
    14781480
    14791481  //if ((idIs0(F))&&(Q==NULL))
     
    14831485  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
    14841486  strat->kNoether    = pCopy((currRing->ppNoether));
    1485   test|=Sy_bit(OPT_REDTAIL);
    1486   test&=~Sy_bit(OPT_INTSTRATEGY);
     1487  si_opt_1|=Sy_bit(OPT_REDTAIL);
     1488  si_opt_1&=~Sy_bit(OPT_INTSTRATEGY);
    14871489  if (TEST_OPT_STAIRCASEBOUND
    14881490  && (! TEST_V_DEG_STOP)
     
    15831585//  }
    15841586  idDelete(&strat->Shdl);
    1585   test=save_test;
     1587  SI_RESTORE_OPT1(save1);
    15861588  if (TEST_OPT_PROT) PrintLn();
    15871589  return p;
     
    16041606  LObject   h;
    16051607  ideal res;
    1606   BITSET save_test=test;
     1608  BITSET save1;
     1609  SI_SAVE_OPT1(save1);
    16071610
    16081611  //if (idIs0(q)) return idInit(IDELEMS(q),si_max(q->rank,F->rank));
     
    16131616  strat->kHEdgeFound = (currRing->ppNoether) != NULL;
    16141617  strat->kNoether=pCopy((currRing->ppNoether));
    1615   test|=Sy_bit(OPT_REDTAIL);
     1618  si_opt_1|=Sy_bit(OPT_REDTAIL);
    16161619  if (TEST_OPT_STAIRCASEBOUND
    16171620  && (0<Kstd1_deg)
     
    17221725//  }
    17231726  idDelete(&strat->Shdl);
    1724   test=save_test;
     1727  SI_RESTORE_OPT1(save1);
    17251728  if (TEST_OPT_PROT) PrintLn();
    17261729  return res;
     
    22442247    Kstd1_deg=Kstd1_OldDeg;
    22452248    if (!oldDegBound)
    2246       test &= ~Sy_bit(OPT_DEGBOUND);
     2249      si_opt_1 &= ~Sy_bit(OPT_DEGBOUND);
    22472250  }
    22482251  else
     
    27192722    //return kInterRedOld(F,Q);
    27202723
    2721   BITSET save=test;
    2722   //test|=Sy_bit(OPT_NOT_SUGAR);
    2723   test|=Sy_bit(OPT_REDTHROUGH);
    2724   //test&= ~Sy_bit(OPT_REDTAIL);
    2725   //test&= ~Sy_bit(OPT_REDSB);
     2724  BITSET save1;
     2725  SI_SAVE_OPT1(save1);
     2726  //si_opt_1|=Sy_bit(OPT_NOT_SUGAR);
     2727  si_opt_1|=Sy_bit(OPT_REDTHROUGH);
     2728  //si_opt_1&= ~Sy_bit(OPT_REDTAIL);
     2729  //si_opt_1&= ~Sy_bit(OPT_REDSB);
    27262730  //extern char * showOption() ;
    27272731  //Print("%s\n",showOption());
     
    27762780  }
    27772781  if (null!=NULL) idDelete(&null);
    2778   test=save;
     2782  SI_RESTORE_OPT1(save1);
    27792783  idSkipZeroes(res);
    27802784  return res;
  • kernel/kstd2.cc

    r6bbe94 r1bc7201  
    20312031  // only global: avoid normalization, return a multiply of NF
    20322032  poly   p;
    2033   int   i;
    20342033
    20352034  //if ((idIs0(F))&&(Q==NULL))
     
    20372036  //strat->ak = idRankFreeModule(F);
    20382037  /*- creating temp data structures------------------- -*/
    2039   BITSET save_test=test;
    2040   test|=Sy_bit(OPT_REDTAIL);
     2038  BITSET save1;
     2039  SI_SAVE_OPT1(save1);
     2040  si_opt_1|=Sy_bit(OPT_REDTAIL);
    20412041  initBuchMoraCrit(strat);
    20422042  strat->initEcart = initEcartBBA;
     
    20712071    #endif
    20722072    {
    2073       BITSET save=test;
    2074       test &= ~Sy_bit(OPT_INTSTRATEGY);
     2073      si_opt_1 &= ~Sy_bit(OPT_INTSTRATEGY);
    20752074      p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0);
    2076       test=save;
    20772075    }
    20782076  }
     
    20882086  omfree(strat->fromQ);
    20892087  idDelete(&strat->Shdl);
    2090   test=save_test;
     2088  SI_RESTORE_OPT1(save1);
    20912089  if (TEST_OPT_PROT) PrintLn();
    20922090  return p;
     
    21132111  //strat->ak = idRankFreeModule(F);
    21142112  /*- creating temp data structures------------------- -*/
    2115   BITSET save_test=test;
    2116   test|=Sy_bit(OPT_REDTAIL);
     2113  BITSET save1;
     2114  SI_SAVE_OPT1(save1);
     2115  si_opt_1|=Sy_bit(OPT_REDTAIL);
    21172116  initBuchMoraCrit(strat);
    21182117  strat->initEcart = initEcartBBA;
     
    21272126  /*- compute------------------------------------------------------- -*/
    21282127  res=idInit(IDELEMS(q),si_max(q->rank,F->rank));
    2129   BITSET save=test;
    2130   test &= ~Sy_bit(OPT_INTSTRATEGY);
     2128  si_opt_1 &= ~Sy_bit(OPT_INTSTRATEGY);
    21312129  for (i=IDELEMS(q)-1; i>=0; i--)
    21322130  {
     
    21552153  }
    21562154  /*- release temp data------------------------------- -*/
    2157   test=save;
     2155  SI_RESTORE_OPT1(save1);
    21582156  omfree(strat->sevS);
    21592157  omfree(strat->ecartS);
     
    21662164  omfree(strat->fromQ);
    21672165  idDelete(&strat->Shdl);
    2168   test=save_test;
     2166  SI_RESTORE_OPT1(save1);
    21692167  if (TEST_OPT_PROT) PrintLn();
    21702168  return res;
     
    21842182{
    21852183  int Ll_old, red_result = 1;
    2186   BOOLEAN withT = FALSE;
    21872184  int pos  = 0;
    21882185  hilbeledeg=1;
     
    30012998void initBbaShift(ideal F,kStrategy strat)
    30022999{
    3003   int i;
    3004 //  idhdl h;
    30053000 /* setting global variables ------------------- */
    30063001  strat->enterS = enterSBba; /* remains as is, we change enterT! */
     
    30353030//    if (TEST_OPT_PROT)
    30363031//    {
    3037 //      for(i=1; i<=(currRing->N); i++)
     3032//      for(int i=1; i<=rVar(currRing); i++)
    30383033//        Print(" %d",ecartWeights[i]);
    30393034//      PrintLn();
  • kernel/nc.cc

    r6bbe94 r1bc7201  
    174174
    175175#if 1
    176     BITSET save_test=test;
    177     test|=Sy_bit(OPT_SB_1); // ring independent
     176    BITSET save1;
     177    SI_SAVE_OPT1(save1);
     178    si_opt_1|=Sy_bit(OPT_SB_1); // ring independent
    178179    J = kStd(id_tmp, currQuotient, testHomog, NULL, NULL, 0, iSize); // J = J + K, J - std // in currRing!
    179     test = save_test;
     180    SI_RESTORE_OPT1(save1);
    180181#else
    181182    J=kStd(id_tmp, currQuotient,testHomog,NULL,NULL,0,0,NULL);
     
    255256  int flag, flagcnt=0, syzcnt=0;
    256257  int syzcomp = 0;
    257   int k=1; // for ideals not modules
    258258  ideal I = kStd(L, currQuotient,testHomog,NULL,NULL,0,0,NULL);
    259259  idSkipZeroes(I);
     
    275275  poly x=pOne();
    276276  var[0]=x;
    277   ideal   h2, h3, s_h2, s_h3;
    278   poly    p,q,qq;
     277  ideal   h2, s_h2, s_h3;
     278  poly    p,q;
    279279  // init vars
    280280  for (i=1; i<=N; i++ )
     
    335335      Print(".proceeding with the variable %d\n",i);
    336336      s_h3 = idPrepareStd(s_I, s_h2, 1);
    337       BITSET save_test=test;
    338       test|=Sy_bit(OPT_SB_1);
     337      BITSET save1;
     338      SI_SAVE_OPT1(save1);
     339      si_opt_1|=Sy_bit(OPT_SB_1);
    339340      idTest(s_h3);
    340341      idDelete(&s_h2);
     
    343344      Print("...computing Syz");
    344345      s_h3 = kStd(s_h2, currQuotient,(tHomog)FALSE,NULL,NULL,syzcomp,idI);
    345       test=save_test;
     346      SI_RESTORE_OPT1(save1);
    346347      //idShow(s_h3);
    347348      if (orig_ring != syz_ring)
  • kernel/syz.cc

    r6bbe94 r1bc7201  
    293293static void syMinStep1(resolvente res, int length)
    294294{
    295   int i,j,k,l,index=0;
     295  int i,j,k,index=0;
    296296  poly p;
    297297  ideal deg0=NULL,reddeg0=NULL;
     
    331331          {
    332332            p = res[index]->m[k];
    333             while ((p!=NULL) && ((!pLmIsConstantComp(p)) || (pGetComp(p)!=j)))
     333            while ((p!=NULL) && ((!pLmIsConstantComp(p)) || (pGetComp(p)!=(unsigned)j)))
    334334              pIter(p);
    335             if ((p!=NULL) && (pLmIsConstantComp(p)) && (pGetComp(p)==j)) break;
     335            if ((p!=NULL) && (pLmIsConstantComp(p)) && (pGetComp(p)==(unsigned)j)) break;
    336336            k++;
    337337          }
     
    394394                        intvec *** weights, BOOLEAN minim)
    395395{
     396  BITSET save1;
     397  SI_SAVE_OPT1(save1);
    396398  resolvente res;
    397399  resolvente newres;
     
    530532    {
    531533      res[/*syzIndex+*/1] = idSyzygies(res[0/*syzIndex*/],hom,&w,FALSE,setRegularity,&Kstd1_deg);
    532       if ((!TEST_OPT_NOTREGULARITY) && (Kstd1_deg>0)) test |= Sy_bit(OPT_DEGBOUND);
     534      if ((!TEST_OPT_NOTREGULARITY) && (Kstd1_deg>0)) si_opt_1 |= Sy_bit(OPT_DEGBOUND);
    533535    }
    534536    else
     
    591593  Kstd1_deg=Kstd1_OldDeg;
    592594  if (!oldDegBound)
    593     test &= ~Sy_bit(OPT_DEGBOUND);
     595    si_opt_1 &= ~Sy_bit(OPT_DEGBOUND);
    594596
    595597  for (i=1; i<=syzIndex; i++)
     
    613615    rDelete(syz_ring);
    614616  }
     617  SI_RESTORE_OPT1(save1);
    615618  return res;
    616619}
     
    645648#endif
    646649
    647   int typ0;
    648650  syStrategy result=(syStrategy)omAlloc0(sizeof(ssyStrategy));
    649651
     
    723725int syDetect(ideal id,int index,BOOLEAN homog,int * degrees,int * tocancel)
    724726{
    725   int i, j, k, ModComp,subFromRank=0, lu;
    726   poly p, q, qq, Unit1, Unit2;
     727  int i, j, k, subFromRank=0;
    727728  ideal temp;
    728729
     
    741742  }
    742743  j = 0;
    743   p = NULL;
    744744  while ((j<i) && (temp->m[j]==NULL)) j++;
    745745  while (j<i)
     
    777777      deg[i-1] = (*degrees)[i-1]-rsmin;
    778778  }
    779   int dummy=syDetect(id,index,homog,deg,tocan);
     779  syDetect(id,index,homog,deg,tocan);
    780780  for (i=tocancel->length();i>0;i--)
    781781    (*tocancel)[i-1] = tocan[i-1];
     
    865865      if (res[i]->m[j]!=NULL)
    866866      {
    867         if ((pGetComp(res[i]->m[j])>l)
     867        if ((pGetComp(res[i]->m[j])>(unsigned)l)
    868868        || ((i>1) && (res[i-1]->m[pGetComp(res[i]->m[j])-1]==NULL)))
    869869        {
     
    917917  else
    918918    memset(temp2,0,l*sizeof(int));
    919   int dummy = syDetect(res[0],0,TRUE,temp2,tocancel);
     919  syDetect(res[0],0,TRUE,temp2,tocancel);
    920920  if (weights!=NULL) p_SetModDeg(NULL, currRing);
    921921  if (tomin)
     
    957957      {
    958958        memset(tocancel,0,(rows+1)*sizeof(int));
    959         dummy = syDetect(res[i+1],i+1,TRUE,temp2,tocancel);
     959        syDetect(res[i+1],i+1,TRUE,temp2,tocancel);
    960960        for (j=0;j<rows;j++)
    961961        {
  • kernel/syz1.cc

    r6bbe94 r1bc7201  
    474474  int *F1=syzstr->Firstelem[index-1];
    475475  int *H1=syzstr->Howmuch[index-1];
    476   poly pp;
    477476  polyset o_r=syzstr->orderedRes[index]->m;
    478   polyset or1=syzstr->orderedRes[index-1]->m;
    479477  BOOLEAN ret = FALSE;
    480478
     
    660658  int ** Fin=syzstr->Firstelem;
    661659  int ** Hin=syzstr->Howmuch;
    662   int ** bin=syzstr->backcomponents;
    663660  ideal o_r=syzstr->orderedRes[index+1];
    664661  intvec *result=new intvec(howmuch+1);
     
    778775{
    779776  int i,j,k=IDELEMS(syzstr->res[index]);
    780   int ks=IDELEMS(syzstr->res[index+1]),kk,l,ll;
     777  int ks=IDELEMS(syzstr->res[index+1]);
    781778  int * Fin=syzstr->Firstelem[index-1];
    782779  int * Hin=syzstr->Howmuch[index-1];
    783780  int * bin=syzstr->backcomponents[index];
    784781  int * elL=syzstr->elemLength[index];
    785   number coefgcd,n;
     782  number coefgcd;
    786783  polyset redset=syzstr->orderedRes[index]->m;
    787784  poly p=NULL,q;
     
    924921{
    925922  ideal res=syzstr->res[index];
    926   int i=0,j,k=IDELEMS(res),kk;
     923  int i=0,j,k=IDELEMS(res);
    927924  SSet sPairs=syzstr->resPairs[index-1];
    928925
     
    994991{
    995992  int ll,k,no=(*so).order,sP=*sPlength,i;
    996   poly p=(*so).lcm;
    997993
    998994  if ((sP==0) || (sPairs[sP-1].order<=no))
     
    10811077  SObject tso;
    10821078  int i,ii,j,k=IDELEMS(syzstr->res[index]),l=(*syzstr->Tl)[index],ll;
    1083   int qc,first,pos,jj,j1;
     1079  int first,pos,jj,j1;
    10841080  int * bci=syzstr->backcomponents[index];
    10851081  poly p,q;
     
    10991095  {
    11001096    q = rs[j];
    1101     qc = pGetComp(q);
    11021097    first = syzstr->Firstelem[index-1][pGetComp(q)]-1;
    11031098    pos = first+syzstr->Howmuch[index-1][pGetComp(q)];
     
    11931188{
    11941189  int newdeg=*actdeg,newindex=-1,i,t,sldeg;
    1195   poly p;
    11961190  SSet result;
    11971191  SRes resPairs=syzstr->resPairs;
     
    18661860int syDim(syStrategy syzstr)
    18671861{
    1868   int i,j=-1,l;
     1862  int i,l;
    18691863  if (syzstr->resPairs!=NULL)
    18701864  {
     
    21062100* minimizes toMin
    21072101*/
     2102#if 0 /* unused */
    21082103static poly syMinimizeP(int toMin,syStrategy syzstr,intvec * ordn,int index,
    21092104                        intvec * toStrip)
     
    21332128      while (p!=NULL)
    21342129      {
    2135         if (pGetComp(p)==tc)
     2130        if (pGetComp(p)==(unsigned)tc)
    21362131        {
    21372132          tq = pInit();
     
    21582153  return pp;
    21592154}
     2155#endif
    21602156
    21612157/*2
     
    21652161                        intvec * toStrip)
    21662162{
    2167   int ii=0,i,j,tc,lp,ltS=-1;
    2168   poly p,mp=NULL,pp,q=NULL,tq,pisN;
     2163  int ii=0,i,tc,lp,ltS=-1;
     2164  poly p,mp=NULL,pp;
    21692165  SSet sPairs=syzstr->resPairs[index];
    21702166  poly tempStripped=NULL;
     
    23292325  intvec * Strip, * ordn;
    23302326  resolvente tres=(resolvente)omAlloc0((syzstr->length+1)*sizeof(ideal));
    2331   ring tmpR = NULL;
    23322327  ring origR = currRing;
    23332328
     
    23392334    return tres;
    23402335  }
    2341   int i,j,l,index,ii,i1;
    2342   poly p;
    2343   ideal rs;
     2336  int i,l,index,i1;
    23442337  SSet sPairs;
    2345   int * ord,*b0,*b1;
    23462338
    23472339  assume(syzstr->syRing != NULL);
     
    24432435syStrategy syLaScala3(ideal arg,int * length)
    24442436{
    2445   BOOLEAN noPair=FALSE;
    2446   int i,j,actdeg=32000,index=0,reg=-1;
    2447   int startdeg,howmuch;
    2448   poly p;
     2437  int i,j,actdeg=32000,index=0;
     2438  int howmuch;
    24492439  ideal temp;
    24502440  SSet nextPairs;
     
    25102500  int len0=id_RankFreeModule(temp,currRing)+1;
    25112501
    2512   startdeg = actdeg;
    25132502  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
    25142503  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
     
    25742563syStrategy syLaScala(ideal arg, int& maxlength, intvec* weights)
    25752564{
    2576   BOOLEAN noPair=FALSE;
    2577   int i,j,actdeg=32000,index=0,reg=-1;
    2578   int startdeg,howmuch;
    2579   poly p;
     2565  int i,j,actdeg=32000,index=0;
     2566  int howmuch;
    25802567  ideal temp;
    25812568  SSet nextPairs;
     
    26582645  int len0=id_RankFreeModule(temp,currRing)+1;
    26592646
    2660   startdeg = actdeg;
    26612647  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
    26622648  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
  • kernel/syz2.cc

    r6bbe94 r1bc7201  
    7575            int actdeg)
    7676{
    77   SSet temp;
    7877  SObject tso;
    79   poly toHandle,tsyz=NULL,p,pp;
     78  poly toHandle,p,pp;
    8079  int r1,r2=0,rr,l=(*syzstr->Tl)[index];
    8180  int i,j,r=0,ti;
     
    8584#endif
    8685  actdeg += index;
    87   long * ShiftedComponents = syzstr->ShiftedComponents[index-1];
    88   int* Components = syzstr->truecomponents[index-1];
    8986
    9087  while ((l>0) && ((syzstr->resPairs[index])[l-1].lcm==NULL)) l--;
     
    119116      {
    120117        if (((syzstr->resPairs[index])[i].p!=NULL) &&
    121             (pGetComp((syzstr->resPairs[index])[i].p)==tc))
     118            (pGetComp((syzstr->resPairs[index])[i].p)==(unsigned)tc))
    122119        {
    123120#ifdef USE_CHAINCRIT
     
    506503{
    507504  int i,j,k=IDELEMS(syzstr->res[index]);
    508   int ks=IDELEMS(syzstr->res[index+1]),kk,l,ll;
     505  int ks=IDELEMS(syzstr->res[index+1]),kk;
    509506  int ks1=IDELEMS(syzstr->orderedRes[index+1]);
    510507  int kres=(*syzstr->Tl)[index];
    511508  int toGo=0;
    512509  int il;
    513   number coefgcd,n;
    514510  SSet redset=syzstr->resPairs[index];
    515   poly p=NULL,q,tp;
     511  poly q;
    516512  intvec *spl1;
    517513  SObject tso;
     
    522518  int step=1,jj,j1,j2;
    523519#endif
    524   long * ShiftedComponents = syzstr->ShiftedComponents[index];
    525   int* Components = syzstr->truecomponents[index];
    526   assume(Components != NULL && ShiftedComponents != NULL);
    527   BOOLEAN need_reset;
     520  assume((syzstr->truecomponents[index]) != NULL && (syzstr->ShiftedComponents[index]) != NULL);
    528521
    529522  actord += index;
     
    858851{
    859852  ideal res=syzstr->res[1];
    860   int i=0,j,k=IDELEMS(res),k1=IDELEMS(syzstr->orderedRes[1]);
    861   SSet sPairs1=syzstr->resPairs[1];
     853  int i=0,k=IDELEMS(res),k1=IDELEMS(syzstr->orderedRes[1]);
    862854  SSet sPairs=syzstr->resPairs[0];
    863855
     
    964956syStrategy syHilb(ideal arg,int * length)
    965957{
    966   int i,j,actdeg=32000,index=0,reg=-1;
    967   int startdeg,howmuch,toSub=0;
     958  int i,j,actdeg=32000,index=0;
     959  int howmuch,toSub=0;
    968960  int maxindex=0,maxdeg=0;
    969961  ideal temp=NULL;
     
    10281020  syzstr->bucket = kBucketCreate(currRing);
    10291021  syzstr->syz_bucket = kBucketCreate(currRing);
    1030   startdeg = actdeg;
    10311022  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
    10321023/*--- computes the resolution ----------------------*/
  • kernel/syz3.cc

    r6bbe94 r1bc7201  
    8989* shows the resolution stored in syzstr->orderedRes
    9090*/
     91#if 0 /* unused*/
    9192static void syShowRes(syStrategy syzstr)
    9293{
     
    103104  }
    104105}
     106#endif
    105107 
    106108/*3
     
    601603* the corresponding representation)
    602604*/
     605#if 0 /*unused*/
    603606static void syRedTailSyzPair(SObject tso,syStrategy syzstr,int index,
    604607            int * gen_length,int* orp_l,int * tored_l,int * syzred_l)
     
    637640  assume(pLength(tso.p)==*tored_l);
    638641}
     642#endif
    639643 
    640644/*3
     
    11781182  int ng_place=IDELEMS(new_generators);
    11791183  int i,j;
    1180   number coefgcd,n;
     1184  number n;
    11811185  poly p;
    1182   BOOLEAN deleteP=FALSE;
    11831186#ifdef EXPERIMENT1
    11841187  poly syzp;
     
    13671370{
    13681371  if (resPairs[0].lcm==NULL) return FALSE;
    1369   int i=0,j;
     1372  int i=0;
    13701373  poly deg_soc;
    13711374 
     
    14501453      if (next_p!=NULL)
    14511454      {
    1452         if (pGetComp(next_p)<=crit_comp)
     1455        if (pGetComp(next_p)<=(unsigned)crit_comp)
    14531456        {
    14541457          pDelete(&next_p);
     
    16751678                         resolvente totake)
    16761679{
    1677   int i,j,newIdeal;
    1678   intvec * w;
    1679   poly p;
     1680  int i,j;
    16801681  ideal result;
    16811682  int rk_new_gens = id_RankFreeModule(new_generators,currRing);
     
    17521753syStrategy syKosz(ideal arg,int * length)
    17531754{
    1754   int i,j,jj,k=0,index=0,rk_arg,actual_syzcomp,next_syz=0;
     1755  int i,j,jj,k=0,index=0,rk_arg,next_syz=0;
    17551756  int crit_comp,t_comp,next_deg,old_tl;
    17561757  ideal temp=NULL,old_ideal,old_repr;
    1757   ring origR = currRing,actR;
    1758   poly p,next_gen;
    1759   tHomog hom=isNotHomog;
     1758  ring origR = currRing;
     1759  poly next_gen;
    17601760  BOOLEAN isRegular;
    17611761 
  • kernel/walkMain.cc

    r6bbe94 r1bc7201  
    7070  /* OLDRING **************************************************** */
    7171  ideal nextG;
    72   BITSET optionState;
    7372
    7473  if (currwOnBorder64(G,currw64))
     
    113112    nextG=(ideal)resMat;
    114113
    115     optionState=test;
    116     test|=Sy_bit(OPT_REDSB);
     114    BITSET save1,save2;
     115    SI_SAVE_OPT(save1,save2);
     116    si_opt_1|=Sy_bit(OPT_REDSB);
    117117    nextG = idInterRed(nextG);
    118     test=optionState;
     118    SI_RESTORE_OPT(save1,save2);
    119119  }
    120120  else
     
    145145///////////////////////////////////////////////////////////////////
    146146
    147 WalkState walkStep64(ideal & G,int64vec* currw64, int step){
     147WalkState walkStep64(ideal & G,int64vec* currw64, int step)
     148{
    148149  WalkState state=WalkOk;
    149   BITSET optionState;
    150150
    151151/* OLDRING ****************************************************** */
     
    196196  nextG=(ideal)resMat;
    197197
    198   optionState=test;
    199   test|=Sy_bit(OPT_REDSB);
     198  BITSET save1,save2;
     199  SI_SAVE_OPT(save1,save2);
     200  si_opt_1|=Sy_bit(OPT_REDSB);
    200201  nextG = idInterRed(nextG);
    201   test=optionState;
     202  SI_RESTORE_OPT(save1,save2);
    202203
    203204  G=nextG;
     
    219220
    220221WalkState walk64(ideal I,int64vec* currw64,ring destRing,
    221 int64vec* destVec64,ideal  & destIdeal,BOOLEAN sourceIsSB){
    222 
     222int64vec* destVec64,ideal  & destIdeal,BOOLEAN sourceIsSB)
     223{
    223224  //some initializations
    224225  WalkState state=WalkOk;
    225   BITSET optionState;
    226   test|=Sy_bit(OPT_REDTAIL);
     226  BITSET save1,save2;
     227  SI_SAVE_OPT(save1,save2);
     228
     229  si_opt_1|=Sy_bit(OPT_REDTAIL);
    227230  overflow_error=FALSE;
    228231  int step=0;
    229232  ideal G=I;
    230233
    231   optionState=test;
    232   test|=Sy_bit(OPT_REDSB);
     234  si_opt_1|=Sy_bit(OPT_REDSB);
    233235  if(!sourceIsSB)
    234236  {
     
    238240  else
    239241    G=idInterRed(G);
    240   test=optionState;
     242  SI_RESTORE_OPT(save1,save2);
    241243
    242244  ideal nextG;
     
    244246  nextG=G;
    245247
    246   if(overflow_error){
    247       state=WalkOverFlowError;
     248  if(overflow_error)
     249  {
     250    state=WalkOverFlowError;
    248251    return(state);
    249     }
    250 
    251    int64 nexttvec0,nexttvec1;
    252    //int64vec* nexttvec64=nextt64(nextG,currw64,destVec64);
    253    nextt64(nextG,currw64,destVec64,nexttvec0,nexttvec1);
     252  }
     253
     254  int64 nexttvec0,nexttvec1;
     255  //int64vec* nexttvec64=nextt64(nextG,currw64,destVec64);
     256  nextt64(nextG,currw64,destVec64,nexttvec0,nexttvec1);
    254257
    255258  //while(0<t<=1) ( t=((*nexttvec64)[0])/((*nexttvec64)[1]) )
    256259  //while( (*nexttvec64)[0]<=(*nexttvec64)[1] ) {
    257   while (nexttvec0<=nexttvec1 ) {
    258 
     260  while (nexttvec0<=nexttvec1 )
     261  {
    259262    step=step+1;
    260263
     
    271274    //uppdates nextG if all is OK
    272275
    273     if(overflow_error){
     276    if(overflow_error)
    274277      return(WalkOverFlowError);
    275     }
    276278
    277279    //delete nexttvec64;
     
    353355///////////////////////////////////////////////////////////////////
    354356
    355 WalkState unperturbedFirstStep64(ideal & G,int64vec* currw64, ring destRing){
     357WalkState unperturbedFirstStep64(ideal & G,int64vec* currw64, ring destRing)
     358{
    356359  WalkState state=WalkOk;
    357360  /* OLDRING **************************************************** */
    358361  ideal nextG;
    359   BITSET optionState;
     362  BITSET save1,save2;
     363  SI_SAVE_OPT(save1,save2);
    360364
    361365  if (currwOnBorder64(G,currw64))
     
    371375
    372376      //turn off bucket representation of polynomials and on redSB
    373     optionState=test;
    374     //test|=Sy_bit(OPT_NOT_BUCKETS);
    375     test|=Sy_bit(OPT_REDSB);
     377    //si_opt_1|=Sy_bit(OPT_NOT_BUCKETS);
     378    si_opt_1|=Sy_bit(OPT_REDSB);
    376379
    377380    ideal newStdGw=idStd(newGw);
    378381
    379    //turn on bucket representation of polynomials and off redSB
    380    test=optionState;
     382    //turn on bucket representation of polynomials and off redSB
     383    SI_RESTORE_OPT(save1,save2);
    381384
    382385    matrix L=matIdLift(newGw,newStdGw);
     
    394397    nextG=(ideal)resMat;
    395398
    396     optionState=test;
    397     test|=Sy_bit(OPT_REDSB);
     399    si_opt_1|=Sy_bit(OPT_REDSB);
    398400    nextG = idInterRed(nextG);
    399     test=optionState;
     401    SI_RESTORE_OPT(save1,save2);
    400402  }
    401403  else
     
    436438{  PrintS("fractal walk, weights");currw64->show();PrintLn(); }
    437439WalkState state=WalkOk;
    438 BITSET optionState=test;
     440BITSET save1,save2;
     441SI_SAVE_OPT(save1,save2);
    439442
    440443//1
     
    530533      newGw=idrMoveR(GwCp,oldRing,newring);
    531534
    532       test|=Sy_bit(OPT_REDSB);
     535      si_opt_1|=Sy_bit(OPT_REDSB);
    533536      newStdGw=idStd(newGw); //computes new reduced GB of Gw
    534       test=optionState;
     537      SI_RESTORE_OPT(save1,save2);
    535538    }
    536539    else
     
    567570    //fractalRec64(Gw,level+1) has returned
    568571
    569     //test|=Sy_bit(OPT_NOT_BUCKETS);
     572    //si_opt_1|=Sy_bit(OPT_NOT_BUCKETS);
    570573    matrix L=matIdLift(newGw,newStdGw);
    571     test=optionState;
     574    SI_RESTORE_OPT(save1,save2);
    572575
    573576    newG=idrMoveR(GCp,oldRing,currRing);
     
    581584//9
    582585
    583     test|=Sy_bit(OPT_REDSB);
     586    si_opt_1|=Sy_bit(OPT_REDSB);
    584587    G=idInterRed(G);
    585     test=optionState;
     588    SI_RESTORE_OPT(save1,save2);
    586589
    587590    old_w=iv64Copy(w);
     
    615618  overflow_error=FALSE; //global
    616619  WalkState state=WalkOk;
    617   test|=Sy_bit(OPT_REDTAIL);
     620  BITSET save1,save2;
     621  SI_SAVE_OPT(save1,save2);
     622
     623  si_opt_1|= (Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_REDSB));
    618624  ideal G;
    619625
    620   BITSET optionState=test;
    621   test|=Sy_bit(OPT_REDSB);
    622626  if(!sourceIsSB)
    623627  {
     
    630634  }
    631635
    632   test=optionState; //switches REDSB off
     636  SI_RESTORE_OPT(save1,save2); //switches REDSB off
    633637
    634638  //matrices for the orders of the rings
  • libpolys/misc/mylimits.h

    r6bbe94 r1bc7201  
    2121
    2222// #define ULONG_MAX (~0UL) // ??
     23#ifndef ULONG_MAX
    2324#define ULONG_MAX (~0L)
     25#endif
    2426
    2527// TODO: fixing the following BUG (!?) leads to wrong ring::bitmask
    2628// #if ~0UL != 4294967295UL
     29#ifndef LONG_MAX
    2730#if ~0UL == 4294967295UL
    2831#define LONG_MAX 9223372036854775807L
     
    3033#define LONG_MAX 2147483647L
    3134#endif
     35#endif
    3236
    3337#endif /* _MYLIMITS_H */
  • libpolys/misc/options.c

    r6bbe94 r1bc7201  
    22// since initialized variables will be "D" (uninit. go to "C") segments
    33#include <misc/options.h>
    4 unsigned test = 0;
    5 unsigned verbose = Sy_bit(V_QUIET)
     4unsigned si_opt_1 = 0;
     5unsigned si_opt_2 = Sy_bit(V_QUIET)
    66                   //| Sy_bit(V_QRING) // not default, as speed drops by 10 %
    77                   | Sy_bit(V_REDEFINE)
  • libpolys/misc/options.h

    r6bbe94 r1bc7201  
    1111/*the general set of verbose-options : verbose */
    1212#ifdef __cplusplus
    13 extern "C" unsigned test;
    14 extern "C" unsigned verbose;
     13extern "C" unsigned si_opt_1;
     14extern "C" unsigned si_opt_2;
    1515#else
    16 extern unsigned test;
    17 extern unsigned verbose;
     16extern unsigned si_opt_1;
     17extern unsigned si_opt_2;
    1818#endif
     19#define SI_SAVE_OPT(A,B) { A=si_opt_1; B=si_opt_2; }
     20#define SI_SAVE_OPT1(A) { A=si_opt_1; }
     21#define SI_SAVE_OPT2(A) { A=si_opt_2; }
     22#define SI_RESTORE_OPT(A,B) { si_opt_1=A; si_opt_2=B; }
     23#define SI_RESTORE_OPT1(A) { si_opt_1=A; }
     24#define SI_RESTORE_OPT2(A) { si_opt_2=A; }
    1925
    2026/*
     
    2430#define Sy_bit(x)     ((unsigned)1<<(x))
    2531#define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)
    26 #define BTEST1(a)     Sy_inset((a), test)
    27 #define BVERBOSE(a)   Sy_inset((a), verbose)
     32#define BTEST1(a)     Sy_inset((a), si_opt_1)
     33#define BVERBOSE(a)   Sy_inset((a), si_opt_2)
    2834
    2935/*
  • libpolys/polys/monomials/p_polys.cc

    r6bbe94 r1bc7201  
    246246          const int limit = o->data.syz.limit;
    247247
    248           if (c > limit)
     248          if (c > (unsigned long)limit)
    249249            p->exp[place] = o->data.syz.curr_index;
    250250          else if (c > 0)
    251251          {
    252             assume( (1 <= c) && (c <= limit) );
     252            assume( (1 <= c) && (c <= (unsigned long)limit) );
    253253            p->exp[place]= o->data.syz.syz_index[c];
    254254          }
     
    530530  p_LmCheckPolyRing(p, r);
    531531  int i, k;
    532   int pIS = 0;
    533532  long j =0;
    534533
     
    19141913  assume( ph != NULL );
    19151914
    1916   assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
     1915  assume( r != NULL ); assume( r->cf != NULL );
    19171916
    19181917
     
    19201919  if( 0 )
    19211920  {
     1921    const coeffs C = r->cf;
    19221922      // experimentall (recursive enumerator treatment) of alg. Ext!
    19231923    CPolyCoeffsEnumerator itr(ph);
     
    19771977      n_ClearContent(itr, r->cf);
    19781978
    1979       p_Test(ph, r); n_Test(pGetCoeff(ph), C);
    1980       assume(n_GreaterZero(pGetCoeff(ph), C)); // ??
     1979      p_Test(ph, r); n_Test(pGetCoeff(ph), r->cf);
     1980      assume(n_GreaterZero(pGetCoeff(ph), r->cf)); // ??
    19811981     
    19821982      // if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r);
  • libpolys/polys/monomials/ring.cc

    r6bbe94 r1bc7201  
    34303430  if (complete)
    34313431  {
    3432     test &= ~ TEST_RINGDEP_OPTS;
    3433     test |= r->options;
     3432    si_opt_1 &= ~ TEST_RINGDEP_OPTS;
     3433    si_opt_1 |= r->options;
    34343434  }
    34353435}
  • libpolys/polys/monomials/ring.h

    r6bbe94 r1bc7201  
    659659  if( ret )
    660660  {
    661     const ring R = C->extRing;
    662     assume( R != NULL );
     661    assume( (C->extRing) != NULL );
    663662    BOOLEAN idIs0 (ideal h);
    664     assume( !idIs0(R->qideal) );
     663    assume((!((C->extRing)->qideal==NULL)) && (!idIs0((C->extRing)->qideal)));
    665664  }
    666665
Note: See TracChangeset for help on using the changeset viewer.