Changeset 3a9e92a in git


Ignore:
Timestamp:
Dec 18, 2013, 4:50:21 PM (10 years ago)
Author:
Christian Eder
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
7e2f2d4d596a804ea1786814516bb72ef3fa5d24
Parents:
6e3023af87cd7303404f428f8b9a5e633065747b
Message:
1. adds/brings back p_ExpVectorAddSub() which is useful in sba
2. uses p_ExpVectorAddSub() in sba
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/kspoly.cc

    r6e3023a r3a9e92a  
    223223  if (!PW->is_sigsafe)
    224224  {
    225     poly ftmp;
    226     ring rtmp;
    227     PR->SetLmCurrRing();
    228     poly f1 = pCopy(PR->GetLmCurrRing());
    229     //PR->GetLm(ftmp,rtmp);
    230     //poly f1 = k_LmInit_tailRing_2_currRing(ftmp,rtmp);
    231     poly f2 = PW->GetLmCurrRing();
    232225    poly sigMult = pCopy(PW->sig);   // copy signature of reducer
    233     p_ExpVectorSub(f1, f2, currRing); // Calculate the Monomial we must multiply to p2
    234226//#if 1
    235227#ifdef DEBUGF5
     
    240232    printf("--------------\n");
    241233#endif
    242     sigMult = p_Mult_q(f1,sigMult,currRing);
     234    p_ExpVectorAddSub(sigMult,PR->GetLmCurrRing(),PW->GetLmCurrRing(),currRing);
    243235//#if 1
    244236#ifdef DEBUGF5
  • kernel/polys.h

    r6e3023a r3a9e92a  
    8080 ***************************************************************/
    8181
    82 #define pExpVectorCopy(d_p, s_p)    p_ExpVectorCopy(d_p, s_p, currRing)
    83 #define pExpVectorAdd(p1, p2)       p_ExpVectorAdd(p1, p2, currRing)
    84 #define pExpVectorSub(p1, p2)       p_ExpVectorSub(p1, p2, currRing)
    85 #define pExpVectorAddSub(p1, p2, p3)p_ExpVectorAddSub(p1, p2, p3, currRing)
    86 #define pExpVectorSum(pr, p1, p2)   p_ExpVectorSum(pr, p1, p2, currRing)
    87 #define pExpVectorDiff(pr, p1, p2)  p_ExpVectorDiff(pr, p1, p2, currRing)
     82#define pExpVectorCopy(d_p, s_p)      p_ExpVectorCopy(d_p, s_p, currRing)
     83#define pExpVectorAdd(p1, p2)         p_ExpVectorAdd(p1, p2, currRing)
     84#define pExpVectorSub(p1, p2)         p_ExpVectorSub(p1, p2, currRing)
     85#define pExpVectorAddSub(p1, p2, p3)  p_ExpVectorAddSub(p1, p2, p3, currRing)
     86#define pExpVectorSum(pr, p1, p2)     p_ExpVectorSum(pr, p1, p2, currRing)
     87#define pExpVectorDiff(pr, p1, p2)    p_ExpVectorDiff(pr, p1, p2, currRing)
    8888
    8989// Gets a copy of (resp. set) the exponent vector, where e is assumed
  • libpolys/polys/monomials/p_polys.h

    r6e3023a r3a9e92a  
    13761376}
    13771377// ExpVector(p1) += ExpVector(p2) - ExpVector(p3)
    1378 //static inline void p_ExpVectorAddSub(poly p1, poly p2, poly p3, const ring r)
    1379 //{
    1380 //  p_LmCheckPolyRing1(p1, r);
    1381 //  p_LmCheckPolyRing1(p2, r);
    1382 //  p_LmCheckPolyRing1(p3, r);
    1383 //#if PDEBUG >= 1
    1384 //  for (int i=1; i<=r->N; i++)
    1385 //    pAssume1(p_GetExp(p1, i, r) + p_GetExp(p2, i, r) >= p_GetExp(p3, i, r));
    1386 //  pAssume1(p_GetComp(p1, r) == 0 ||
    1387 //           (p_GetComp(p2, r) - p_GetComp(p3, r) == 0) ||
    1388 //           (p_GetComp(p1, r) == p_GetComp(p2, r) - p_GetComp(p3, r)));
    1389 //#endif
    1390 //
    1391 //  p_MemAddSub_LengthGeneral(p1->exp, p2->exp, p3->exp, r->ExpL_Size);
    1392 //  // no need to adjust in case of NegWeights
    1393 //}
     1378static inline void p_ExpVectorAddSub(poly p1, poly p2, poly p3, const ring r)
     1379{
     1380  p_LmCheckPolyRing1(p1, r);
     1381  p_LmCheckPolyRing1(p2, r);
     1382  p_LmCheckPolyRing1(p3, r);
     1383#if PDEBUG >= 1
     1384  for (int i=1; i<=r->N; i++)
     1385    pAssume1(p_GetExp(p1, i, r) + p_GetExp(p2, i, r) >= p_GetExp(p3, i, r));
     1386    pAssume1(p_GetComp(p1, r) == 0 ||
     1387           (p_GetComp(p2, r) - p_GetComp(p3, r) == 0) ||
     1388           (p_GetComp(p1, r) == p_GetComp(p2, r) - p_GetComp(p3, r)));
     1389#endif
     1390
     1391  p_MemAddSub_LengthGeneral(p1->exp, p2->exp, p3->exp, r->ExpL_Size);
     1392  // no need to adjust in case of NegWeights
     1393}
    13941394
    13951395// ExpVector(pr) = ExpVector(p1) - ExpVector(p2)
Note: See TracChangeset for help on using the changeset viewer.