Changeset 304ad9b in git
- Timestamp:
- Jun 10, 2011, 11:27:08 AM (12 years ago)
- 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
- Location:
- libpolys/polys
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/Makefile.am
r26a1eb r304ad9b 44 44 monomials/monomials.cc monomials/p_polys.cc monomials/ring.cc monomials/maps.cc \ 45 45 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 \ 47 47 nc/gring.cc nc/sca.cc nc/summator.cc nc/ncSAFormula.cc nc/ncSACache.cc nc/ncSAMult.cc \ 48 48 pDebug.cc polys0.cc prCopy.cc \ … … 58 58 nc/nc.h nc/sca.h nc/summator.h nc/ncSAFormula.h nc/ncSACache.h nc/ncSAMult.h \ 59 59 operations/pShallowCopyDelete.h \ 60 templates/p_MemAdd.h templates/p_MemCmp.h templates/p_MemCopy.hoperations/p_Mult_q.h \60 templates/p_MemAdd.h operations/p_Mult_q.h \ 61 61 templates/p_Numbers.h templates/p_Procs.h templates/mod_raw.h \ 62 62 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 36 36 #include <polys/monomials/ring.h> 37 37 #include <polys/monomials/p_polys.h> 38 #include <polys/templates/p_Procs.h>39 38 #include <reporter/reporter.h> 40 39 -
libpolys/polys/monomials/p_polys.cc
r26a1eb r304ad9b 25 25 #include "monomials/ring.h" 26 26 #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 27 31 28 32 // #include <???/ideals.h> -
libpolys/polys/monomials/p_polys.h
r26a1eb r304ad9b 27 27 #include <polys/monomials/polys-impl.h> 28 28 29 #include <polys/templates/p_MemCmp.h>30 29 #include <polys/templates/p_MemAdd.h> 31 #include <polys/templates/p_MemCopy.h>32 30 #include <polys/templates/p_Procs.h> 33 34 // #include <polys/monomials/p_polys.h>35 31 36 32 #include <polys/sbuckets.h> … … 853 849 omTypeAllocBin(poly, np, r->PolyBin); 854 850 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)); 856 852 pNext(np) = NULL; 857 853 pSetCoeff0(np, n_Copy(pGetCoeff(p), r->cf)); … … 1283 1279 p_LmCheckPolyRing1(d_p, r); 1284 1280 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)); 1286 1282 } 1287 1283 … … 1307 1303 omTypeAllocBin(poly, np, r->PolyBin); 1308 1304 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)); 1310 1306 pNext(np) = NULL; 1311 1307 pSetCoeff0(np, NULL); … … 1345 1341 omTypeAllocBin(poly, np, r->PolyBin); 1346 1342 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)); 1348 1344 pNext(np) = NULL; 1349 1345 pSetCoeff0(np, n_Init(1, r->cf)); … … 1364 1360 pAssume1(bin->sizeW == r->PolyBin->sizeW); 1365 1361 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)); 1367 1363 pSetCoeff0(new_p, pGetCoeff(p)); 1368 1364 pNext(new_p) = pNext(p); … … 1389 1385 p_MemAdd_LengthGeneral(p1->exp, p2->exp, r->ExpL_Size); 1390 1386 p_MemAdd_NegWeightAdjust(p1, r); 1387 } 1388 // ExpVector(pr) = ExpVector(p1) + ExpVector(p2) 1389 static 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); 1391 1402 } 1392 1403 // ExpVector(p1) -= ExpVector(p2) … … 1407 1418 } 1408 1419 // 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 1441 1437 // ExpVector(pr) = ExpVector(p1) - ExpVector(p2) 1442 1438 static inline void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r) … … 1509 1505 * 1510 1506 ***************************************************************/ 1507 1511 1508 static inline int p_LmCmp(poly p, poly q, const ring r) 1512 1509 { … … 1514 1511 p_LmCheckPolyRing1(q, r); 1515 1512 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 1518 1539 } 1519 1540 -
libpolys/polys/operations/p_Mult_q.cc
r26a1eb r304ad9b 20 20 #include <polys/monomials/p_polys.h> 21 21 #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> 22 25 #include <polys/templates/p_Numbers.h> 23 26 #include <polys/kbuckets.h>
Note: See TracChangeset
for help on using the changeset viewer.