Changeset 4b5c87 in git


Ignore:
Timestamp:
Apr 22, 1998, 9:49:05 AM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
22f80af1b6c1526efe5d3aa6f9cfa5ee2ac42a1c
Parents:
6ca22e864c938665093be3c3244ede1ba10be59d
Message:
* hannes:  several changes concerning stdfac


git-svn-id: file:///usr/local/Singular/svn/trunk@1416 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    r6ca22e r4b5c87  
     1Wed Apr 22 09:42:35 MET DST 1998 hannes
     2  * several changes concerning stdfac
     3    (kstdfac.cc, kutil.cc kutil.h)
     4
    15Tue Apr 21 15:19:10 MET DST 1998 hannes/jens
    26  * gdc in Q(a) returns "not implemented" (clapsing.cc)
  • Singular/febase.cc

    r6ca22e r4b5c87  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.29 1998-04-15 16:44:58 Singular Exp $ */
     4/* $Id: febase.cc,v 1.30 1998-04-22 07:48:52 Singular Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    403403
    404404extern "C" {
    405 void WerrorS(char *s)
     405void WerrorS(const char *s)
    406406{
    407407#ifdef HAVE_MPSR
     
    412412      feErrors=(char *)Alloc(256);
    413413      feErrorsLen=256;
    414       strcpy(feErrors,s);
     414      strcpy(feErrors,(char *)s);
    415415    }
    416416    else
    417417    {
    418       if (((int)(strlen(s)+strlen(feErrors)))>=feErrorsLen)
     418      if (((int)(strlen((char *)s)+strlen(feErrors)))>=feErrorsLen)
    419419      {
    420420        feErrors=(char *)ReAlloc(feErrors,feErrorsLen,feErrorsLen+256);
    421421        feErrorsLen+=256;
    422422      }
    423       strcat(feErrors,s);
     423      strcat(feErrors,(char *)s);
    424424    }
    425425    strcat(feErrors,"\n");
     
    431431    if (tclmode)
    432432    {
    433       //PrintTCLS('E',s);
     433      //PrintTCLS('E',(char *)s);
    434434      //PrintTCLS('E',"\n");
    435       PrintTCLS('N',s);
     435      PrintTCLS('N',(char *)s);
    436436      PrintTCLS('N',"\n");
    437437    }
     
    440440    {
    441441      fwrite("   ? ",1,5,stderr);
    442       fwrite(s,1,strlen(s),stderr);
     442      fwrite((char *)s,1,strlen((char *)s),stderr);
    443443      fwrite("\n",1,1,stderr);
    444444      fflush(stderr);
     
    446446      {
    447447        fwrite("   ? ",1,5,feProtFile);
    448         fwrite(s,1,strlen(s),feProtFile);
     448        fwrite((char *)s,1,strlen((char *)s),feProtFile);
    449449        fwrite("\n",1,1,feProtFile);
    450450      }
  • Singular/febase.h

    r6ca22e r4b5c87  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.12 1998-04-15 16:44:57 Singular Exp $ */
     6/* $Id: febase.h,v 1.13 1998-04-22 07:48:53 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    4141
    4242void   Werror(char *fmt, ...);
    43 void   WerrorS(char *s);
     43void   WerrorS(const char *s);
    4444
    4545#ifdef __cplusplus
  • Singular/ideals.cc

    r6ca22e r4b5c87  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.21 1998-04-14 15:26:12 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.22 1998-04-22 07:48:54 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    422422  if (h1==NULL) return idCopy(h2);
    423423  if (h2==NULL) return idCopy(h1);
    424   j = IDELEMS(h1);
    425   while ((j > 0) && (h1->m[j-1] == NULL)) j--;
    426   i = IDELEMS(h2);
    427   while ((i > 0) && (h2->m[i-1] == NULL)) i--;
    428   if (i+j==0)
    429     result = idInit(1,1);
     424  j = IDELEMS(h1)-1;
     425  while ((j >= 0) && (h1->m[j] == NULL)) j--;
     426  i = IDELEMS(h2)-1;
     427  while ((i >= 0) && (h2->m[i] == NULL)) i--;
     428  r = max(h1->rank,h2->rank);
     429  if (i+j==(-2))
     430    return idInit(1,r);
    430431  else
    431     result=idInit(i+j,1);
    432   if (h1->rank<h2->rank)
    433     result->rank = h2->rank;
    434   else
    435     result->rank = h1->rank;
    436   if (i+j==0) return result;
    437   r = 0;
    438   for (l=0; l<j; l++)
    439   {
    440     result->m[r] = pCopy(h1->m[l]);
    441     r++;
    442   }
    443   for (l=0; l<i; l++)
     432    result=idInit(i+j+2,r);
     433  for (l=j; l>=0; l--)
     434  {
     435    result->m[l] = pCopy(h1->m[l]);
     436  }
     437  r = i+j+1;
     438  for (l=i; l>=0; l--, r--)
    444439  {
    445440    result->m[r] = pCopy(h2->m[l]);
    446     r++;
    447441  }
    448442  return result;
     
    23702364
    23712365  result=idCopy(id);
    2372   i = 0;
    2373   while ((! b) && (i<IDELEMS(result)))
     2366  i = IDELEMS(result)-1;
     2367  while ((! b) && (i>=0))
    23742368  {
    23752369    b=pIsUnit(result->m[i]);
    2376     i++;
     2370    i--;
    23772371  }
    23782372  if (b)
    23792373  {
    2380     for (i=0;i<IDELEMS(result);i++)
     2374    for (i=IDELEMS(result)-1;i>=0;i--)
    23812375      pDelete(&result->m[i]);
    23822376    result->m[0]=pOne();
     
    24352429  int i;
    24362430
    2437   for (i=0; i< IDELEMS(h); i++)
    2438   {
    2439     if (h->m[i]) m->m[i]=pHead(h->m[i]);
     2431  for (i=IDELEMS(h)-1;i>=0; i--)
     2432  {
     2433    if (h->m[i]!=NULL) m->m[i]=pHead(h->m[i]);
    24402434  }
    24412435  return m;
     
    24472441  int i;
    24482442
    2449   for (i=0; i< IDELEMS(h); i++)
     2443  for (i=IDELEMS(h)-1;i>=0; i--)
    24502444  {
    24512445    m->m[i]=pHomogen(h->m[i],varnum);
  • Singular/iparith.cc

    r6ca22e r4b5c87  
    14911491      return FALSE;
    14921492  }
    1493   WerrorS("not implemented yet");
     1493  WerrorS(feNotImplemented);
    14941494  delete iv;
    14951495  return TRUE;
     
    31043104#ifdef HAVE_FGLM
    31053105,{findUniProc,  FINDUNI_CMD,     IDEAL_CMD,      IDEAL_CMD}
    3106 #else 
     3106#else
    31073107,{jjWRONG,      FINDUNI_CMD,     IDEAL_CMD,      IDEAL_CMD}
    3108 #endif 
     3108#endif
    31093109,{jjidFreeModule,FREEMODULE_CMD, XS(MODUL_CMD),  INT_CMD }
    31103110#ifdef HAVE_FACTORY
  • Singular/ipshell.cc

    r6ca22e r4b5c87  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.19 1998-04-08 21:14:57 krueger Exp $ */
     4/* $Id: ipshell.cc,v 1.20 1998-04-22 07:48:59 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    690690  else
    691691  {
     692    //if (name->rtyp!=0)
     693    //{
     694    //  Warn("`%s` is already in use",name->name);
     695    //}
    692696    sy->data = (char *)enterid(name->name,lev,t,root,init_b);
    693697    if (sy->data!=NULL)
  • Singular/kstdfac.cc

    r6ca22e r4b5c87  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.16 1998-04-08 16:04:24 Singular Exp $ */
     4/* $Id: kstdfac.cc,v 1.17 1998-04-22 07:49:00 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    464464    }
    465465    /* reduction of the element choosen from L */
    466     if (strat->P.p != NULL)
    467       strat->red(&strat->P,strat);
     466    strat->red(&strat->P,strat);
    468467    if (strat->P.p != NULL)
    469468    {
     
    496495      if ((IDELEMS(fac)==1)&&(facdeg==pFDeg(fac->m[0])))
    497496      {
    498         pDelete(&(fac->m[0]));
    499         fac->m[0]=strat->P.p;
     497        if (TEST_OPT_INTSTRATEGY)
     498        {
     499          if (!TEST_OPT_MINRES||(strat->syzComp==0)||(!strat->homog))
     500          {
     501            strat->P.p = redtailBba(strat->P.p,strat->sl,strat);
     502            if (strat->redTailChange) pCleardenom(strat->P.p);
     503          }
     504        }
     505        else
     506        {
     507          pNorm(strat->P.p);
     508          if (!TEST_OPT_MINRES||(strat->syzComp==0)||(!strat->homog))
     509          {
     510            strat->P.p = redtailBba(strat->P.p,strat->sl,strat);
     511          }
     512        }
     513        if (strat->redTailChange)
     514        {
     515          idDelete(&fac);
     516          fac=singclap_factorize(strat->P.p,NULL,1);
     517#ifndef HAVE_LIBFAC_P
     518          if (fac==NULL)
     519          {
     520            fac=idInit(1,1);
     521            fac->m[0]=pCopy(strat->P.p);
     522          }
     523#endif
     524          idDelete(&fac_copy);
     525          fac_copy=idInit(IDELEMS(fac),1);
     526        }
     527        if ((IDELEMS(fac)==1)&&(facdeg==pFDeg(fac->m[0])))
     528        {
     529          pDelete(&(fac->m[0]));
     530          fac->m[0]=strat->P.p;
     531        }
    500532      }
    501533      if (strat->P.lcm!=NULL) pFree1(strat->P.lcm);
    502534      int i;
    503       for(i=0;i<IDELEMS(fac);i++)
    504       {
    505         int pos;
    506         if (strat->sl==-1) pos=0;
    507         else pos=posInS(strat->S,strat->sl,fac->m[i]);
    508         if (TEST_OPT_INTSTRATEGY)
    509         {
    510           if (!TEST_OPT_MINRES||(strat->syzComp==0)||(!strat->homog))
    511           {
    512             fac->m[i] = redtailBba(fac->m[i],pos-1,strat);
    513             pCleardenom(fac->m[i]);
    514           }
    515         }
    516         else
    517         {
    518           pNorm(fac->m[i]);
    519           if (!TEST_OPT_MINRES||(strat->syzComp==0)||(!strat->homog))
    520           {
    521             fac->m[i] = redtailBba(fac->m[i],pos-1,strat);
    522           }
    523         }
    524         facdeg=pFDeg(fac->m[i]);
    525         ideal fac2=singclap_factorize(fac->m[i],NULL,1);
    526 #ifndef HAVE_LIBFAC_P
    527         if ((fac2!=NULL)&&(IDELEMS(fac2)>1)&&(facdeg!=pFDeg(fac2->m[0])))
    528 #else
    529         if ((IDELEMS(fac2)>1)&&(facdeg!=pFDeg(fac2->m[0])))
    530 #endif
    531         {
    532           if (TEST_OPT_DEBUG)
    533           {
    534             wrp(fac->m[i]);
    535             Print("-> %d factors, again\n",IDELEMS(fac2));
    536             //jjPRINT_MA0((matrix)fac2,"");
    537           }
    538           else if (TEST_OPT_PROT)
    539           {
    540             int ii=IDELEMS(fac2);
    541             if (ii>1)
    542             {
    543               while(ii>0) { PrintS("F"); ii--; }
    544             }
    545           }
    546           pDelete(&(fac->m[i]));
    547           fac->m[i]=fac2->m[0];
    548           pEnlargeSet(&(fac->m),IDELEMS(fac),IDELEMS(fac2)-1);
    549           pEnlargeSet(&(fac_copy->m),IDELEMS(fac),IDELEMS(fac2)-1);
    550           memcpy(fac->m+IDELEMS(fac),&(fac2->m[1]),(IDELEMS(fac2)-1)*sizeof(poly
    551 ));
    552           IDELEMS(fac)+=(IDELEMS(fac2)-1);
    553           IDELEMS(fac_copy)=IDELEMS(fac);
    554          }
    555       }
     535//      for(i=0;i<IDELEMS(fac);i++)
     536//      {
     537//        int pos;
     538//        if (strat->sl==-1) pos=0;
     539//        else pos=posInS(strat->S,strat->sl,fac->m[i]);
     540//        if (TEST_OPT_INTSTRATEGY)
     541//        {
     542//          if (!TEST_OPT_MINRES||(strat->syzComp==0)||(!strat->homog))
     543//          {
     544//            fac->m[i] = redtailBba(fac->m[i],pos-1,strat);
     545//            pCleardenom(fac->m[i]);
     546//          }
     547//        }
     548//        else
     549//        {
     550//          pNorm(fac->m[i]);
     551//          if (!TEST_OPT_MINRES||(strat->syzComp==0)||(!strat->homog))
     552//          {
     553//            fac->m[i] = redtailBba(fac->m[i],pos-1,strat);
     554//          }
     555//        }
     556//      }
    556557
    557558      for(i=IDELEMS(fac)-1;i>=0;i--)
     
    573574        if (n->sl==-1) pos=0;
    574575        else pos=posInS(n->S,n->sl,n->P.p);
     576
    575577        // we have already reduced all elements from fac....
    576         //if (TEST_OPT_INTSTRATEGY)
    577         //{
    578         //  if (!TEST_OPT_MINRES||(n->syzComp==0)||(!n->homog))
    579         //  {
    580         //    n->P.p = redtailBba(n->P.p,pos-1,n);
    581         //    pCleardenom(n->P.p);
    582         //  }
    583         //}
    584         //else
    585         //{
    586         //  pNorm(n->P.p);
    587         //  if (!TEST_OPT_MINRES||(n->syzComp==0)||(!n->homog))
    588         //  {
    589         //    n->P.p = redtailBba(n->P.p,pos-1,n);
    590         //  }
    591         //}
    592         if (TEST_OPT_DEBUG)
    593         {
    594           PrintS("new s:");
    595           wrp(n->P.p);
    596           PrintLn();
    597         }
    598         enterpairs(n->P.p,n->sl,n->P.ecart,pos,n);
    599         n->enterS(n->P,pos,n);
    600         if (n->sl>srmax) srmax = n->sl;
    601 
    602         /* enter P.p into T */
    603         if ((IDELEMS(fac)>1)||(facdeg!=pFDeg(fac->m[0])))
    604         {
    605           int pos=n->posInT(n->T,n->tl,n->P);
    606           enterTBba(n->P,pos,n);
    607         }
     578        if (TEST_OPT_INTSTRATEGY)
     579        {
     580          if (!TEST_OPT_MINRES||(n->syzComp==0)||(!n->homog))
     581          {
     582            n->P.p = redtailBba(n->P.p,pos-1,n);
     583            if (n->redTailChange) pCleardenom(n->P.p);
     584          }
     585        }
     586        else
     587        {
     588          pNorm(n->P.p);
     589          if (!TEST_OPT_MINRES||(n->syzComp==0)||(!n->homog))
     590          {
     591            n->P.p = redtailBba(n->P.p,pos-1,n);
     592          }
     593        }
     594
     595        //if (n->redTailChange)
     596        //{
     597        //  int pos = n->posInL(n->L,n->Ll,n->P,n);
     598        //  enterL(&n->L,&n->Ll,&n->Lmax,n->P,pos);
     599        //}
     600        //else
     601        {
     602          if (TEST_OPT_DEBUG)
     603          {
     604            PrintS("new s:");
     605            wrp(n->P.p);
     606            PrintLn();
     607          }
     608          enterpairs(n->P.p,n->sl,n->P.ecart,pos,n);
     609          n->enterS(n->P,pos,n);
     610          if (n->sl>srmax) srmax = n->sl;
     611
     612          /* enter P.p into T */
     613          if ((IDELEMS(fac)>1)||(facdeg!=pFDeg(fac->m[0])))
     614          {
     615            int pos=n->posInT(n->T,n->tl,n->P);
     616            enterTBba(n->P,pos,n);
     617          }
     618        }
    608619
    609620        /* construct D */
     
    651662                  messageSets(n);
    652663                }
     664                //if (n->Ll >=0) Print("Ll:%d|",n->Ll);
    653665                while (n->Ll >= 0) deleteInL(n->L,&n->Ll,n->Ll,n);
     666                //if (n->tl >=0) Print("tl:%d|",n->tl);
    654667                while (n->tl >= 0) { pDelete(&n->T[n->tl].p); n->tl--; }
    655668                memset(n->Shdl->m,0,IDELEMS(n->Shdl)*sizeof(poly));
  • Singular/kutil.cc

    r6ca22e r4b5c87  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.16 1998-04-08 16:04:25 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.17 1998-04-22 07:49:01 Singular Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for std
     
    449449      /*- tail belongs to several int spolys -*/
    450450    }
    451     else 
     451    else
    452452    {
    453453      // search p in T, if it is there, do not delete it
    454454      int i=strat->tl;
    455455      poly p=set[j].p;
    456       while (i>=0)
    457       {
    458         if (strat->T[i].p==p)
     456      if (p!=NULL)
     457      loop
     458      {
     459        if (i < 0)
    459460        {
    460           p=NULL;
    461           break;
     461          //if (strat->next!=NULL)
     462          //{
     463          //  strat=strat->next;
     464          //  i=strat->tl;
     465          //}
     466          //else
     467          {
     468            /* not found : */
     469            pDelete(&p);
     470            break;
     471          }
    462472        }
    463         i--;
    464       }
    465       if (p!=NULL) pDelete(&p);
    466       set[j].p=NULL;
    467     } 
     473        else
     474        {
     475          if (strat->T[i].p==p)
     476          {
     477            /* found : */
     478            p=NULL;
     479            break;
     480          }
     481          i--;
     482        }
     483      }
     484    }
     485    set[j].p=NULL;
    468486  }
    469487  if ((*length)>0)
     
    23112329  poly h, hn;
    23122330  int j;
     2331  strat->redTailChange=FALSE;
    23132332
    23142333  if (strat->noTailReduction)
     
    23252344      if (pDivisibleBy(strat->S[j], hn))
    23262345      {
     2346        strat->redTailChange=TRUE;
    23272347        spSpolyTail(strat->S[j], p, h, strat->kNoether, strat->spSpolyLoop);
    23282348        hn = pNext(h);
     
    38263846  {
    38273847    rOrderType_t rot = rGetOrderType(r);
    3828  
     3848
    38293849    if ((rot == rOrderType_CompExp || rot == rOrderType_ExpComp) &&
    38303850        (modrank == 0))
     
    38353855}
    38363856
    3837  
     3857
  • Singular/kutil.h

    r6ca22e r4b5c87  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.7 1998-04-06 17:59:33 obachman Exp $ */
     6/* $Id: kutil.h,v 1.8 1998-04-22 07:49:02 Singular Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for std
     
    103103    int lastAxis;
    104104    int newIdeal;
     105    int minim;
    105106    BOOLEAN interpt;
    106107    BOOLEAN homog;
    107     BOOLEAN news;
    108     BOOLEAN newt;/*used for messageSets*/
    109108    BOOLEAN kHEdgeFound;
    110109    BOOLEAN honey,sugarCrit;
     
    115114    BOOLEAN posInLOldFlag;
    116115           /*FALSE, if posInL == posInL10*/
    117     int minim;
     116    char    redTailChange;
     117    char    news;
     118    char    newt;/*used for messageSets*/
    118119};
    119120
  • Singular/longalg.cc

    r6ca22e r4b5c87  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longalg.cc,v 1.21 1998-04-21 10:59:24 obachman Exp $ */
     4/* $Id: longalg.cc,v 1.22 1998-04-22 07:49:04 Singular Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
     
    13341334  alg x;
    13351335
     1336  mmTestP(a,sizeof(rnumber));
     1337  mmTestP(b,sizeof(rnumber));
     1338  naTest(la);
     1339  naTest(lb);
     1340
    13361341  lo = (lnumber)Alloc(sizeof(rnumber));
    13371342  lo->z = napMult(napCopy(a->z), napCopy(b->z));
    1338   naTest(la);
    1339   naTest(lb);
     1343
    13401344  if (a->n==NULL)
    13411345  {
     
    13861390    lo=NULL;
    13871391  }
    1388   naTest(la);
    1389   naTest(lb);
    13901392  naTest((number)lo);
    13911393  return (number)lo;
     
    19881990      napDelete(&x);
    19891991      napDelete(&y);
    1990     } 
     1992    }
    19911993  }
    19921994#endif
  • Singular/matpol.cc

    r6ca22e r4b5c87  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: matpol.cc,v 1.10 1998-04-08 16:04:29 Singular Exp $ */
     4/* $Id: matpol.cc,v 1.11 1998-04-22 07:49:05 Singular Exp $ */
    55
    66/*
     
    350350//  lists res=(lists)Alloc(sizeof(slists));
    351351
    352   if (sw) PrintS("not implemented");
     352  if (sw) PrintS(feNotImplemented);
    353353  /* Bareiss */
    354354  div = NULL;
Note: See TracChangeset for help on using the changeset viewer.