Changeset da9d52 in git for dyn_modules/syzextra/syzextra.cc
- Timestamp:
- Nov 22, 2012, 8:29:57 PM (11 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 7eaf722febee351de63ee153106d9bb44f37c045
- Parents:
- daa4e53f3b95f4242ea851541c7e3e0470446fa4
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-22 20:29:57+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:48+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/syzextra/syzextra.cc
rdaa4e5 rda9d52 294 294 if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) ) 295 295 { 296 #ifndef NDEBUG 296 297 if( __DEBUG__ || 0) 297 298 { … … 299 300 dPrint(p, r, r, 1); 300 301 } 302 #endif 301 303 coprime = false; // t not coprime with p! 302 304 break; … … 312 314 coprime = ( syzChecker.IsDivisible(ss) ); 313 315 316 #ifndef NDEBUG 314 317 if( __DEBUG__ && !coprime) 315 318 { … … 317 320 dPrint(ss, r, r, 1); 318 321 } 319 322 #endif 323 320 324 p_LmDelete(&ss, r); // deletes coeff as well??? 321 325 } … … 323 327 } 324 328 329 #ifndef NDEBUG 325 330 if( __DEBUG__ && coprime ) 326 331 PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n"); 327 332 #endif 333 328 334 return coprime? 3: 0; // t was coprime with all of leading terms!!! 329 335 … … 342 348 const ring r = m_rBaseRing; 343 349 350 #ifndef NDEBUG 344 351 if( __DEBUG__ || 0) 345 352 { … … 349 356 350 357 unsigned long pp[4] = {0,0,0,0}; // count preprocessed terms... 358 #endif 351 359 352 360 for( int p = IDELEMS(idTails) - 1; p >= 0; --p ) … … 356 364 const int k = m_div.PreProcessTerm(t, m_checker); // 0..3 357 365 assume( 0 <= k && k <= 3 ); 366 367 #ifndef NDEBUG 358 368 pp[k]++; 369 #endif 370 359 371 if( k ) 360 372 { 373 #ifndef NDEBUG 361 374 if( __DEBUG__) 362 375 { … … 364 377 dPrint(t, r, r, 1); 365 378 } 379 #endif 366 380 367 381 (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next... … … 372 386 } 373 387 388 #ifndef NDEBUG 374 389 if( TEST_OPT_PROT || 1) 375 390 Print(" **!!** SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing(): X: {c: %lu, C: %lu, P: %lu} + %lu\n", pp[1], pp[2], pp[3], pp[0]); 376 391 #endif 392 393 #ifndef NDEBUG 377 394 if( __DEBUG__ || 0) 378 395 { … … 380 397 dPrint(idTails, r, r, 0); 381 398 } 399 #endif 400 382 401 } 383 402 /* … … 722 741 723 742 assume( IDELEMS(L) == IDELEMS(T) ); 743 #ifndef NDEBUG 724 744 int t, r; 725 745 #endif 746 726 747 if( m_syzLeads == NULL ) 727 748 { 749 #ifndef NDEBUG 728 750 if( TEST_OPT_PROT || 1) 729 751 { … … 731 753 Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r); 732 754 } 755 #endif 733 756 ComputeLeadingSyzygyTerms( __LEAD2SYZ__ && !__IGNORETAILS__ ); // 2 terms OR 1 term! 757 #ifndef NDEBUG 734 758 if( TEST_OPT_PROT || 1) 735 759 { … … 737 761 Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n", getRTimer(), t, r); 738 762 } 739 763 #endif 764 740 765 } 741 766 … … 756 781 if( T != NULL ) 757 782 { 783 #ifndef NDEBUG 758 784 if( TEST_OPT_PROT || 1 ) 759 785 { … … 761 787 Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", r, t, r); 762 788 } 763 789 #endif 790 764 791 SetUpTailTerms(); 765 792 #ifndef NDEBUG 766 793 if( TEST_OPT_PROT || 1) 767 794 { … … 769 796 Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n", getRTimer(), t, r); 770 797 } 798 #endif 771 799 } 772 800 } 773 801 802 #ifndef NDEBUG 774 803 if( TEST_OPT_PROT || 1) 775 804 { … … 777 806 Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", r, t, r); 778 807 } 779 808 #endif 809 780 810 for( int k = size - 1; k >= 0; k-- ) 781 811 { … … 808 838 } 809 839 840 #ifndef NDEBUG 810 841 if( TEST_OPT_PROT || 1) 811 842 { … … 813 844 Print("%5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r); 814 845 } 846 #endif 815 847 816 848 TT->rank = id_RankFreeModule(TT, R); … … 1084 1116 m_rBaseRing( rootRingHdl->data.uring ) 1085 1117 { 1118 #ifndef NDEBUG 1086 1119 if( __DEBUG__ ) 1087 1120 { … … 1092 1125 Print(" TAILREDSYZ: \t%d\n", __TAILREDSYZ__); 1093 1126 Print(" IGNORETAILS: \t%d\n", __IGNORETAILS__); 1094 1095 } 1096 1127 } 1128 #endif 1129 1097 1130 // TODO: just current setting! 1098 1131 assume( rootRingHdl == currRingHdl ); … … 1317 1350 if( Current().DivisibilityCheck(m_product, m_not_sev, m_rBaseRing) ) 1318 1351 { 1352 #ifndef NDEBUG 1319 1353 if( __DEBUG__ ) 1320 1354 { … … 1322 1356 dPrint(Current().m_lt, m_rBaseRing, m_rBaseRing, 1); 1323 1357 } 1324 1358 #endif 1325 1359 // m_active = true; 1326 1360 return true; … … 1408 1442 assume( p_sev == p_GetShortExpVector(p, r) ); 1409 1443 1410 Print("L[%d]: ", k); dPrint(p, r, r, 0); Print("SEV: %dl\n", p_sev); 1444 Print("L[%d]: ", k); dPrint(p, r, r, 0); Print("SEV: %dl\n", p_sev); 1411 1445 } 1412 1446 } … … 1490 1524 if( Current().DivisibilityCheck(m_multiplier, m_term, m_not_sev, m_rBaseRing) ) 1491 1525 { 1526 #ifndef NDEBUG 1492 1527 if( __DEBUG__ ) 1493 1528 { … … 1495 1530 dPrint(Current().m_lt, m_rBaseRing, m_rBaseRing, 1); 1496 1531 } 1497 1532 #endif 1498 1533 // m_active = true; 1499 1534 return true; … … 1565 1600 1566 1601 p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t // TODO: do it once? 1602 p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k])) 1603 1604 p_SetComp(q, k + 1, r); 1605 p_Setm(q, r); 1606 1607 // cannot allow something like: a*gen(i) - a*gen(i) 1608 if (syzterm != NULL && (k == c)) 1609 if (p_ExpVectorEqual(syzterm, q, r)) 1610 { 1611 #ifndef NDEBUG 1612 if( __DEBUG__ ) 1613 { 1614 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); 1615 dPrint(syzterm, r, r, 1); 1616 } 1617 #endif 1618 continue; 1619 } 1620 1621 // while the complement (the fraction) is not reducible by leading syzygies 1622 if( to_check && syz_checker.IsDivisible(q) ) 1623 { 1624 #ifndef NDEBUG 1625 if( __DEBUG__ ) 1626 { 1627 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: "); 1628 } 1629 #endif 1630 continue; 1631 } 1632 1633 number n = n_Mult( p_GetCoeff(multiplier, r), p_GetCoeff(t, r), r); 1634 p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r); 1635 n_Delete(&n, r); 1636 1637 return q; 1638 } 1639 1640 /* 1641 const long comp = p_GetComp(t, r); assume( comp >= 0 ); 1642 const unsigned long not_sev = ~p_GetShortExpVector(multiplier, t, r); // ! 1643 1644 // for( int k = IDELEMS(L)-1; k>= 0; k-- ) 1645 // { 1646 // const poly p = L->m[k]; 1647 // 1648 // if ( p_GetComp(p, r) != comp ) 1649 // continue; 1650 // 1651 // const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!! 1652 1653 // looking for an appropriate diviser p = L[k]... 1654 CReducersHash::const_iterator it = m_hash.find(comp); // same module component 1655 1656 if( it == m_hash.end() ) 1657 return NULL; 1658 1659 assume( m_L != NULL ); 1660 1661 const TReducers& reducers = it->second; 1662 1663 for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ ) 1664 { 1665 1666 const poly p = (*vit)->m_lt; 1667 const int k = (*vit)->m_label; 1668 1669 assume( L->m[k] == p ); 1670 1671 // const unsigned long p_sev = (*vit)->m_sev; 1672 // assume( p_sev == p_GetShortExpVector(p, r) ); 1673 1674 // if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) ) 1675 // continue; 1676 1677 if( !(*vit)->DivisibilityCheck(multiplier, t, not_sev, r) ) 1678 continue; 1679 1680 1681 // if (p_sev & not_sev) continue; 1682 // if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue; 1683 1684 1685 p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t 1567 1686 p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k])) 1568 1687 … … 1600 1719 return q; 1601 1720 } 1602 1603 /*1604 const long comp = p_GetComp(t, r); assume( comp >= 0 );1605 const unsigned long not_sev = ~p_GetShortExpVector(multiplier, t, r); // !1606 1607 // for( int k = IDELEMS(L)-1; k>= 0; k-- )1608 // {1609 // const poly p = L->m[k];1610 //1611 // if ( p_GetComp(p, r) != comp )1612 // continue;1613 //1614 // const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!!1615 1616 // looking for an appropriate diviser p = L[k]...1617 CReducersHash::const_iterator it = m_hash.find(comp); // same module component1618 1619 if( it == m_hash.end() )1620 return NULL;1621 1622 assume( m_L != NULL );1623 1624 const TReducers& reducers = it->second;1625 1626 for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )1627 {1628 1629 const poly p = (*vit)->m_lt;1630 const int k = (*vit)->m_label;1631 1632 assume( L->m[k] == p );1633 1634 // const unsigned long p_sev = (*vit)->m_sev;1635 // assume( p_sev == p_GetShortExpVector(p, r) );1636 1637 // if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) )1638 // continue;1639 1640 if( !(*vit)->DivisibilityCheck(multiplier, t, not_sev, r) )1641 continue;1642 1643 1644 // if (p_sev & not_sev) continue;1645 // if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue;1646 1647 1648 p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t1649 p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k]))1650 1651 p_SetComp(q, k + 1, r);1652 p_Setm(q, r);1653 1654 // cannot allow something like: a*gen(i) - a*gen(i)1655 if (syzterm != NULL && (k == c))1656 if (p_ExpVectorEqual(syzterm, q, r))1657 {1658 if( __DEBUG__ )1659 {1660 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");1661 dPrint(syzterm, r, r, 1);1662 }1663 1664 continue;1665 }1666 1667 // while the complement (the fraction) is not reducible by leading syzygies1668 if( to_check && syz_checker.IsDivisible(q) )1669 {1670 if( __DEBUG__ )1671 {1672 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: ");1673 }1674 1675 continue;1676 }1677 1678 number n = n_Mult( p_GetCoeff(multiplier, r), p_GetCoeff(t, r), r);1679 p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r);1680 n_Delete(&n, r);1681 1682 return q;1683 }1684 1721 */ 1685 1722 … … 1747 1784 if (p_ExpVectorEqual(syzterm, q, r)) 1748 1785 { 1786 #ifndef NDEBUG 1749 1787 if( __DEBUG__ ) 1750 1788 { … … 1752 1790 dPrint(syzterm, r, r, 1); 1753 1791 } 1754 1792 #endif 1755 1793 continue; 1756 1794 } … … 1759 1797 if( to_check && syz_checker.IsDivisible(q) ) 1760 1798 { 1799 #ifndef NDEBUG 1761 1800 if( __DEBUG__ ) 1762 1801 { 1763 1802 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: "); 1764 1803 } 1765 1804 #endif 1766 1805 continue; 1767 1806 }
Note: See TracChangeset
for help on using the changeset viewer.