Changeset 5b45a4 in git


Ignore:
Timestamp:
Sep 16, 2014, 4:57:17 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
46f37cb57098799d8399fc704c5b3ca2020ca0c1
Parents:
eb55f8a52fe5ee84d19c269132981a40defce0da
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-09-16 16:57:17+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-09-23 20:15:33+02:00
Message:
Testing the 'wrong ideal rank' issue in kernel/combinatorics + p_Copy_noCheck

add: p_Copy_noCheck to libpolys/polys/monomials/p_polys.h due to its (wrong) useage within idInitializeQuot (kernel/ideals.cc)...
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/khstd.cc

    reb55f8a r5b45a4  
    156156Lm = id_Head(strat->Shdl,currRing);
    157157
    158 newhilb =hHstdSeries(Lm,w,strat->kHomW,Q,currRing);
     158newhilb =hHstdSeries(Lm,w,strat->kHomW,Q,currRing); // ,strat->tailRing?
    159159
    160160#if ADIDEBUG
  • kernel/combinatorics/hdegree.cc

    reb55f8a r5b45a4  
    838838}
    839839
    840 static void hDegree0(ideal S, ideal Q, const ring r=currRing)
    841 {
    842   id_Test(S, r); 
    843   id_Test(Q, r);
     840static void hDegree0(ideal S, ideal Q, const ring tailRing)
     841{
     842  id_TestTail(S, currRing, tailRing); 
     843  id_TestTail(Q, currRing, tailRing);
    844844   
    845845  int  mc;
    846   hexist = hInit(S, Q, &hNexist, r);
     846  hexist = hInit(S, Q, &hNexist, tailRing);
    847847  if (!hNexist)
    848848  {
     
    852852  else
    853853    hMu = 0;
     854   
     855  const ring r = currRing;
     856   
    854857  hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
    855858  hvar = (varset)omAlloc(((r->N) + 1) * sizeof(int));
     
    909912}
    910913
    911 int  scMult0Int(ideal S, ideal Q, const ring r)
    912 {
    913   id_Test(S, r); 
    914   id_Test(Q, r); 
    915   hDegree0(S, Q);
     914int  scMult0Int(ideal S, ideal Q, const ring tailRing)
     915{
     916  id_TestTail(S, currRing, tailRing); 
     917  id_TestTail(Q, currRing, tailRing);
     918  hDegree0(S, Q, tailRing);
    916919  return hMu;
    917920}
     
    10161019
    10171020  hNvar = (currRing->N);
    1018   hexist = hInit(S, Q, &hNexist, tailRing);
     1021  hexist = hInit(S, Q, &hNexist, tailRing); // tailRing?
    10191022  if (k!=0)
    10201023    hComp(hexist, hNexist, k, hexist, &hNstc);
     
    13091312}
    13101313
    1311 static ideal scIdKbase()
    1312 {
    1313   polyset mm;
    1314   ideal res;
    1315   poly p, q = last;
    1316   int i = pLength(q);
    1317   res = idInit(i,1);
    1318   mm = res->m;
    1319   i = 0;
     1314static ideal scIdKbase(poly q, const int rank)
     1315{
     1316  ideal res = idInit(pLength(q), rank);
     1317  polyset mm = res->m;
     1318  int i = 0;
    13201319  do
    13211320  {
    1322     mm[i] = q;
    1323     i++;
    1324     p = pNext(q);
     1321    *mm = q; ++mm;
     1322
     1323    const poly p = pNext(q);
    13251324    pNext(q) = NULL;
    13261325    q = p;
     1326     
    13271327  } while (q!=NULL);
    13281328   
    1329   id_Test(res, currRing);   
     1329  id_Test(res, currRing);   // WRONG RANK!!!???
    13301330  return res;
    13311331}
     
    13911391  if (p == NULL)
    13921392    return idInit(1,s->rank);
    1393   else
    1394   {
    1395     last = p;
    1396     ideal res=scIdKbase();
    1397     res->rank=s->rank;
    1398     id_Test(res, currRing);
    1399     return res;
    1400   }
     1393   
     1394  last = p;
     1395  return scIdKbase(p, s->rank);
    14011396}
    14021397
    14031398#if 0 //-- alternative implementation of scComputeHC
     1399/*
    14041400void scComputeHCw(ideal ss, ideal Q, int ak, poly &hEdge, ring tailRing)
    14051401{
     
    14221418  hexist = hInit(s, Q, &hNexist, currRing);
    14231419  p = last = pInit();
    1424   /*pNext(p) = NULL;*/
     1420  // pNext(p) = NULL;
    14251421  act = (scmon)omAlloc(((currRing->N) + 1) * sizeof(int));
    14261422  *act = 0;
     
    14631459  {
    14641460    last = p;
    1465     ideal res=scIdKbase();
    1466     res->rank=ss->rank;
     1461    ideal res=scIdKbase(p, ss->rank);
    14671462    poly p_ind=res->m[0]; int ind=0;
    14681463    for(i=IDELEMS(res)-1;i>0;i--)
     
    14841479  }
    14851480}
     1481 */
    14861482#endif
  • kernel/combinatorics/hilb.cc

    reb55f8a r5b45a4  
    11381138                int /*notstc*/, intvec *wdegree, ideal Q, ring tailRing)
    11391139{
    1140   id_TestTail(S, currRing, tailRing);
     1140//  id_TestTail(S, currRing, tailRing);
    11411141   
    11421142  intvec *work, *hseries1=NULL;
     
    12931293intvec * hHstdSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q, ring tailRing)
    12941294{
     1295  id_TestTail(S, currRing, tailRing);
     1296  id_TestTail(Q, currRing, tailRing);
    12951297  return hSeries(S, modulweight, 0, wdegree, Q, tailRing);
    12961298}
     
    12981300intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
    12991301{
     1302  id_TestTail(S, currRing, tailRing);
     1303  id_TestTail(Q, currRing, tailRing);
    13001304  return hSeries(S, modulweight, 1, wdegree, Q, tailRing);
    13011305}
  • kernel/combinatorics/stairc.h

    reb55f8a r5b45a4  
    2727int scDimInt(ideal  s,ideal Q=NULL);
    2828int scMultInt(ideal  s,ideal Q=NULL);
    29 int scMult0Int(ideal  s,ideal Q=NULL, const ring r=currRing);
     29int scMult0Int(ideal  s,ideal Q=NULL, const ring tailRing = currRing);
    3030void scPrintDegree(int co, int mu);
    3131void scDegree(ideal  s,intvec *modulweight,ideal Q=NULL);
  • kernel/ideals.cc

    reb55f8a r5b45a4  
    4545
    4646/* #define WITH_OLD_MINOR */
    47 #define pCopy_noCheck(p) pCopy(p)
    4847
    4948/*0 implementation*/
     
    12091208*
    12101209*/
    1211 static ideal idInitializeQuot (ideal  h1, ideal h2, BOOLEAN h1IsStb,
    1212                                BOOLEAN *addOnlyOne, int *kkmax)
    1213 {
     1210static ideal idInitializeQuot (ideal  h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN *addOnlyOne, int *kkmax)
     1211{
     1212  idTest(h1);
     1213  idTest(h2);
     1214   
    12141215  ideal temph1;
    12151216  poly     p,q = NULL;
     
    12671268      if (h4->m[i-1]!=NULL)
    12681269      {
    1269         p = pCopy_noCheck(h4->m[i-1]);
    1270         p_Shift(&p,1,currRing);
     1270        p = p_Copy_noCheck(h4->m[i-1], currRing); p_Shift(&p,1,currRing);
     1271        // pTest(p);
    12711272        h4->m[i] = p;
    12721273      }
     
    13131314  }
    13141315  idDelete(&temph1);
     1316  idTest(h4);
    13151317  return h4;
    13161318}
  • libpolys/polys/monomials/p_polys.h

    reb55f8a r5b45a4  
    801801 *
    802802 ***************************************************************/
    803 // returns a copy of p
     803/// returns a copy of p (without any additional testing)
     804static inline poly p_Copy_noCheck(poly p, const ring r)
     805{
     806  assume(r != NULL); assume(r->p_Procs != NULL); assume(r->p_Procs->p_Copy != NULL);
     807  return r->p_Procs->p_Copy(p, r);
     808}
     809
     810/// returns a copy of p
    804811static inline poly p_Copy(poly p, const ring r)
    805812{
    806   const poly pp = r->p_Procs->p_Copy(p, r);
     813  p_Test(p,r);
     814  const poly pp = p_Copy_noCheck(p, r);
    807815  p_Test(pp,r);
    808816  return pp;
     
    829837#ifndef PDEBUG
    830838    if (tailRing == lmRing)
    831       return tailRing->p_Procs->p_Copy(p, tailRing);
     839      return p_Copy_noCheck(p, tailRing);
    832840#endif
    833841    poly pres = p_Head(p, lmRing);
    834     pNext(pres) = tailRing->p_Procs->p_Copy(pNext(p), tailRing);
     842    pNext(pres) = p_Copy_noCheck(pNext(p), tailRing);
    835843    return pres;
    836844  }
Note: See TracChangeset for help on using the changeset viewer.