Changeset 304ad9b in git


Ignore:
Timestamp:
Jun 10, 2011, 11:27:08 AM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
Children:
d0570be216e9d12e9a635703c382d6eedfbab33e
Parents:
26a1ebe55f80d94b459ee0ee3e5e47163d2f81e2
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-06-10 11:27:08+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:39:07+01:00
Message:
p_MemCmp.h and p_MemCopy.h are now internal headers
Location:
libpolys/polys
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/Makefile.am

    r26a1eb r304ad9b  
    4444        monomials/monomials.cc monomials/p_polys.cc monomials/ring.cc monomials/maps.cc \
    4545        operations/pShallowCopyDelete.cc operations/p_Mult_q.cc \
    46         templates/p_Procs_Lib.cc \
     46        templates/p_Procs_Lib.cc templates/p_MemCmp.h templates/p_MemCopy.h \
    4747        nc/gring.cc nc/sca.cc nc/summator.cc nc/ncSAFormula.cc nc/ncSACache.cc nc/ncSAMult.cc \
    4848        pDebug.cc polys0.cc prCopy.cc \
     
    5858        nc/nc.h nc/sca.h nc/summator.h nc/ncSAFormula.h nc/ncSACache.h nc/ncSAMult.h \
    5959        operations/pShallowCopyDelete.h \
    60         templates/p_MemAdd.h templates/p_MemCmp.h templates/p_MemCopy.h operations/p_Mult_q.h \
     60        templates/p_MemAdd.h operations/p_Mult_q.h \
    6161        templates/p_Numbers.h templates/p_Procs.h templates/mod_raw.h \
    6262        templates/p_Procs_Dynamic.h templates/p_Procs_Impl.h templates/p_Procs_Set.h templates/p_Procs_Static.h \
  • libpolys/polys/monomials/monomials.cc

    r26a1eb r304ad9b  
    3636#include <polys/monomials/ring.h>
    3737#include <polys/monomials/p_polys.h>
    38 #include <polys/templates/p_Procs.h>
    3938#include <reporter/reporter.h>
    4039
  • libpolys/polys/monomials/p_polys.cc

    r26a1eb r304ad9b  
    2525#include "monomials/ring.h"
    2626#include "monomials/p_polys.h"
     27#include <polys/templates/p_MemCmp.h>
     28#include <polys/templates/p_MemAdd.h>
     29#include <polys/templates/p_MemCopy.h>
     30
    2731
    2832// #include <???/ideals.h>
  • libpolys/polys/monomials/p_polys.h

    r26a1eb r304ad9b  
    2727#include <polys/monomials/polys-impl.h>
    2828
    29 #include <polys/templates/p_MemCmp.h>
    3029#include <polys/templates/p_MemAdd.h>
    31 #include <polys/templates/p_MemCopy.h>
    3230#include <polys/templates/p_Procs.h>
    33 
    34 // #include <polys/monomials/p_polys.h>
    3531
    3632#include <polys/sbuckets.h>
     
    853849  omTypeAllocBin(poly, np, r->PolyBin);
    854850  p_SetRingOfLm(np, r);
    855   p_MemCopy_LengthGeneral(np->exp, p->exp, r->ExpL_Size);
     851  memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long));
    856852  pNext(np) = NULL;
    857853  pSetCoeff0(np, n_Copy(pGetCoeff(p), r->cf));
     
    12831279  p_LmCheckPolyRing1(d_p, r);
    12841280  p_LmCheckPolyRing1(s_p, r);
    1285   p_MemCopy_LengthGeneral(d_p->exp, s_p->exp, r->ExpL_Size);
     1281  memcpy(d_p->exp, s_p->exp, r->ExpL_Size*sizeof(long));
    12861282}
    12871283
     
    13071303  omTypeAllocBin(poly, np, r->PolyBin);
    13081304  p_SetRingOfLm(np, r);
    1309   p_MemCopy_LengthGeneral(np->exp, p->exp, r->ExpL_Size);
     1305  memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long));
    13101306  pNext(np) = NULL;
    13111307  pSetCoeff0(np, NULL);
     
    13451341  omTypeAllocBin(poly, np, r->PolyBin);
    13461342  p_SetRingOfLm(np, r);
    1347   p_MemCopy_LengthGeneral(np->exp, p->exp, r->ExpL_Size);
     1343  memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long));
    13481344  pNext(np) = NULL;
    13491345  pSetCoeff0(np, n_Init(1, r->cf));
     
    13641360  pAssume1(bin->sizeW == r->PolyBin->sizeW);
    13651361  poly new_p = p_New(r);
    1366   p_MemCopy_LengthGeneral(new_p->exp, p->exp, r->ExpL_Size);
     1362  memcpy(new_p->exp, p->exp, r->ExpL_Size*sizeof(long));
    13671363  pSetCoeff0(new_p, pGetCoeff(p));
    13681364  pNext(new_p) = pNext(p);
     
    13891385  p_MemAdd_LengthGeneral(p1->exp, p2->exp, r->ExpL_Size);
    13901386  p_MemAdd_NegWeightAdjust(p1, r);
     1387}
     1388// ExpVector(pr) = ExpVector(p1) + ExpVector(p2)
     1389static inline void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
     1390{
     1391  p_LmCheckPolyRing1(p1, r);
     1392  p_LmCheckPolyRing1(p2, r);
     1393  p_LmCheckPolyRing1(pr, r);
     1394#if PDEBUG >= 1
     1395  for (int i=1; i<=r->N; i++)
     1396    pAssume1((unsigned long) (p_GetExp(p1, i, r) + p_GetExp(p2, i, r)) <= r->bitmask);
     1397  pAssume1(p_GetComp(p1, r) == 0 || p_GetComp(p2, r) == 0);
     1398#endif
     1399
     1400  p_MemSum_LengthGeneral(pr->exp, p1->exp, p2->exp, r->ExpL_Size);
     1401  p_MemAdd_NegWeightAdjust(pr, r);
    13911402}
    13921403// ExpVector(p1) -= ExpVector(p2)
     
    14071418}
    14081419// ExpVector(p1) += ExpVector(p2) - ExpVector(p3)
    1409 static inline void p_ExpVectorAddSub(poly p1, poly p2, poly p3, const ring r)
    1410 {
    1411   p_LmCheckPolyRing1(p1, r);
    1412   p_LmCheckPolyRing1(p2, r);
    1413   p_LmCheckPolyRing1(p3, r);
    1414 #if PDEBUG >= 1
    1415   for (int i=1; i<=r->N; i++)
    1416     pAssume1(p_GetExp(p1, i, r) + p_GetExp(p2, i, r) >= p_GetExp(p3, i, r));
    1417   pAssume1(p_GetComp(p1, r) == 0 ||
    1418            (p_GetComp(p2, r) - p_GetComp(p3, r) == 0) ||
    1419            (p_GetComp(p1, r) == p_GetComp(p2, r) - p_GetComp(p3, r)));
    1420 #endif
    1421 
    1422   p_MemAddSub_LengthGeneral(p1->exp, p2->exp, p3->exp, r->ExpL_Size);
    1423   // no need to adjust in case of NegWeights
    1424 }
    1425 
    1426 // ExpVector(pr) = ExpVector(p1) + ExpVector(p2)
    1427 static inline void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
    1428 {
    1429   p_LmCheckPolyRing1(p1, r);
    1430   p_LmCheckPolyRing1(p2, r);
    1431   p_LmCheckPolyRing1(pr, r);
    1432 #if PDEBUG >= 1
    1433   for (int i=1; i<=r->N; i++)
    1434     pAssume1((unsigned long) (p_GetExp(p1, i, r) + p_GetExp(p2, i, r)) <= r->bitmask);
    1435   pAssume1(p_GetComp(p1, r) == 0 || p_GetComp(p2, r) == 0);
    1436 #endif
    1437 
    1438   p_MemSum_LengthGeneral(pr->exp, p1->exp, p2->exp, r->ExpL_Size);
    1439   p_MemAdd_NegWeightAdjust(pr, r);
    1440 }
     1420//static inline void p_ExpVectorAddSub(poly p1, poly p2, poly p3, const ring r)
     1421//{
     1422//  p_LmCheckPolyRing1(p1, r);
     1423//  p_LmCheckPolyRing1(p2, r);
     1424//  p_LmCheckPolyRing1(p3, r);
     1425//#if PDEBUG >= 1
     1426//  for (int i=1; i<=r->N; i++)
     1427//    pAssume1(p_GetExp(p1, i, r) + p_GetExp(p2, i, r) >= p_GetExp(p3, i, r));
     1428//  pAssume1(p_GetComp(p1, r) == 0 ||
     1429//           (p_GetComp(p2, r) - p_GetComp(p3, r) == 0) ||
     1430//           (p_GetComp(p1, r) == p_GetComp(p2, r) - p_GetComp(p3, r)));
     1431//#endif
     1432//
     1433//  p_MemAddSub_LengthGeneral(p1->exp, p2->exp, p3->exp, r->ExpL_Size);
     1434//  // no need to adjust in case of NegWeights
     1435//}
     1436
    14411437// ExpVector(pr) = ExpVector(p1) - ExpVector(p2)
    14421438static inline void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
     
    15091505 *
    15101506 ***************************************************************/
     1507
    15111508static inline int p_LmCmp(poly p, poly q, const ring r)
    15121509{
     
    15141511  p_LmCheckPolyRing1(q, r);
    15151512
    1516   p_MemCmp_LengthGeneral_OrdGeneral(p->exp, q->exp, r->CmpL_Size, r->ordsgn,
    1517                                     return 0, return 1, return -1);
     1513  const unsigned long* _s1 = ((unsigned long*) p->exp);
     1514  const unsigned long* _s2 = ((unsigned long*) q->exp);
     1515  register unsigned long _v1;
     1516  register unsigned long _v2;
     1517  const unsigned long _l = r->CmpL_Size;
     1518
     1519  register unsigned long _i=0;
     1520
     1521  LengthGeneral_OrdGeneral_LoopTop:
     1522  _v1 = _s1[_i];
     1523  _v2 = _s2[_i];
     1524  if (_v1 == _v2)
     1525  {
     1526    _i++;
     1527    if (_i == _l) return 0;
     1528    goto LengthGeneral_OrdGeneral_LoopTop;
     1529  }
     1530  const long* _ordsgn = (long*) r->ordsgn;
     1531  if (_v1 > _v2)
     1532  {
     1533    if (_ordsgn[_i] == 1) return 1;
     1534    return -1;
     1535  }
     1536  if (_ordsgn[_i] == 1) return -1;
     1537  return 1;
     1538
    15181539}
    15191540
  • libpolys/polys/operations/p_Mult_q.cc

    r26a1eb r304ad9b  
    2020#include <polys/monomials/p_polys.h>
    2121#include <polys/templates/p_Procs.h>
     22#include <polys/templates/p_MemCmp.h>
     23#include <polys/templates/p_MemAdd.h>
     24#include <polys/templates/p_MemCopy.h>
    2225#include <polys/templates/p_Numbers.h>
    2326#include <polys/kbuckets.h>
Note: See TracChangeset for help on using the changeset viewer.