Changeset 8a150b in git


Ignore:
Timestamp:
Apr 29, 1999, 1:38:59 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '873fc1222e995d7cb33f79d8f1792ce418c8c72c')
Children:
ce5fb2786eb5fa61fee54f85fe8647ef13e7be20
Parents:
4be737ee7176ba0340ece58c1e6920d666833ac2
Message:
* hannes: added long reals


git-svn-id: file:///usr/local/Singular/svn/trunk@3012 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
5 added
20 edited

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.in

    r4be737 r8a150b  
    7272    comm.cc kstd1.cc kstd2.cc kutil.cc lists.cc \
    7373    longalg.cc longrat.cc longrat0.cc \
    74     maps.cc matpol.cc misc.cc sdb.cc \
    75     mminit.cc modulop.cc sparsmat.cc \
     74    maps.cc matpol.cc misc.cc sdb.cc gnumpfl.cc\
     75    mminit.cc modulop.cc mpr_complex.cc sparsmat.cc \
    7676    fglm.cc fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc fglmcomb.cc \
    7777    numbers.cc polys.cc polys0.cc polys1.cc polys-impl.cc \
     
    9595        subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \
    9696        cntrlc.h ipprint.h ring.h timer.h sdb.h \
    97         febase.h ipshell.h shortfl.h tok.h \
     97        febase.h ipshell.h shortfl.h tok.h mpr_complex.h mpr_global.h \
    9898        mmemory.h mmprivate.h mmheap.h mmpage.h page.h \
    99         ffields.h khstd.h silink.h sparsmat.h \
     99        ffields.h khstd.h silink.h sparsmat.h gnumpfl.h \
    100100        fglm.h comm.h kstd1.h modulop.h sing_dbm.h weight.h \
    101101        fglmgauss.h fglmvec.h kstd2.h mpsr.h sing_mp.h \
     
    116116        ${INCS}
    117117
    118 OBJS=grammar.o scanner.o matpol.o binom.o\
     118OBJS=grammar.o scanner.o matpol.o binom.o mpr_complex.o gnumpfl.o \
    119119     febase.o feread.o timer.o intvec.o attrib.o lists.o\
    120120     longrat.o longrat0.o misc.o ring.o numbers.o maps.o\
     
    332332##
    333333
    334 OBJG1=  grammar.og scanner.og matpol.og binom.og\
     334OBJG1=  grammar.og scanner.og matpol.og binom.og gnumpfl.og mpr_complex.og \
    335335     febase.og feread.og timer.og intvec.og attrib.og lists.og\
    336336     longrat.og longrat0.og misc.og ring.og numbers.og maps.og\
     
    408408##
    409409
    410 OBJP1=  grammar.op scanner.op matpol.op binom.op\
     410OBJP1=  grammar.op scanner.op matpol.op binom.op gnumpfl.op mpr_complex.op \
    411411     febase.op feread.op timer.op intvec.op attrib.op lists.op\
    412412     longrat.op longrat0.op misc.op ring.op numbers.op maps.op\
     
    434434##
    435435
    436 OBJB1=  grammar.ob scanner.ob matpol.ob binom.ob\
     436OBJB1=  grammar.ob scanner.ob matpol.ob binom.ob gnumpfl.ob mpr_complex.ob \
    437437     febase.ob feread.ob timer.ob intvec.ob attrib.ob lists.ob\
    438438     longrat.ob longrat0.ob misc.ob ring.ob numbers.ob maps.ob\
  • Singular/extra.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.89 1999-04-20 17:02:47 Singular Exp $ */
     4/* $Id: extra.cc,v 1.90 1999-04-29 11:38:40 Singular Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    912912      {
    913913        procinfov p=(procinfov)h->Data();
    914         if (p->language!=LANG_SINGULAR)
    915         {
    916           WerrorS("set breakpoints only in Singular procedures");
    917           return TRUE;
    918         }
     914        if (p->language!=LANG_SINGULAR)
     915        {
     916          WerrorS("set breakpoints only in Singular procedures");
     917          return TRUE;
     918        }
    919919        int lineno=p->data.s.body_lineno;
    920920        if ((h->next!=NULL) && (h->next->Typ()==INT_CMD))
    921         {
     921        {
    922922          lineno=(int)h->next->Data();
    923         }
     923        }
    924924        int i;
    925         if (lineno== -1)
    926         {
    927           i=p->trace_flag;
    928           p->trace_flag &=1;
    929           Print("breakpoints in %s deleted(%#x)\n",p->procname,i &255);
    930           return FALSE;
    931         } 
     925        if (lineno== -1)
     926        {
     927          i=p->trace_flag;
     928          p->trace_flag &=1;
     929          Print("breakpoints in %s deleted(%#x)\n",p->procname,i &255);
     930          return FALSE;
     931        }
    932932        i=0;
    933933        while((i<7) && (sdb_lines[i]!=-1)) i++;
     
    937937          return FALSE;
    938938        }
    939         else
    940         {
     939        else
     940        {
    941941          sdb_lines[i]=lineno;
    942           i++;
    943           Print("breakpoint %d, at line %d in %s\n",i,lineno,p->procname);
     942          i++;
     943          Print("breakpoint %d, at line %d in %s\n",i,lineno,p->procname);
    944944          p->trace_flag|=(1<<i);
    945         }
     945        }
    946946      }
    947947      else
  • Singular/fglmzero.cc

    r4be737 r8a150b  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmzero.cc,v 1.22 1999-03-09 12:28:47 obachman Exp $
     2// $Id: fglmzero.cc,v 1.23 1999-04-29 11:38:41 Singular Exp $
    33
    44/****************************************
     
    139139
    140140    int * perm = (int *)Alloc0( (_nfunc+1)*sizeof( int ) );
    141     maFindPerm( source->names, source->N, NULL, 0, currRing->names, 
     141    maFindPerm( source->names, source->N, NULL, 0, currRing->names,
    142142                currRing->N, NULL, 0, perm, NULL , currRing->ch);
    143     nSetMap( rInternalChar(source), source->parameter, source->P, 
     143    nSetMap( rInternalChar(source), source->parameter, source->P,
    144144             source->minpoly );
    145145
     
    149149            if ( colp->owner == TRUE ) {
    150150                for ( row= colp->size-1, elemp= colp->elems; row >= 0;
    151                   row--, elemp++ )
    152                 {
     151                  row--, elemp++ )
     152                {
    153153                    newelem= nMap( elemp->elem );
    154154                    nDelete( & elemp->elem );
  • Singular/iparith.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.145 1999-04-26 12:58:45 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.146 1999-04-29 11:38:44 Singular Exp $ */
    55
    66/*
     
    15121512          BITSET save_test=test;
    15131513          naSetChar(rInternalChar(r),TRUE,r->parameter,rPar(r));
    1514           nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1515                    rPar(currRing));
     1514          nSetChar(currRing,TRUE);
    15161515          test=save_test;
    15171516        }
     
    58125811#endif
    58135812  assume(0);
    5814   return -1;
    5815 }
    5816 
     5813  return 0;
     5814}
     5815
  • Singular/kstd1.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.31 1999-03-08 17:30:38 Singular Exp $ */
     4/* $Id: kstd1.cc,v 1.32 1999-04-29 11:38:45 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    132132    if (j > strat->tl)
    133133    {
    134 #ifdef KDEBUG
    135134      if (TEST_OPT_DEBUG) PrintLn();
    136 #endif
    137135      return;
    138136    }
    139 #ifdef KDEBUG
    140137    if (TEST_OPT_DEBUG) Print("%d",j);
    141 #endif
    142138    if (pDivisibleBy1(strat->T[j].p,(*h).p))
    143139    {
    144140      //if (strat->interpt) test_int_std(strat->kIdeal);
    145 #ifdef KDEBUG
    146141      if (TEST_OPT_DEBUG) PrintS("+");
    147 #endif
    148142      /*- compute the s-polynomial -*/
    149143      if (strat->T[j].ecart > (*h).ecart)
     
    162156            /*- h will not become the next element to reduce -*/
    163157            enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    164 #ifdef KDEBUG
    165158            if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at);
    166 #endif
    167159            (*h).p = NULL;
    168160            strat->fromT = FALSE;
     
    182174      if ((*h).p == NULL)
    183175      {
    184 #ifdef KDEBUG
    185176        if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    186 #endif
    187177        if (h->lcm!=NULL) pFree1((*h).lcm);
    188178        return;
     
    205195        if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
    206196        {
    207 #ifdef KDEBUG
    208197          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    209 #endif
    210198          return;
    211199        }
     
    231219          } while (!pDivisibleBy1(strat->S[i],(*h).p));
    232220          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    233 #ifdef KDEBUG
    234221          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
    235 #endif
    236222          (*h).p = NULL;
    237223          return;
     
    244230      }
    245231      j = 0;
    246 #ifdef KDEBUG
    247232      if TEST_OPT_DEBUG PrintLn();
    248 #endif
    249233    }
    250234    else
    251235    {
    252 #ifdef KDEBUG
    253236      if (TEST_OPT_DEBUG) PrintS("-");
    254 #endif
    255237      j++;
    256238    }
     
    276258    if (j > strat->tl)
    277259    {
    278 #ifdef KDEBUG
    279260      if (TEST_OPT_DEBUG) PrintLn();
    280 #endif
    281261      return;
    282262    }
    283 #ifdef KDEBUG
    284263    if (TEST_OPT_DEBUG) Print("%d",j);
    285 #endif
    286264    if (pDivisibleBy1(strat->T[j].p,(*h).p))
    287265    {
    288266      //if (strat->interpt) test_int_std(strat->kIdeal);
    289 #ifdef KDEBUG
    290267      if (TEST_OPT_DEBUG) PrintS("+");
    291 #endif
    292268      /*- compute the s-polynomial -*/
    293269      pi = strat->T[j].p;
     
    305281        i++;
    306282        if (i > strat->tl) break;
    307 #ifdef KDEBUG
    308283        if (TEST_OPT_DEBUG) Print("%d",i);
    309 #endif
    310284        if ((((strat->T[i]).ecart < ei)
    311285          || (((strat->T[i]).ecart == ei)
     
    313287          && pDivisibleBy1((strat->T[i]).p,(*h).p))
    314288        {
    315 #ifdef KDEBUG
    316289          if (TEST_OPT_DEBUG) PrintS("+");
    317 #endif
    318290          /*
    319291           * the polynomial to reduce with is now;
     
    323295          li = strat->T[i].length;
    324296        }
    325 #ifdef KDEBUG
    326297        else if (TEST_OPT_DEBUG) PrintS("-");
    327 #endif
    328298      }
    329299      /*
     
    345315            /*- h will not become the next element to reduce -*/
    346316            enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    347 #ifdef KDEBUG
    348317            if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at);
    349 #endif
    350318            (*h).p = NULL;
    351319            strat->fromT = FALSE;
     
    361329        }
    362330      }
    363 #ifdef KDEBUG
    364331      if (TEST_OPT_DEBUG)
    365332      {
     
    368335        wrp(pi);
    369336      }
    370 #endif
    371337      doRed(h,&pi,strat->fromT,strat);
    372338      strat->fromT=FALSE;
    373 #ifdef KDEBUG
    374339      if (TEST_OPT_DEBUG)
    375340      {
     
    378343        PrintLn();
    379344      }
    380 #endif
    381345      if ((*h).p == NULL)
    382346      {
     
    401365        if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
    402366        {
    403 #ifdef KDEBUG
    404367          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    405 #endif
    406368          return;
    407369        }
     
    428390          } while (!pDivisibleBy1(strat->S[i],(*h).p));
    429391          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    430 #ifdef KDEBUG
    431392          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
    432 #endif
    433393          (*h).p = NULL;
    434394          return;
     
    444404    else
    445405    {
    446 #ifdef KDEBUG
    447406      if (TEST_OPT_DEBUG) PrintS("-");
    448 #endif
    449407      j++;
    450408    }
     
    469427    if (j > strat->tl)
    470428    {
    471 #ifdef KDEBUG
    472429      if (TEST_OPT_DEBUG) PrintLn();
    473 #endif
    474430      return;
    475431    }
    476 #ifdef KDEBUG
    477432    if (TEST_OPT_DEBUG) Print("%d",j);
    478 #endif
    479433    if (pDivisibleBy1(strat->T[j].p,(*h).p))
    480434    {
    481435      //if (strat->interpt) test_int_std(strat->kIdeal);
    482 #ifdef KDEBUG
    483436      if (TEST_OPT_DEBUG) PrintS("+\n");
    484 #endif
    485437      /*
    486438      * the polynomial to reduce with is;
     
    489441      if (!TEST_OPT_INTSTRATEGY)
    490442        pNorm(strat->T[j].p);
    491 #ifdef KDEBUG
    492443      if (TEST_OPT_DEBUG)
    493444      {
     
    496447        wrp(strat->T[j].p);
    497448      }
    498 #endif
    499449      (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether,
    500450                          strat->spSpolyLoop);
    501 #ifdef KDEBUG
    502451      if (TEST_OPT_DEBUG)
    503452      {
     
    505454        wrp(h->p);
    506455      }
    507 #endif
    508456      if ((*h).p == NULL)
    509457      {
     
    519467        if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
    520468        {
    521 #ifdef KDEBUG
    522469          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    523 #endif
    524470          return;
    525471        }
     
    546492          } while (!pDivisibleBy1(strat->S[i],(*h).p));
    547493          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    548 #ifdef KDEBUG
    549494          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
    550 #endif
    551495          (*h).p = NULL;
    552496          return;
     
    559503      }
    560504      j = 0;
    561 #ifdef KDEBUG
    562505      if TEST_OPT_DEBUG PrintLn();
    563 #endif
    564506    }
    565507    else
    566508    {
    567 #ifdef KDEBUG
    568509      if (TEST_OPT_DEBUG) PrintS("-");
    569 #endif
    570510      j++;
    571511    }
     
    591531    if (j > strat->tl)
    592532    {
    593 #ifdef KDEBUG
    594533      if (TEST_OPT_DEBUG) PrintLn();
    595 #endif
    596534      return;
    597535    }
    598 #ifdef KDEBUG
    599536    if (TEST_OPT_DEBUG) Print("%d",j);
    600 #endif
    601537    if (pDivisibleBy1(strat->T[j].p,(*h).p))
    602538    {
    603539      //if (strat->interpt) test_int_std(strat->kIdeal);
    604 #ifdef KDEBUG
    605540      if (TEST_OPT_DEBUG) PrintS("+");
    606 #endif
    607541      /*- compute the s-polynomial -*/
    608542      pi = strat->T[j].p;
     
    619553        i++;
    620554        if (i > strat->tl) break;
    621 #ifdef KDEBUG
    622555        if (TEST_OPT_DEBUG) Print("%d",i);
    623 #endif
    624556        if (((strat->T[i].ecart < ei)
    625557          || ((strat->T[i].ecart == ei)
     
    627559        && pDivisibleBy1(strat->T[i].p,(*h).p))
    628560        {
    629 #ifdef KDEBUG
    630561          if (TEST_OPT_DEBUG) PrintS("+");
    631 #endif
    632562          /*
    633563          * the polynomial to reduce with is now:
     
    639569        else
    640570        {
    641 #ifdef KDEBUG
    642571          if (TEST_OPT_DEBUG) PrintS("-");
    643 #endif
    644572        }
    645573      }
     
    662590            /*- h will not become the next element to reduce -*/
    663591            enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    664 #ifdef KDEBUG
    665592            if (TEST_OPT_DEBUG) Print(" ecart too big; -> L%d\n",at);
    666 #endif
    667593            (*h).p = NULL;
    668594            strat->fromT = FALSE;
     
    678604        }
    679605      }
    680 #ifdef KDEBUG
    681606      if (TEST_OPT_DEBUG)
    682607      {
     
    685610        wrp(pi);
    686611      }
    687 #endif
    688612      doRed(h,&pi,strat->fromT,strat);
    689613      strat->fromT=FALSE;
    690 #ifdef KDEBUG
    691614      if (TEST_OPT_DEBUG)
    692 #endif
    693615      {
    694616        PrintS(" to ");
     
    716638        if ((strat->syzComp>0) && (pMinComp((*h).p) > strat->syzComp))
    717639        {
    718 #ifdef KDEBUG
    719640          if (TEST_OPT_DEBUG) PrintS(" > sysComp\n");
    720 #endif
    721641          return;
    722642        }
     
    743663          } while (!pDivisibleBy1(strat->S[i],(*h).p));
    744664          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    745 #ifdef KDEBUG
    746665          if (TEST_OPT_DEBUG) Print(" degree jumped; ->L%d\n",at);
    747 #endif
    748666          (*h).p = NULL;
    749667          return;
     
    756674      }
    757675      j = 0;
    758 #ifdef KDEBUG
    759676      if TEST_OPT_DEBUG PrintLn();
    760 #endif
    761677    }
    762678    else
    763679    {
    764 #ifdef KDEBUG
    765680      if (TEST_OPT_DEBUG) PrintS("-");
    766 #endif
    767681      j++;
    768682    }
     
    791705    if (j > strat->tl)
    792706    {
    793 #ifdef KDEBUG
    794707      if (TEST_OPT_DEBUG) PrintLn();
    795 #endif
    796708      return H.p;
    797709    }
    798 #ifdef KDEBUG
    799710    if (TEST_OPT_DEBUG) Print("%d",j);
    800 #endif
    801711    if (pDivisibleBy1(strat->T[j].p,H.p))
    802712    {
    803713      //if (strat->interpt) test_int_std(strat->kIdeal);
    804 #ifdef KDEBUG
    805714      if (TEST_OPT_DEBUG) PrintS("+");
    806 #endif
    807715      /*- remember the found T-poly -*/
    808716      pi = strat->T[j].p;
     
    820728        if (j > strat->tl) break;
    821729        if (ei <= H.ecart) break;
    822 #ifdef KDEBUG
    823730        if (TEST_OPT_DEBUG) Print("%d",j);
    824 #endif
    825731        if (((strat->T[j].ecart < ei)
    826732          || ((strat->T[j].ecart == ei)
     
    828734        && pDivisibleBy1(strat->T[j].p,H.p))
    829735        {
    830 #ifdef KDEBUG
    831736          if (TEST_OPT_DEBUG) PrintS("+");
    832 #endif
    833737          /*
    834738          * the polynomial to reduce with is now;
     
    840744        else
    841745        {
    842 #ifdef KDEBUG
    843746          if (TEST_OPT_DEBUG) PrintS("-");
    844 #endif
    845747        }
    846748      }
     
    863765        if (H.p == NULL)
    864766        {
    865 #ifdef KDEBUG
    866767          if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    867 #endif
    868768          return NULL;
    869769        }
     
    877777        if (H.p == NULL)
    878778        {
    879 #ifdef KDEBUG
    880779          if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    881 #endif
    882780          return NULL;
    883781        }
     
    891789    else
    892790    {
    893 #ifdef KDEBUG
    894791      if (TEST_OPT_DEBUG) PrintS("-");
    895 #endif
    896792      j++;
    897793    }
     
    12611157  strat->ecartS[atS] = p.ecart;
    12621158  strat->sl++;
    1263 #ifdef KDEBUG
    12641159  if (TEST_OPT_DEBUG)
    12651160  {
     
    12681163    PrintLn();
    12691164  }
    1270 #endif
    12711165  if ((!strat->kHEdgeFound) || (strat->kNoether!=NULL)) HEckeTest(p.p,strat);
    12721166  if (strat->kHEdgeFound)
     
    14471341    if (lrmax< strat->Ll) lrmax=strat->Ll; /*stat*/
    14481342    //test_int_std(strat->kIdeal);
    1449 #ifdef KDEBUG
    14501343    if (TEST_OPT_DEBUG) messageSets(strat);
    1451 #endif
    14521344    if (TEST_OPT_DEGBOUND
    14531345    && (strat->L[strat->Ll].ecart+pFDeg(strat->L[strat->Ll].p)> Kstd1_deg))
     
    15641456          }
    15651457          if (strat->P.lcm!=NULL) pFree1(strat->P.lcm);
    1566 #ifdef KDEBUG
    15671458          strat->P.lcm=NULL;
    1568 #endif
    15691459#ifdef SDRING
    15701460        }
     
    18671757  if (TEST_OPT_SB_1)
    18681758    strat->newIdeal = newIdeal;
    1869   if (rField_has_simple_inverse() || rField_is_R())
     1759  if (rField_has_simple_inverse())
    18701760    strat->LazyPass=20;
    18711761  else
     
    20821972  if(!TEST_OPT_RETURN_SB)
    20831973     strat->syzComp = syzComp;
    2084   if (rField_has_simple_inverse() || rField_is_R())
     1974  if (rField_has_simple_inverse())
    20851975    strat->LazyPass=20;
    20861976  else
  • Singular/kstd2.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.23 1999-03-08 17:30:39 Singular Exp $ */
     4/* $Id: kstd2.cc,v 1.24 1999-04-29 11:38:46 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    8181    }
    8282  }
    83 #ifdef KDEBUG
    8483  if (TEST_OPT_DEBUG)
    8584  {
     
    8887    PrintS(" ");
    8988  }
    90 #endif
    9189  loop
    9290  {
    93 #ifdef KDEBUG
    9491    if (TEST_OPT_DEBUG) Print("%d",j);
    95 #endif
    9692    if (pDivisibleBy(strat->S[j],(*h).p))
    9793    {
    98 #ifdef KDEBUG
    9994      if (TEST_OPT_DEBUG)
    10095      {
     
    10297        wrp(strat->S[j]);
    10398      }
    104 #endif
    10599      if ((!exchanged) && (pEqual((*h).p,strat->S[j])))
    106100      {
     
    136130      if ((*h).p == NULL)
    137131      {
    138 #ifdef KDEBUG
    139132        if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    140 #endif
    141133        if (h->lcm!=NULL) pFree1((*h).lcm);
    142134#ifdef KDEBUG
     
    194186*  and the case of a degree-ordering
    195187*/
    196 #ifdef KDEBUG
    197188static reductions = 0;
    198 #endif
    199189
    200190static void redHomog (LObject* h,kStrategy strat)
     
    208198  int j = 0;
    209199
    210 #ifdef KDEBUG
    211200  if (TEST_OPT_DEBUG)
    212201  {
     
    215204    PrintS(" ");
    216205  }
    217 #endif
    218206  if (strat->ak!=0)
    219207  {
    220208    loop
    221209      {
    222 #ifdef KDEBUG
    223210        if (TEST_OPT_DEBUG) Print("%d",j);
    224 #endif
    225211        if (pDivisibleBy1(strat->S[j],(*h).p))
    226212        {
    227 #ifdef KDEBUG
    228213          reductions++;
    229214          if (TEST_OPT_DEBUG)
     
    232217            wrp(strat->S[j]);
    233218          }
    234 #endif
    235219          //if (strat->interpt) test_int_std(strat->kIdeal);
    236220          /*- compute the s-polynomial -*/
     
    239223          if ((*h).p == NULL)
    240224          {
    241 #ifdef KDEBUG
    242225            if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    243 #endif
    244226            if (h->lcm!=NULL) pFree1((*h).lcm);
    245227#ifdef KDEBUG
     
    266248    loop
    267249      {
    268 #ifdef KDEBUG
    269250        if (TEST_OPT_DEBUG) Print("%d",j);
    270 #endif
    271251        if (pDivisibleBy2(strat->S[j],(*h).p))
    272252        {
    273 #ifdef KDEBUG
    274253          reductions++;
    275254          if (TEST_OPT_DEBUG)
     
    278257            wrp(strat->S[j]);
    279258          }
    280 #endif
    281259          //if (strat->interpt) test_int_std(strat->kIdeal);
    282260          /*- compute the s-polynomial -*/
     
    285263          if ((*h).p == NULL)
    286264          {
    287 #ifdef KDEBUG
    288265            if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    289 #endif
    290266            if (h->lcm!=NULL) pFree1((*h).lcm);
    291267#ifdef KDEBUG
     
    294270            return;
    295271          }
    296 #ifdef KDEBUG
    297272          if (TEST_OPT_DEBUG)
    298273          {
     
    301276            PrintS("\n");
    302277          }
    303 #endif
    304278          j = 0;
    305279        }
     
    332306  int k = 0;
    333307
    334 #ifdef KDEBUG
    335308  if (TEST_OPT_DEBUG)
    336309  {
     
    339312    PrintS(" ");
    340313  }
    341 #endif
    342314  if (strat->ak)
    343315  {
    344316    loop
    345317      {
    346 #ifdef KDEBUG
    347318        if (TEST_OPT_DEBUG) Print("%d",j);
    348 #endif
    349319        if (pDivisibleBy1(strat->T[j].p,(*h).p))
    350320        {
    351321          //if (strat->interpt) test_int_std(strat->kIdeal);
    352 #ifdef KDEBUG
    353322          if (TEST_OPT_DEBUG)
    354323          {
     
    356325            wrp(strat->S[j]);
    357326          }
    358 #endif
    359327          /*- compute the s-polynomial -*/
    360328          (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether,
     
    362330          if ((*h).p == NULL)
    363331          {
    364 #ifdef KDEBUG
    365332            if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    366 #endif
    367333            if (h->lcm!=NULL) pFree1((*h).lcm);
    368334#ifdef KDEBUG
     
    396362
    397363        // no module component
    398 #ifdef KDEBUG
    399364        if (TEST_OPT_DEBUG) Print("%d",j);
    400 #endif
    401365        if (pDivisibleBy2(strat->T[j].p,(*h).p))
    402366        {
    403367          //if (strat->interpt) test_int_std(strat->kIdeal);
    404 #ifdef KDEBUG
    405368          if (TEST_OPT_DEBUG)
    406369          {
     
    408371            wrp(strat->S[j]);
    409372          }
    410 #endif
    411373          /*- compute the s-polynomial -*/
    412374          (*h).p = spSpolyRed(strat->T[j].p,(*h).p,strat->kNoether,
     
    414376          if ((*h).p == NULL)
    415377          {
    416 #ifdef KDEBUG
    417378            if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    418 #endif
    419379            if (h->lcm!=NULL) pFree1((*h).lcm);
    420380#ifdef KDEBUG
     
    462422  int reddeg = pFDeg((*h).p);
    463423
    464 #ifdef KDEBUG
    465424  if (TEST_OPT_DEBUG)
    466425  {
     
    469428    PrintS(" ");
    470429  }
    471 #endif
    472430  loop
    473431  {
     
    475433    {
    476434      //if (strat->interpt) test_int_std(strat->kIdeal);
    477 #ifdef KDEBUG
    478435      if (TEST_OPT_DEBUG)
    479436      {
     
    481438        wrp(strat->S[j]);
    482439      }
    483 #endif
    484440      /*- compute the s-polynomial -*/
    485441      (*h).p = spSpolyRed(strat->S[j],(*h).p,strat->kNoether
     
    487443      if ((*h).p == NULL)
    488444      {
    489 #ifdef KDEBUG
    490445        if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    491 #endif
    492446        if (h->lcm!=NULL) pFree1((*h).lcm);
    493447#ifdef KDEBUG
     
    523477          }
    524478          while (!pDivisibleBy1(strat->S[i],(*h).p));
    525 #ifdef KDEBUG
    526479          if (TEST_OPT_DEBUG) Print(" ->L[%d]\n",at);
    527 #endif
    528480          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    529481          (*h).p = NULL;
     
    542494      if (j >= strat->sl)
    543495      {
    544 #ifdef KDEBUG
    545496        if (TEST_OPT_DEBUG) PrintLn();
    546 #endif
    547497        if (TEST_OPT_INTSTRATEGY)
    548498        {
     
    576526  pass = j = 0;
    577527  d = reddeg = pFDeg((*h).p)+(*h).ecart;
    578 #ifdef KDEBUG
    579528  if (TEST_OPT_DEBUG)
    580529  {
     
    582531    wrp((*h).p);
    583532  }
    584 #endif
    585533  loop
    586534  {
    587535    if (pDivisibleBy1(strat->T[j].p,(*h).p))
    588536    {
    589 #ifdef KDEBUG
    590537      if (TEST_OPT_DEBUG) Print(" T[%d]",j);
    591 #endif
    592538      pi = strat->T[j].p;
    593539      ei = strat->T[j].ecart;
     
    607553        if ((strat->T[i].ecart < ei) && pDivisibleBy1(strat->T[i].p,(*h).p))
    608554        {
    609 #ifdef KDEBUG
    610555          if (TEST_OPT_DEBUG) Print(" T[%d]",i);
    611 #endif
    612556          /*
    613557          * the polynomial to reduce with is now;
     
    635579          {
    636580            enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    637 #ifdef KDEBUG
    638581            if (TEST_OPT_DEBUG) Print(" ecart too big: -> L%d\n",at);
    639 #endif
    640582            (*h).p = NULL;
    641583            return;
     
    650592        }
    651593      }
    652 #ifdef KDEBUG
    653594      if (TEST_OPT_DEBUG)
    654595      {
     
    656597        wrp(pi);
    657598      }
    658 #endif
    659599      if (strat->fromT)
    660600      {
     
    665605      else
    666606        (*h).p = spSpolyRed(pi,(*h).p,strat->kNoether, strat->spSpolyLoop);
    667 #ifdef KDEBUG
    668607      if (TEST_OPT_DEBUG)
    669608      {
     
    672611        PrintLn();
    673612      }
    674 #endif
    675613      if ((*h).p == NULL)
    676614      {
     
    726664          } while (!pDivisibleBy1(strat->S[i],(*h).p));
    727665          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    728 #ifdef KDEBUG
    729666          if (TEST_OPT_DEBUG)
    730667            Print(" degree jumped: -> L%d\n",at);
    731 #endif
    732668          (*h).p = NULL;
    733669          return;
     
    745681      if (j >= strat->tl)
    746682      {
    747 #ifdef KDEBUG
    748683        if (TEST_OPT_DEBUG) PrintLn();
    749 #endif
    750684        if (TEST_OPT_INTSTRATEGY)
    751685        {
     
    929863  int z = 3;
    930864
    931 #ifdef KDEBUG
    932865 if (TEST_OPT_DEBUG)
    933866 {
    934867   PrintS("red:");wrp(h);
    935868 }
    936 #endif
    937869  if (0 > strat->sl)
    938870  {
    939 #ifdef KDEBUG
    940871    if (TEST_OPT_DEBUG) PrintLn();
    941 #endif
    942872    return h;
    943873  }
     
    948878      //if (strat->interpt) test_int_std(strat->kIdeal);
    949879      /*- compute the s-polynomial -*/
    950 #ifdef KDEBUG
    951880      if (TEST_OPT_DEBUG)
    952881      {
    953882        Print("\nwith S[%d]:",j);wrp(strat->S[j]);
    954883      }
    955 #endif
    956884      h = spSpolyRed(strat->S[j],h,strat->kNoether, strat->spSpolyLoop);
    957 #ifdef KDEBUG
    958885      if (TEST_OPT_DEBUG)
    959886      {
     
    962889        if (h==NULL) PrintLn();
    963890      }
    964 #endif
    965891      if (h == NULL) return NULL;
    966892      z++;
     
    10781004    {
    10791005      if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/
    1080 #ifdef KDEBUG
    10811006      if (TEST_OPT_DEBUG) messageSets(strat);
    1082 #endif
    10831007      //test_int_std(strat->kIdeal);
    10841008      if (strat->Ll== 0) strat->interpt=TRUE;
     
    12311155                  }
    12321156                }
    1233 #ifdef KDEBUG
    12341157                if (TEST_OPT_DEBUG)
    12351158                {
     
    12381161                  PrintLn();
    12391162                }
    1240 #endif
    12411163                if((strat->P.p1==NULL) && (strat->minim>0))
    12421164                {
     
    12921214  if((stdTrace!=NULL && stdTrace->ResultSend) || (stdTrace == NULL))
    12931215  {
    1294 #ifdef KDEBUG
    12951216    if (TEST_OPT_DEBUG) messageSets(strat);
    1296 #endif
    12971217    /* complete reduction of the standard basis--------- */
    12981218    if (TEST_OPT_REDSB) completeReduce(strat);
     
    13581278  {
    13591279    if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/
    1360 #ifdef KDEBUG
    13611280    if (TEST_OPT_DEBUG) messageSets(strat);
    1362 #endif
    13631281    //test_int_std(strat->kIdeal);
    13641282    if (strat->Ll== 0) strat->interpt=TRUE;
     
    14861404                }
    14871405              }
    1488 #ifdef KDEBUG
    14891406              if (TEST_OPT_DEBUG)
    14901407              {
     
    14931410                PrintLn();
    14941411              }
    1495 #endif
    14961412              if((strat->P.p1==NULL) && (strat->minim>0))
    14971413              {
     
    15291445    kTest(strat);
    15301446  }
    1531 #ifdef KDEBUG
    15321447  if (TEST_OPT_DEBUG) messageSets(strat);
    1533 #endif
    15341448  /* complete reduction of the standard basis--------- */
    15351449  if (TEST_OPT_REDSB) completeReduce(strat);
     
    16801594  kStrategy strat=(kStrategy)Alloc0(sizeof(skStrategy));
    16811595
    1682   if (rField_has_simple_inverse() || rField_is_R())
     1596  if (rField_has_simple_inverse())
    16831597    strat->LazyPass=20;
    16841598  else
  • Singular/kstdfac.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.21 1999-03-08 17:30:39 Singular Exp $ */
     4/* $Id: kstdfac.cc,v 1.22 1999-04-29 11:38:47 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    753753  sleftv v; memset(&v,0,sizeof(v));
    754754
    755   if (rField_has_simple_inverse() || rField_is_R())
     755  if (rField_has_simple_inverse())
    756756    strat->LazyPass=20;
    757757  else
  • Singular/kutil.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.31 1998-11-16 08:41:18 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.32 1999-04-29 11:38:48 Singular Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    31473147        && ((strat->fromQ==NULL) || (strat->fromQ[i]==0)))
    31483148        {
    3149 #ifdef KDEBUG
    31503149          if (TEST_OPT_DEBUG)
    31513150          {
     
    31533152            wrp(strat->S[i]);
    31543153          }
    3155 #endif
    31563154          pDelete(&redSi);
    31573155          redSi = pHead(strat->S[i]);
     
    31703168          {
    31713169            pDelete(&redSi);
    3172 #ifdef KDEBUG
    31733170            if (TEST_OPT_DEBUG) PrintS(" to 0");
    3174 #endif
    31753171            deleteInS(i,strat);
    31763172            i--;
     
    32023198              if (h.p!=NULL)
    32033199              {
    3204 #ifdef KDEBUG
    32053200                if (TEST_OPT_DEBUG)
    32063201                {
     
    32093204                  PrintLn();
    32103205                }
    3211 #endif
    32123206                if (TEST_OPT_INTSTRATEGY)
    32133207                {
     
    32393233              pNorm(strat->S[i]);
    32403234            }
    3241 #ifdef KDEBUG
    32423235            if (TEST_OPT_DEBUG)
    32433236            {
     
    32453238              wrp(strat->S[i]);
    32463239            }
    3247 #endif
    32483240          }
    3249 #ifdef KDEBUG
    32503241          if (TEST_OPT_DEBUG) PrintLn();
    3251 #endif
    32523242        }
    32533243        i++;
     
    35793569  * - in local rings, - in lex order case, -in ring over extensions */
    35803570  strat->noTailReduction = !TEST_OPT_REDTAIL;
    3581 #ifdef KDEBUG
    35823571  if (TEST_OPT_DEBUG)
    35833572  {
     
    35853574    else              PrintS("ideal/module is not homogeneous\n");
    35863575  }
    3587 #endif
    35883576}
    35893577
     
    38833871    }
    38843872    strat->HCord=j;
    3885 #ifdef KDEBUG
    38863873    if (TEST_OPT_DEBUG)
    38873874    {
     
    38903877      PrintLn();
    38913878    }
    3892 #endif
    38933879  }
    38943880  if (pComp(strat->kNoether,newNoether)!=1)
  • Singular/longrat.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longrat.cc,v 1.17 1998-05-27 17:14:06 Singular Exp $ */
     4/* $Id: longrat.cc,v 1.18 1999-04-29 11:38:49 Singular Exp $ */
    55/*
    66* ABSTRACT: computation with long rational numbers (Hubert Grassmann)
     
    19411941void nlNormalize (number &x)
    19421942{
    1943 #ifdef LDEBUG
    1944   nlTest(x);
    1945 #endif
    19461943  if ((SR_HDL(x) & SR_INT) ||(x==NULL))
    19471944    return;
     1945#ifdef LDEBUG
     1946  nlTest(x);
     1947#endif
    19481948  if (x->s==3)
    19491949  {
  • Singular/mpsr.h

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr.h,v 1.14 1999-03-08 18:11:48 Singular Exp $ */
     4/* $Id: mpsr.h,v 1.15 1999-04-29 11:38:51 Singular Exp $ */
    55/***************************************************************
    66 *
     
    100100  {
    101101#ifdef PDEBUG
    102     nSetChar(rInternalChar(rg), TRUE, rg->parameter,rPar(rg));
     102    nSetChar(rg, TRUE);
    103103#else
    104     nSetChar(rInternalChar(rg), complete, rg->parameter,rPar(rg));
     104    nSetChar(rg, complete);
    105105#endif
    106106    pChangeRing(rg->N, rg->OrdSgn, rg->order, rg->block0, rg->block1,
  • Singular/mpsr_GetMisc.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_GetMisc.cc,v 1.13 1999-03-08 18:11:49 Singular Exp $ */
     4/* $Id: mpsr_GetMisc.cc,v 1.14 1999-04-29 11:38:52 Singular Exp $ */
    55
    66/***************************************************************
     
    3838{
    3939  // check for currRing
    40   if (currRing != NULL && rInternalChar(currRing) == ch) 
     40  if (currRing != NULL && rInternalChar(currRing) == ch)
    4141  // orig: currRing->ch==ch ???
    4242  {
    4343    int i, n = currRing->N;
    4444    char **names = currRing->names;
    45    
     45
    4646    for (i=0; i<n; i++)
    4747    {
     
    6060ring mpsr_rDefault(short ch)
    6161{
    62   if (currRing != NULL && rInternalChar(currRing) == ch) 
     62  if (currRing != NULL && rInternalChar(currRing) == ch)
    6363  // orig: currRing->ch==ch ???
    6464  {
     
    157157    int i, n;
    158158    poly *m1, *m2;
    159    
     159
    160160    if (id2 == NULL) return 0;
    161161    if ((n = IDELEMS(id1)) != IDELEMS(id2)) return 0;
     
    172172}
    173173
    174  
     174
    175175// returns TRUE, if r1 less or equals r2
    176176// FALSE, otherwise
     
    201201      r1->order[1] != r2->order[1])
    202202    return 0;
    203  
     203
    204204  for (i=0; i<rPar(r1);i++)
    205205  {
     
    259259  lv = mlv1->lv;
    260260  while (lv->next != NULL) lv = lv->next;
    261  
     261
    262262  lv->next = mlv2->lv;
    263263  mlv1->r = r;
     
    274274{
    275275  int i, n;
    276  
     276
    277277  while (l != NULL)
    278278  {
    279279    short typ = l->Typ();
    280    
     280
    281281    switch(typ)
    282282    {
     
    310310          break;
    311311        }
    312          
     312
    313313        case LIST_CMD:
    314314        {
     
    342342          mpsr_SetCurrRing(to_ring, TRUE);
    343343          nSetMap(rInternalChar(from_ring), from_ring->parameter,
    344             rPar(from_ring), from_ring->minpoly);
     344            rPar(from_ring), from_ring->minpoly);
    345345          l->data = (void *) nMap(nn);
    346346          mpsr_SetCurrRing(from_ring, FALSE);
     
    351351  }
    352352}
    353          
    354            
     353
     354
    355355// searches for a ring handle which has a ring which is equal to r
    356356// if one is found, then this one is set to the new global ring
     
    366366    return;
    367367  }
    368  
     368
    369369  rTest(r);
    370370  // try to find an idhdl which is an equal ring
     
    420420  return grname;
    421421}
    422        
     422
    423423// searches through the Singular namespace for a matching name:
    424424// the first found is returned together witht the respective ring
     
    431431#endif /* HAVE_NAMESPACES */
    432432  r = NULL;
    433  
     433
    434434  if (h != NULL)
    435435  {
     
    445445      h2 = (IDRING(h)->idroot!=NULL ?IDRING(h)->idroot->get(name, 0) :
    446446            (idhdl) NULL);
    447      
     447
    448448      if (h2 != NULL)
    449449      {
     
    550550#ifdef  PARI_BIGINT_TEST
    551551  init(4000000, 2);
    552 #endif 
     552#endif
    553553}
    554554
  • Singular/numbers.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: numbers.cc,v 1.8 1999-01-21 15:00:08 Singular Exp $ */
     4/* $Id: numbers.cc,v 1.9 1999-04-29 11:38:52 Singular Exp $ */
    55
    66/*
     
    1818#include "longalg.h"
    1919#include "modulop.h"
     20#include "gnumpfl.h"
     21#include "ring.h"
    2022#ifndef FAST_AND_DIRTY
    2123#undef npMultM
     
    8890* init operations for characteristic c (complete==TRUE)
    8991* init nDelete    for characteristic c (complete==FALSE)
    90 * param: the names of the parameters (read-only)
    9192*/
    92 void nSetChar(int c, BOOLEAN complete, char ** param, int pars)
     93void nSetChar(ring r, BOOLEAN complete)
    9394{
     95  int c=rInternalChar(r);
     96
    9497  if (nNULL!=NULL)
    9598  {
     
    103106    nSize  = ndSize;
    104107  }
    105   //Print("n:c=%d compl=%d param=%d\n",c,complete,param);
    106   if ((c == 1) || (c< (-1)))
    107   {
    108     naSetChar(c,complete,param,pars);
     108  //Print("n:c=%d compl=%d param=%d\n",c,complete,r->parameter);
     109  //if ((c == 1) || (c< (-1)))
     110  if (rField_is_Extension(r))
     111  {
     112    naSetChar(c,complete,r->parameter,rPar(r));
    109113#ifdef LDEBUG
    110114    nDBDelete= naDBDelete;
     
    152156  }
    153157  else
    154   if (c == 0)
     158  if (rField_is_Q(r))
    155159  {
    156160#ifdef LDEBUG
     
    195199    }
    196200  }
    197   else if ((c>1)&&(param==NULL))
     201  else if (rField_is_Zp(r))
    198202  /*----------------------char. p----------------*/
    199203  {
     
    241245  }
    242246  else
    243   if (c>1)
     247  /* -------------- GF(p^m) -----------------------*/
     248  if (rField_is_GF(r))
    244249  {
    245250#ifdef LDEBUG
     
    251256    {
    252257      test &= ~Sy_bit(OPT_INTSTRATEGY); /*26*/
    253       nfSetChar(c,param);
     258      nfSetChar(c,r->parameter);
    254259      nNew   = nDummy1;
    255260      nNormalize=nDummy2;
     
    288293  }
    289294  else
    290   //if (c==(-1)) // the rest...
     295  /* -------------- R -----------------------*/
     296  //if (c==(-1))
     297  if (rField_is_R(r))
    291298  {
    292299#ifdef LDEBUG
     
    330337    }
    331338  }
     339  else
     340  /* -------------- long R -----------------------*/
     341  if (rField_is_long_R(r))
     342  {
     343    setGMPFloatPrecBytes(r->ch_flags);
     344#ifdef LDEBUG
     345    nDBDelete= ngfDBDelete;
     346#else
     347    nDelete= ngfDelete;
     348#endif
     349    if (complete)
     350    {
     351      nNew=ngfNew;
     352      nNormalize=nDummy2;
     353      nInit  = ngfInit;
     354      nInt   = ngfInt;
     355      nAdd   = ngfAdd;
     356      nSub   = ngfSub;
     357      nMult  = ngfMult;
     358      nDiv   = ngfDiv;
     359      nExactDiv= ngfDiv;
     360      nIntDiv= ngfDiv;
     361      nIntMod= ngfIntMod;
     362      nNeg   = ngfNeg;
     363      nInvers= ngfInvers;
     364      nCopy  = ngfCopy;
     365      nGreater = ngfGreater;
     366      nEqual = ngfEqual;
     367      nIsZero = ngfIsZero;
     368      nIsOne = ngfIsOne;
     369      nIsMOne = ngfIsMOne;
     370      nGreaterZero = ngfGreaterZero;
     371      nWrite = ngfWrite;
     372      nRead = ngfRead;
     373      nPower = ngfPower;
     374      nGcd  = ndGcd;
     375      nLcm  = ndGcd; /* tricky, isn't it ?*/
     376      nSetMap=ngfSetMap;
     377      nName=ndName;
     378      /*nSize  = ndSize;*/
     379#ifdef LDEBUG
     380      nDBTest=ngfDBTest;
     381#endif
     382    }
     383  }
     384#ifdef TEST
     385  else
     386  {
     387    WerrorS("unknown field");
     388  }
     389#endif
    332390  if (complete&&(!errorreported)) nNULL=nInit(0);
    333391}
  • Singular/numbers.h

    r4be737 r8a150b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: numbers.h,v 1.5 1997-08-12 17:14:42 Singular Exp $ */
     6/* $Id: numbers.h,v 1.6 1999-04-29 11:38:54 Singular Exp $ */
    77/*
    88* ABSTRACT: interface to coefficient aritmetics
     
    6565#endif
    6666int  nGetChar();
    67 void nSetChar(int c, BOOLEAN complete, char **param, int pars);
     67void nSetChar(ring r, BOOLEAN complete);
    6868
    6969#ifndef FAST_AND_DIRTY
  • Singular/polys0.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys0.cc,v 1.9 1998-10-06 08:24:27 Singular Exp $ */
     4/* $Id: polys0.cc,v 1.10 1999-04-29 11:38:54 Singular Exp $ */
    55
    66/*
     
    2727  BOOLEAN wroteCoef=FALSE,writeGen=FALSE;
    2828
    29   nNormalize(pGetCoeff(p));
     29  if (pGetCoeff(p)!=NULL)
     30    nNormalize(pGetCoeff(p));
    3031
    3132  if (((pGetComp(p) == (short)ko)
  • Singular/polys1.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys1.cc,v 1.20 1999-04-14 18:32:00 Singular Exp $ */
     4/* $Id: polys1.cc,v 1.21 1999-04-29 11:38:55 Singular Exp $ */
    55
    66/*
     
    493493          if (rc == NULL)
    494494            return pMonPower(p,i);
    495           /* else: binom */
     495          /* else: binom */
    496496          int char_p=rChar(currRing);
    497497          if (pNext(rc) != NULL)
    498498            return pPow(p,i);
    499           if ((char_p==0) || (i<=char_p))
    500             return pTwoMonPower(p,i);
    501           poly p_p=pTwoMonPower(pCopy(p),char_p);
    502           return pMult(pPower(p,i-char_p),p_p);
     499          if ((char_p==0) || (i<=char_p))
     500            return pTwoMonPower(p,i);
     501          poly p_p=pTwoMonPower(pCopy(p),char_p);
     502          return pMult(pPower(p,i-char_p),p_p);
    503503        }
    504504      /*end default:*/
  • Singular/ring.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.51 1999-04-17 12:30:23 Singular Exp $ */
     4/* $Id: ring.cc,v 1.52 1999-04-29 11:38:56 Singular Exp $ */
    55
    66/*
     
    7171
    7272    /*------------ global variables related to coefficients ------------*/
    73     nSetChar(r->ch, complete, r->parameter, rPar(r));
     73    nSetChar(r, complete);
    7474
    7575    /*------------ global variables related to polys -------------------*/
     
    319319    return TRUE;
    320320  }
    321  
     321
    322322  // initialize fields of R
    323323  R->order=(int *)Alloc0(n*sizeof(int));
     
    403403          break;
    404404        }
    405        
     405
    406406        case ringorder_no:
    407407           R->order[n] = ringorder_unspec;
    408408           return TRUE;
    409            
     409
    410410        default:
    411411          Werror("Internal Error: Unknown ordering %d", (*iv)[1]);
     
    416416  }
    417417
    418   // check for complete coverage 
     418  // check for complete coverage
    419419  if ((R->order[n]==ringorder_c) ||  (R->order[n]==ringorder_C)) n--;
    420420  if (R->block1[n] != R->N)
     
    426426         (R->order[n]==ringorder_lp) ||
    427427         (R->order[n]==ringorder_ls))
    428         && 
     428        &&
    429429        R->block0[n] <= R->N)
    430430    {
     
    445445static BOOLEAN rSleftvList2StringArray(sleftv* sl, char** p)
    446446{
    447  
     447
    448448  while(sl!=NULL)
    449449  {
     
    454454        sleftv s_sl;
    455455        iiConvert(POLY_CMD,ANY_TYPE,-1,sl,&s_sl);
    456         if (s_sl.Name() != sNoName) 
     456        if (s_sl.Name() != sNoName)
    457457          *p = mstrdup(s_sl.Name());
    458458        else
     
    460460        sl->next = s_sl.next;
    461461        s_sl.next = NULL;
    462         s_sl.CleanUp(); 
     462        s_sl.CleanUp();
    463463        if (*p == NULL) return TRUE;
    464464      }
     
    478478//
    479479// rInit itself:
    480 // 
     480//
    481481// INPUT:  s: name, pn: ch & parameter (names), rv: variable (names)
    482482//         ord: ordering
    483 // RETURN: currRingHdl on success 
     483// RETURN: currRingHdl on success
    484484//         NULL        on error
    485485// NOTE:   * makes new ring to current ring, on success
     
    489489{
    490490  int ch;
     491  int float_len=0;
    491492  ring R = NULL;
    492493  idhdl tmp = NULL;
     
    502503  {
    503504    ch=-1;
     505    if ((pn->next!=NULL) && (pn->next->Typ()==INT_CMD))
     506    {
     507      float_len=(int)pn->next->Data();
     508      pn=pn->next;
     509    }
    504510  }
    505511  else
     
    509515  }
    510516  pn=pn->next;
    511  
     517
    512518  /* characteristic -----------------------------------------------*/
    513519  /* input: 0 ch=0 : Q     parameter=NULL    ffChar=FALSE
     
    521527  {
    522528    int l = 0;
    523    
    524     if (ch!=0 && (ch<2) || (ch > 32003)) 
     529
     530    if (ch!=0 && (ch<2) || (ch > 32003))
    525531    {
    526532      Warn("%d is invalid characteristic of ground field. 32003 is used.", ch);
     
    546552  R = (ring) Alloc0(sizeof(sip_sring));
    547553  R->ch = ch;
    548  
     554  if (ch == -1)
     555  {
     556    R->ch_flags= float_len;
     557  }
     558
    549559  /* parameter -------------------------------------------------------*/
    550560  if (pn!=NULL)
     
    579589    goto rInitError;
    580590  }
    581  
     591
    582592  /* ordering -------------------------------------------------------------*/
    583593  if (rSleftvOrdering2Ordering(ord, R))
     
    587597  if (rComplete(R))
    588598    goto rInitError;
    589  
     599
    590600  // try to enter the ring into the name list //
    591601  if ((tmp = enterid(s, myynest, RING_CMD, &IDROOT))==NULL)
    592602    goto rInitError;
    593  
     603
    594604  memcpy(IDRING(tmp),R,sizeof(*R));
    595605  // set current ring
     
    611621BOOLEAN rComplete(ring r, int force)
    612622{
    613  
     623
    614624  int VarCompIndex, VarLowIndex, VarHighIndex;
    615625  // check number of vars and number of params
    616626  if (r->N + 1 > (int) MAX_EXPONENT_NUMBER)
    617627  {
    618     Werror("Too many ring variables: %d is the maximum", 
     628    Werror("Too many ring variables: %d is the maximum",
    619629           MAX_EXPONENT_NUMBER -1);
    620630    return TRUE;
    621631  }
    622  
     632
    623633
    624634  r->VarOffset = (int*) Alloc((r->N + 1)*sizeof(int));
     
    694704    PrintS("//   characteristic : ");
    695705    if ( rField_is_R(r) )        PrintS("0 (real)\n");  /* R */
    696     else Print ("%d\n",rChar(r)); /* Fp(a) */
     706    else if ( rField_is_long_R(r) )
     707      Print("0 (real:%d digits)\n",r->ch_flags);  /* long R */
     708    else
     709      Print ("%d\n",rChar(r)); /* Fp(a) */
    697710    if (r->parameter!=NULL)
    698711    {
     
    780793{
    781794  int i, j;
    782  
     795
    783796  if (r == NULL) return;
    784  
     797
    785798  // delete order stuff
    786799  if (r->order != NULL)
     
    804817    assume(r->block0 == NULL && r->block1 == NULL && r->wvhdl == NULL);
    805818  }
    806  
     819
    807820  // delete varnames
    808821  if(r->names!=NULL)
     
    814827    Free((ADDRESS)r->names,r->N*sizeof(char *));
    815828  }
    816  
     829
    817830  // delete parameter
    818831  if (r->parameter!=NULL)
     
    828841    Free((ADDRESS)r->parameter,rPar(r)*sizeof(char *));
    829842  }
    830   if (r->VarOffset != NULL) 
     843  if (r->VarOffset != NULL)
    831844    Free((ADDRESS)r->VarOffset, (r->N +1)*sizeof(int));
    832845  Free(r, sizeof(ip_sring));
     
    13011314        if (r2->minpoly!=NULL)
    13021315        {
    1303           nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
     1316          nSetChar(r1,TRUE);
    13041317          if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    13051318              && naEqual(r1->minpoly,r2->minpoly))
     
    13091322            tmpR.minpoly=naCopy(r1->minpoly);
    13101323            tmpR.P=1;
    1311             nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1312               rPar(currRing));
     1324            nSetChar(currRing,TRUE);
    13131325          }
    13141326          else
    13151327          {
    1316             nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1317               rPar(currRing));
     1328            nSetChar(currRing,TRUE);
    13181329            WerrorS("different minpolys");
    13191330            return -1;
     
    13281339            tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    13291340            tmpR.P=1;
    1330             nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
     1341            nSetChar(r1,TRUE);
    13311342            tmpR.minpoly=naCopy(r1->minpoly);
    1332             nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1333               rPar(currRing));
     1343            nSetChar(currRing,TRUE);
    13341344          }
    13351345          else
     
    13501360            tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    13511361            tmpR.P=1;
    1352             nSetChar(rInternalChar(r2),TRUE,r2->parameter,rPar(r2));
     1362            nSetChar(r2,TRUE);
    13531363            tmpR.minpoly=naCopy(r2->minpoly);
    1354             nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1355               rPar(currRing));
     1364            nSetChar(currRing,TRUE);
    13561365          }
    13571366          else
     
    14051414        if (r1->minpoly!=NULL)
    14061415        {
    1407           nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
     1416          nSetChar(r1,TRUE);
    14081417          tmpR.minpoly=naCopy(r1->minpoly);
    1409           nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1410             rPar(currRing));
     1418          nSetChar(currRing,TRUE);
    14111419        }
    14121420      }
     
    14321440        if (r2->minpoly!=NULL)
    14331441        {
    1434           nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
     1442          nSetChar(r1,TRUE);
    14351443          tmpR.minpoly=naCopy(r2->minpoly);
    1436           nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1437             rPar(currRing));
     1444          nSetChar(currRing,TRUE);
    14381445        }
    14391446      }
     
    14681475        if (r1->minpoly!=NULL)
    14691476        {
    1470           nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
     1477          nSetChar(r1,TRUE);
    14711478          tmpR.minpoly=naCopy(r1->minpoly);
    1472           nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1473             rPar(currRing));
     1479          nSetChar(currRing,TRUE);
    14741480        }
    14751481      }
     
    14981504        if (r2->minpoly!=NULL)
    14991505        {
    1500           nSetChar(rInternalChar(r2),TRUE,r2->parameter,rPar(r2));
     1506          nSetChar(r2,TRUE);
    15011507          tmpR.minpoly=naCopy(r2->minpoly);
    1502           nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
    1503             rPar(currRing));
     1508          nSetChar(currRing,TRUE);
    15041509        }
    15051510      }
     
    16451650        tmpR.block0[i]=rb->block0[i];
    16461651        tmpR.block1[i]=rb->block1[i];
    1647         if (rb->wvhdl[i]!=NULL)
    1648           WarnS("rSum: weights not implemented");
     1652        if (rb->wvhdl[i]!=NULL)
     1653          WarnS("rSum: weights not implemented");
    16491654      }
    16501655      tmpR.block0[0]=1;
  • Singular/ring.h

    r4be737 r8a150b  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.23 1999-03-19 14:18:06 obachman Exp $ */
     9/* $Id: ring.h,v 1.24 1999-04-29 11:38:57 Singular Exp $ */
    1010
    1111/* includes */
     
    5959{ return (r->ch == 0) && (r->parameter==NULL); }
    6060inline BOOLEAN rField_is_R(ring r=currRing)
    61 { return (r->ch == -1); }
     61{ return (r->ch == -1) && (r->ch_flags==0); }
    6262inline BOOLEAN rField_is_GF(ring r=currRing)
    6363{ return (r->ch > 1) && (r->parameter!=NULL); }
     
    6868inline BOOLEAN rField_is_Q_a(ring r=currRing)
    6969{ return (r->ch == 1); }
     70inline BOOLEAN rField_is_long_R(ring r=currRing)
     71{ return (r->ch == -1) && (r->ch_flags!=0); }
    7072inline BOOLEAN rField_has_simple_inverse(ring r=currRing)
    71 { return (r->ch>1); } /* Z/p and GF(p,n) */
     73{ return (r->ch>1) || (r->ch== -1); } /* Z/p and GF(p,n) and R and long_R*/
     74inline BOOLEAN rField_is_Extension(ring r=currRing)
     75{ return (rField_is_Q_a(r)) || (rField_is_Zp_a(r)); } /* Z/p(a) and Q(a)*/
    7276
    7377enum
  • Singular/spolys.cc

    r4be737 r8a150b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: spolys.cc,v 1.18 1999-03-08 17:30:51 Singular Exp $ */
     4/* $Id: spolys.cc,v 1.19 1999-04-29 11:38:57 Singular Exp $ */
    55
    66/*
     
    794794void spSet(ring r)
    795795{
    796   if ((!rField_has_simple_inverse(r))
    797     ||TEST_OPT_INTSTRATEGY   /* Q, Q(a), Fp(a) */
     796  if ((TEST_OPT_INTSTRATEGY   /* Q, Q(a), Fp(a) */
     797  || (rField_is_R()) || (rField_is_long_R()))
    798798#ifdef SRING
    799799  && (pSRING==0)
  • Singular/structs.h

    r4be737 r8a150b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: structs.h,v 1.18 1999-02-26 15:32:06 Singular Exp $ */
     6/* $Id: structs.h,v 1.19 1999-04-29 11:38:58 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    132132#endif
    133133  short      ch;     /* characteristic */
     134  short      ch_flags; /* additional char-flags */
    134135  short      N;      /* number of vars */
    135136
  • Singular/utils.cc

    r4be737 r8a150b  
    2828  exit(1);
    2929}
    30  
     30
    3131/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
    3232void main_init(int argc, char *argv[])
     
    8787procinfo *iiInitSingularProcinfo(procinfov pi, char *libname,
    8888                                 char *procname, int line, long pos,
    89                                 BOOLEAN pstatic = FALSE)
     89                                BOOLEAN pstatic = FALSE)
    9090{
    9191  pi->libname = (char *)malloc(strlen(libname)+1);
     
    128128  if(!found_info && !warning_info) warning_info++;
    129129  if(!found_version && !warning_version) warning_version++;
    130   if(pi->data.s.body_end==0) 
     130  if(pi->data.s.body_end==0)
    131131    pi->data.s.body_end = pi->data.s.proc_end;
    132132
    133133  if(lpverbose) printf("//     ");
    134134  printf( "%c %-15s  %20s ", pi->is_static ? 'l' : 'g', pi->libname,
    135           pi->procname);
     135          pi->procname);
    136136  printf("line %4d,%5ld-%-5ld  %4d,%5ld-%-5ld  %4d,%5ld-%-5ld\n",
    137         pi->data.s.proc_lineno, pi->data.s.proc_start, pi->data.s.def_end,
    138         pi->data.s.body_lineno, pi->data.s.body_start, pi->data.s.body_end,
    139         pi->data.s.example_lineno, pi->data.s.example_start,
    140         pi->data.s.proc_end);
     137        pi->data.s.proc_lineno, pi->data.s.proc_start, pi->data.s.def_end,
     138        pi->data.s.body_lineno, pi->data.s.body_start, pi->data.s.body_end,
     139        pi->data.s.example_lineno, pi->data.s.example_start,
     140        pi->data.s.proc_end);
    141141  if(check) {
    142142    if(!pi->is_static && (pi->data.s.body_start-pi->data.s.def_end)<4)
    143143      printf("*** Procedure '%s' is global and has no help-section.\n",
    144              pi->procname);
     144             pi->procname);
    145145    if(!pi->is_static && !pi->data.s.example_start)
    146146      printf("*** Procedure '%s' is global and has no example-section.\n",\
    147              pi->procname);
     147             pi->procname);
    148148    if(found_proc_in_proc)
    149149      printf("*** found proc within procedure '%s'.\n", pi->procname);
     
    153153  if( fp != NULL) { // loading body
    154154    len1 = pi->data.s.def_end - pi->data.s.proc_start;
    155     if(pi->data.s.body_end==0) 
     155    if(pi->data.s.body_end==0)
    156156      len2 = pi->data.s.proc_end - pi->data.s.body_start;
    157157    else len2 = pi->data.s.body_end - pi->data.s.body_start;
Note: See TracChangeset for help on using the changeset viewer.