Changeset 9d06971 in git for Singular


Ignore:
Timestamp:
Nov 5, 1999, 8:11:10 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
698457f6f46700a65e8096f211292da37a6d4278
Parents:
f0e41bc3bc0601cdd0ab46942bf84fa17c5167df
Message:
* bug fixes w.r.t. syzcomp stuff


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

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.in

    rf0e41bc r9d06971  
    368368CCG             = gcc
    369369CXXG            = gcc
    370 CXXM            = gcc -MM -DGENERATE_DEPEND
    371 CCM             = gcc -MM -DGENERATE_DEPEND
     370CXXM            = gcc -MM -MG -DGENERATE_DEPEND
     371CCM             = gcc -MM -MG -DGENERATE_DEPEND
    372372
    373373CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
  • Singular/ideals.cc

    rf0e41bc r9d06971  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.71 1999-10-27 15:04:44 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.72 1999-11-05 19:11:06 obachman Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    355355* copy an ideal from ring r1 to currRing
    356356*/
    357 ideal idRingCopy(ideal h, ring r)
    358 {
    359   if (h==NULL) return NULL;
    360   ideal s_h=idInit(IDELEMS(h),h->rank);
     357ideal idRingCopy(ideal id, ring r)
     358{
     359  if (id == NULL) return NULL;
     360  ideal res;
     361 
    361362  int i;
    362   for(i=IDELEMS(h)-1;i>=0;i--)
    363   {
    364     if (h->m[i]!=NULL)
    365     {
    366       if(r==currRing)
    367       {
    368         s_h->m[i]=pCopy(h->m[i]);
    369       }
    370       else
    371       {
    372         s_h->m[i]=pPermPoly(h->m[i],NULL,r,NULL,0);
    373       }
    374     }
    375   }
    376   return s_h;
     363  res = idInit(IDELEMS(id), id->rank);
     364  for (i=IDELEMS(id)-1; i>=0; i--)
     365  {
     366    res->m[i] = pFetchCopy(r, id->m[i]);
     367  }
     368  return res;
    377369}
    378370
     
    11061098
    11071099  ring orig_ring=currRing;
    1108   ring syz_ring=rAddSyzComp(currRing);
     1100  ring syz_ring=rCurrRingAssureSyzComp();
    11091101  pSetSyzComp(length);
    11101102
     
    11181110        temp->m[k] = pCopy(first->m[i]);
    11191111      else
    1120         temp->m[k] = pPermPoly(first->m[i],NULL,orig_ring,NULL,0);
     1112        temp->m[k] = pFetchCopy(orig_ring,first->m[i]);
    11211113      q = pOne();
    11221114      pSetComp(q,i+1+length);
     
    11381130        temp->m[k] = pCopy(second->m[i]);
    11391131      else
    1140         temp->m[k] = pPermPoly(second->m[i],NULL,orig_ring,NULL,0);
     1132        temp->m[k] = pFetchCopy(orig_ring,second->m[i]);
    11411133      if (slength==0) pShift(&(temp->m[k]),1);
    11421134      k++;
     
    11611153        p = pCopy(temp1->m[i]);
    11621154      else
    1163         p = pPermPoly(temp1->m[i],NULL,syz_ring,NULL,0);
     1155        p = pFetchCopy(syz_ring,temp1->m[i]);
    11641156      while (p!=NULL)
    11651157      {
     
    12311223
    12321224  ring orig_ring=currRing;
    1233   ring syz_ring=rAddSyzComp(currRing);
     1225  ring syz_ring=rCurrRingAssureSyzComp();
    12341226  pSetSyzComp(syzComp);
    12351227
     
    12601252            bigmat->m[i] = pCopy(arg[j]->m[l]);
    12611253          else
    1262             bigmat->m[i] = pPermPoly(arg[j]->m[l],NULL,orig_ring,NULL,0);
     1254            bigmat->m[i] = pFetchCopy(orig_ring,arg[j]->m[l]);
    12631255          pShift(&(bigmat->m[i]),k*maxrk+isIdeal);
    12641256          i++;
     
    12921284        p = pCopy(tempstd->m[j]);
    12931285      else
    1294         p = pPermPoly(tempstd->m[j],NULL,syz_ring,NULL,0);
     1286        p = pFetchCopy(syz_ring,tempstd->m[j]);
    12951287      pShift(&p,-syzComp-isIdeal);
    12961288      result->m[k] = p;
     
    13971389  assume(currRing != NULL);
    13981390  ring orig_ring=currRing;
    1399   ring syz_ring=rAddSyzComp(currRing);
     1391  ring syz_ring=rCurrRingAssureSyzComp();
    14001392
    14011393  pSetSyzComp(k);
     
    14301422        else
    14311423        {
    1432           p = pPermPoly(s_h3->m[j],NULL,syz_ring,NULL,0);
     1424          p = pFetchCopy(syz_ring,s_h3->m[j]);
    14331425          rChangeCurrRing(syz_ring,FALSE);
    14341426          pDelete(&(s_h3->m[j]));
     
    15171509
    15181510  ring orig_ring=currRing;
    1519   ring syz_ring=rAddSyzComp(currRing);
     1511  ring syz_ring=rCurrRingAssureSyzComp();
    15201512  pSetSyzComp(k);
    15211513
     
    16131605
    16141606  ring orig_ring=currRing;
    1615   ring syz_ring=rAddSyzComp(currRing);
     1607  ring syz_ring=rCurrRingAssureSyzComp();
    16161608  pSetSyzComp(k);
    16171609
     
    16961688
    16971689  ring orig_ring=currRing;
    1698   ring syz_ring=rAddSyzComp(currRing);
     1690  ring syz_ring=rCurrRingAssureSyzComp();
    16991691  pSetSyzComp(max(k,1));
    17001692
     
    17301722        p = pCopy(submod->m[j]);
    17311723      else
    1732         p=pPermPoly(submod->m[j],NULL,orig_ring,NULL,0);
     1724        p=pFetchCopy(orig_ring,submod->m[j]);
    17331725      if (pGetComp(p)==0) pSetCompP(p,1);
    17341726      q = kNF(s_temp,currQuotient,p,k);
     
    19301922
    19311923  ring orig_ring=currRing;
    1932   ring syz_ring=rAddSyzComp(currRing);
     1924  ring syz_ring=rCurrRingAssureSyzComp();
    19331925  pSetSyzComp(kmax-1);
    19341926
     
    19411933    s_q=pCopy(q);
    19421934  else
    1943     s_q=pPermPoly(q,NULL,orig_ring,NULL,0);
     1935    s_q=pFetchCopy(orig_ring,q);
    19441936
    19451937  ideal s_h4 = idInit(16,kmax);
     
    19731965          s_p = pCopy(temph1->m[l]);
    19741966        else
    1975           s_p=pPermPoly(temph1->m[l],NULL,orig_ring,NULL,0);
     1967          s_p=pFetchCopy(orig_ring,temph1->m[l]);
    19761968        if (k1 == 0)
    19771969          pShift(&s_p,ll*k+1);
     
    29882980
    29892981  ring orig_ring=currRing;
    2990   ring syz_ring=rAddSyzComp(currRing);
     2982  ring syz_ring=rCurrRingAssureSyzComp();
    29912983  pSetSyzComp(length);
    29922984
  • Singular/kspoly.cc

    rf0e41bc r9d06971  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kspoly.cc,v 1.4 1999-10-25 08:32:15 obachman Exp $ */
     4/* $Id: kspoly.cc,v 1.5 1999-11-05 19:11:07 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Routines for Spoly creation and reductions
     
    3737  poly p1 = PR->p;
    3838  poly p2 = PW->p;
     39
    3940  assume(p2 != NULL && p1 != NULL && pDivisibleBy(p2,  p1));
     41  assume(pGetComp(p1) == pGetComp(p2) ||
     42         (pMaxComp(p2) == 0));
     43 
    4044  poly a2 = pNext(p2), lm = p1;
    4145
    4246  p1 = pNext(p1);
    4347
    44   BOOLEAN reset_vec=FALSE;
    45  
    4648  if (a2==NULL)
    4749  {
     
    6567  else
    6668  {
    67     if (coef != NULL)
    68       *coef = nInit(1);
    69   }
    70  
    71  
    72   if (pGetComp(p2) != pGetComp(lm))
    73   {
    74     pSetCompP(a2, pGetComp(lm));
    75     reset_vec = TRUE;
    76     // need to make sure that Comp of lm is same as comp of p2
    77     pSetComp(lm, pGetComp(p2));
    78     pSetmComp(lm);
    79   }
    80 
     69    if (coef != NULL) *coef = nInit(1);
     70  }
     71 
     72 
    8173  pMonSubFrom(lm, p2);
    82   assume(pGetComp(lm) == 0);
    83 
    84   int l1, l2;
     74
    8575  PR->p = p_Minus_m_Mult_q(p1, lm, a2, spNoether);
    86  
     76
    8777  pDelete1(&lm);
    88   if (reset_vec) pSetCompP(a2, 0);
    8978}
    9079
     
    465454}
    466455
    467 #if 1
    468456void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether)
    469457{
     
    479467
    480468
    481 #else
    482  
    483 /*2
    484 * reduction of tail(q) with p1
    485 * lead(p1) divides lead(pNext(q2)) and pNext(q2) is reduced
    486 * do not destroy p1, but tail(q)
    487 */
    488 void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether)
    489 {
    490   number t;
    491   poly m, h;
    492   poly a1 = pNext(p1), p2 = pNext(q2), a2 = pNext(p2);
    493   number an = pGetCoeff(p1), bn = pGetCoeff(p2);
    494   int ct = ksCheckCoeff(&an, &bn);
    495   BOOLEAN reset_vec=FALSE;
    496 
    497   if(a1==NULL)
    498   {
    499     nDelete(&an);
    500     nDelete(&bn);
    501     nDelete(&pGetCoeff(p2));
    502     pFree1(p2);
    503     pNext(q2) = a2;
    504     return;
    505   }
    506   if (p1 != q)
    507   {
    508     m = p2;
    509     pSetCoeff(m,bn);
    510   }
    511   else
    512   {
    513     m = pHead0(p2);
    514     pSetCoeff0(m,bn);
    515   }
    516   if ((ct == 0) || (ct == 2))
    517   {
    518     pMultN(a2, an);
    519   }
    520   if ((pGetComp(p1) != pGetComp(p2))
    521   && (pGetComp(p1)==0))
    522   {
    523     pSetCompP(a1,pGetComp(p2));
    524     reset_vec=TRUE;
    525   }
    526   pMonSubFrom(m,p1);
    527   poly res = p_Minus_m_Mult_q(a2, m, a1);
    528   if ((ct == 0) || (ct == 2))
    529   {
    530     h = q;
    531     do
    532     {
    533       t = nMult(pGetCoeff(h),an);
    534       pSetCoeff(h,t);
    535       pIter(h);
    536     }
    537     while (h != p2);
    538   }
    539   h = res;
    540   nDelete(&an);
    541   nDelete(&bn);
    542   pFree1(m);
    543   pNext(q2) = h;
    544   if (reset_vec)
    545     pSetCompP(a1,0);
    546   if (p1 == q)
    547   {
    548     pDelete(&p2);
    549   }
    550 }
    551 
    552 #endif         
    553 
    554  
    555  
     469
     470 
     471 
  • Singular/kstd1.cc

    rf0e41bc r9d06971  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.45 1999-11-02 15:19:06 Singular Exp $ */
     4/* $Id: kstd1.cc,v 1.46 1999-11-05 19:11:07 obachman Exp $ */
    55/*
    66* ABSTRACT:
     
    9393  //pTest(*with);
    9494#endif
    95 
     95  assume(strat->syzComp == 0 ||
     96         pGetComp(h->p) <= strat->syzComp);
    9697  if (!TEST_OPT_INTSTRATEGY)
    9798    pNorm(*with);
     
    254255  unsigned long not_sev;
    255256
     257  assume(strat->syzComp == 0 ||
     258         pGetComp(h->p) <= strat->syzComp);
     259
    256260  if (TEST_OPT_CANCELUNIT) cancelunit(h);
    257261  d = pFDeg((*h).p)+(*h).ecart;
     
    358362          return -2;
    359363        }
     364        assume(pGetComp(h->p) <= strat->syzComp);
     365
    360366      }
    361367      /*- try to reduce the s-polynomial -*/
  • Singular/mmcheck.c

    rf0e41bc r9d06971  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmcheck.c,v 1.15 1999-10-26 15:06:10 obachman Exp $ */
     4/* $Id: mmcheck.c,v 1.16 1999-11-05 19:11:08 obachman Exp $ */
    55
    66/*
     
    217217
    218218  memset(what->front_pattern, MM_FRONT_PATTERN, MM_NUMBER_OF_FRONT_PATTERNS);
     219  memset(addr, 255, size);
    219220  memset((char*) addr + size, MM_BACK_PATTERN, DebugOffsetBack);
    220221}
  • Singular/mmisc.c

    rf0e41bc r9d06971  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmisc.c,v 1.20 1999-10-26 15:06:11 obachman Exp $ */
     4/* $Id: mmisc.c,v 1.21 1999-11-05 19:11:08 obachman Exp $ */
    55
    66/*
     
    7070  int mm_this_specIndex = mmGetIndex(SizeFromRealSize(heap->size));
    7171
    72   mmGarbageCollectHeap(heap, 0);
     72/*  mmGarbageCollectHeap(heap, 0); */
    7373
    7474  if (mm_this_specIndex < 0 ||
  • Singular/polys-impl.cc

    rf0e41bc r9d06971  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys-impl.cc,v 1.31 1999-10-25 08:32:17 obachman Exp $ */
     4/* $Id: polys-impl.cc,v 1.32 1999-11-05 19:11:08 obachman Exp $ */
    55
    66/***************************************************************
     
    339339  assume(d_h != NULL && (d_h == mm_specHeap) ||
    340340         d_h->size == mm_specHeap->size);
    341 
     341  pTest(s_p);
    342342  while (s_p != NULL)
    343343  {
     
    11221122      }
    11231123    }
     1124    if (currRing->order[0] == ringorder_s)
     1125    {
     1126      if (p->exp.l[currRing->typ[0].data.syz.place] != 0 &&
     1127          p->exp.l[currRing->typ[0].data.syz.place] != 1)
     1128      {
     1129        Warn("Syzcomp wrong %d in %s:%d",
     1130             p->exp.l[currRing->typ[0].data.syz.place], f, l);
     1131      }
     1132    }
    11241133    old=p;
    11251134    pIter(p);
  • Singular/ring.cc

    rf0e41bc r9d06971  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.80 1999-11-05 15:54:29 Singular Exp $ */
     4/* $Id: ring.cc,v 1.81 1999-11-05 19:11:09 obachman Exp $ */
    55
    66/*
     
    116116
    117117    /*------------ Garbage Collection -----------------------------------*/
    118       mmGarbageCollectHeaps(2);
     118//      mmGarbageCollectHeaps(2);
    119119    }
    120120  }
     
    30963096  for(j=0;j<r->OrdSize;j++)
    30973097  {
    3098     char *TYP[]={"ro_dp","ro_wp","ro_cp","ro_syzcomp","ro_none"};
     3098    char *TYP[]={"ro_dp","ro_wp","ro_cp","ro_syzcomp", "ro_syz", "ro_none"};
    30993099    Print("  typ %s",TYP[r->typ[j].ord_typ]);
    31003100    Print("  place %d",r->typ[j].data.dp.place);
     
    32453245}
    32463246
    3247 ring rAddSyzComp(ring r)
    3248 {
    3249   if (r->order[0]==ringorder_c)
    3250     return currRing;
    3251 
    3252   assume(currRing->order[0] != ringorder_s &&
    3253          currRing->order[0] != ringorder_S);
    3254 
    3255   nMap=nCopy; // need to set nMap for mapping of polys
    3256               // (at least with current implementation via pPermPoly)
     3247/////////////////////////////////////////////////////////////////////////////
     3248//
     3249// The following routines all take as input a ring r, and return R
     3250// where R has a certain property. P might be equal r in which case r
     3251// had already this property
     3252//
     3253// Without argument, these functions work on currRing and change it,
     3254// if necessary
     3255
     3256// for the time being, this is still here
     3257extern ideal idRingCopy(ideal id, ring r);
     3258static ring rAssureSyzComp(ring r);
     3259ring rCurrRingAssureSyzComp()
     3260{
     3261  ring r = rAssureSyzComp(currRing);
     3262  if (r != currRing)
     3263  {
     3264    ring old_ring = currRing;
     3265    rChangeCurrRing(r, TRUE);
     3266    if (old_ring->qideal != NULL)
     3267    {
     3268      r->qideal = idRingCopy(old_ring->qideal, old_ring);
     3269      assume(idRankFreeModule(r->qideal) == 0);
     3270      currQuotient = r->qideal;
     3271    }
     3272  }
     3273  return r;
     3274}
     3275   
     3276static ring rAssureSyzComp(ring r)
     3277{
     3278  if (r->order[0]==ringorder_c || r->order[0] == ringorder_s)
     3279    return r;
    32573280
    32583281  ring res=rCopy0(r);
    3259   if (res->qideal!=NULL)
    3260   {
    3261     idDelete(&(res->qideal));
    3262   }
    32633282  int i=rBlocks(r);
    32643283  int j;
     
    32833302
    32843303  rComplete(res,1);
    3285   rChangeCurrRing(res,TRUE);
    3286   if(r->qideal!=NULL)
    3287   {
    3288     res->qideal=idInit(IDELEMS(r->qideal),1);
    3289     for(i=IDELEMS(r->qideal)-1;i>=0;i--)
    3290     {
    3291       res->qideal->m[i]=pPermPoly(r->qideal->m[i],NULL,r,NULL,0);
    3292     }
    3293   }
    3294   currQuotient=res->qideal;
    32953304  return res;
    32963305}
     3306 
     3307
     3308 
  • Singular/ring.h

    rf0e41bc r9d06971  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.38 1999-11-02 15:19:11 Singular Exp $ */
     9/* $Id: ring.h,v 1.39 1999-11-05 19:11:10 obachman Exp $ */
    1010
    1111/* includes */
     
    2626void   rKill(ring r);
    2727ring   rCopy(ring r);
    28 ring   rAddSyzComp(ring r);
     28
     29
     30// Ring Manipulations
     31ring   rCurrRingAssureSyzComp();
    2932
    3033#ifdef PDEBUG
Note: See TracChangeset for help on using the changeset viewer.