Changeset 026171 in git for dyn_modules/syzextra/syzextra.cc
- Timestamp:
- Jul 30, 2012, 5:19:40 PM (12 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- dd24e5dded66979eda13e955b93fc284cbb341e7
- Parents:
- c93fda01f3f4eb9609a2210ea9eec1816d8fb7f1
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-30 17:19:40+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:46+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/syzextra/syzextra.cc
rc93fda r026171 366 366 367 367 368 369 370 371 372 373 374 368 // TODO/NOTE: input is supposed to be sorted wrt "C,ds"!?? 369 370 // components should come in groups: count elements in each group 371 // && estimate the real size!!! 372 373 374 // use just a vector instead??? 375 375 ideal newid = idInit( (size * (size-1))/2, size); // maximal size: ideal case! 376 376 … … 489 489 } 490 490 491 CLCM::CLCM(const SchreyerSyzygyComputation& data): std::vector<bool>(), m_data(data), m_compute(false) 492 { 493 const ideal& L = data.m_idLeads; 494 const ring& R = data.m_rBaseRing; 495 const SchreyerSyzygyComputationFlags& attributes = data.m_atttributes; 496 497 // const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 498 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 499 const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 500 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 501 502 503 assume( L != NULL ); 504 assume( R != NULL ); 505 assume( R == currRing ); 506 507 if( __TAILREDSYZ__ && !__HYBRIDNF__ ) 508 { 509 const int l = IDELEMS(L); 510 511 resize(l, false); 512 513 const unsigned int N = rVar(R); 514 515 for( int k = l - 1; k >= 0; k-- ) 516 { 517 const poly a = L->m[k]; assume( a != NULL ); 518 519 for (unsigned int j = N; j > 0; j--) 520 if ( !(*this)[j] ) 521 (*this)[j] = (p_GetExp(a, j, R) > 0); 522 } 523 524 m_compute = true; 525 } 526 } 527 528 529 bool CLCM::Check(const poly m) const 530 { 531 assume( m != NULL ); 532 if( m_compute && (m != NULL)) 533 { 534 const ring& R = m_data.m_rBaseRing; 535 const SchreyerSyzygyComputationFlags& attributes = m_data.m_atttributes; 536 537 // const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 538 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 539 const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 540 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 541 542 assume( R != NULL ); 543 assume( R == currRing ); 544 545 assume( __TAILREDSYZ__ && !__HYBRIDNF__ ); 546 547 const unsigned int N = rVar(R); 548 549 for (unsigned int j = N; j > 0; j--) 550 if ( (*this)[j] ) 551 if(p_GetExp(m, j, R) > 0) 552 return true; 553 554 return false; 555 556 } else return true; 557 } 558 491 559 void SchreyerSyzygyComputation::ComputeSyzygy() 492 560 { … … 507 575 const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 508 576 const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 509 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;577 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 510 578 511 579 assume( R == currRing ); // For attributes :-/ … … 524 592 return; 525 593 526 527 ideal LS = NULL;528 529 if( __TAILREDSYZ__ )530 LS = LL;531 594 532 595 for( int k = size - 1; k >= 0; k-- ) … … 593 656 594 657 if( bComputeSecondTerms ) 658 { 659 assume( __LEAD2SYZ__ ); 595 660 // m_syzLeads = FROM_NAMESPACE(INTERNAL, _Compute2LeadingSyzygyTerms(m_idLeads, m_rBaseRing, m_atttributes)); 596 661 m_syzLeads = Compute2LeadingSyzygyTerms(); 662 } 597 663 else 664 { 665 assume( !__LEAD2SYZ__ ); 666 598 667 m_syzLeads = Compute1LeadingSyzygyTerms(); 668 } 599 669 // m_syzLeads = FROM_NAMESPACE(INTERNAL, _ComputeLeadingSyzygyTerms(m_idLeads, m_rBaseRing, m_atttributes)); 600 670 … … 603 673 if (__TAILREDSYZ__) 604 674 m_LS = m_syzLeads; 675 676 (void)( __LEAD2SYZ__ ); 605 677 } 606 678 … … 732 804 const ideal& L = m_idLeads; 733 805 const ideal& T = m_idTails; 734 const ideal& LS = m_LS;806 // const ideal& LS = m_LS; 735 807 const ring& r = m_rBaseRing; 736 const SchreyerSyzygyComputationFlags& attributes = m_atttributes; 737 738 808 809 // const SchreyerSyzygyComputationFlags& attributes = m_atttributes; 739 810 // const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 740 811 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; … … 798 869 const ideal& L = m_idLeads; 799 870 const ideal& T = m_idTails; 800 const ideal& LS = m_LS;871 // const ideal& LS = m_LS; 801 872 const ring& r = m_rBaseRing; 802 873 const SchreyerSyzygyComputationFlags& attributes = m_atttributes; … … 814 885 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 815 886 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 816 //const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;887 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 817 888 818 889 assume( multiplier != NULL ); … … 823 894 poly s = NULL; 824 895 825 // iterate over the tail826 for(poly p = tail; p != NULL; p = pNext(p))827 s = p_Add_q(s, ReduceTerm(multiplier, p, NULL), r);896 if( (!__TAILREDSYZ__) || m_lcm.Check(multiplier) ) 897 for(poly p = tail; p != NULL; p = pNext(p)) // iterate over the tail 898 s = p_Add_q(s, ReduceTerm(multiplier, p, NULL), r); 828 899 829 900 return s; … … 837 908 const ideal& L = m_idLeads; 838 909 const ideal& T = m_idTails; 839 const ideal& LS = m_LS;910 // const ideal& LS = m_LS; 840 911 const ring& r = m_rBaseRing; 841 912 const SchreyerSyzygyComputationFlags& attributes = m_atttributes; … … 853 924 // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; 854 925 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 855 //const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;926 const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 856 927 857 928 assume( multiplier != NULL ); … … 867 938 poly s = NULL; 868 939 869 if( 1)940 if( (!__TAILREDSYZ__) || m_lcm.Check(multiplier) ) 870 941 { 871 942 // NOTE: only LT(term4reduction) should be used in the following: … … 897 968 BEGIN_NAMESPACE_NONAME 898 969 899 static inline int atGetInt(idhdl rootRingHdl, const char* attribute, intdef)970 static inline int atGetInt(idhdl rootRingHdl, const char* attribute, long def) 900 971 { 901 972 return ((int)(long)(atGet(rootRingHdl, attribute, INT_CMD, (void*)def)));
Note: See TracChangeset
for help on using the changeset viewer.