Changeset dd24e5 in git for dyn_modules/syzextra/syzextra.cc
- Timestamp:
- Aug 1, 2012, 5:25:00 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '1d362c315e551a5b527ab0759f8839cf0e94f3a5')
- Children:
- 495328d14a955b215ad10b598e995ab522243881
- Parents:
- 026171e1f09fe373a5c6ea5ed0b8db1abeb952f3
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-08-01 17:25:00+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
r026171 rdd24e5 251 251 } 252 252 253 254 253 // TODO/NOTE: input is supposed to be (reverse-) sorted wrt "(c,ds)"!?? 255 254 … … 489 488 } 490 489 490 491 CReducerFinder::CLeadingTerm::CLeadingTerm(unsigned int _label, const poly _lt, const ring R): 492 m_sev( p_GetShortExpVector(_lt, R) ), m_label( _label ), m_lt( _lt ) 493 { } 494 495 496 CReducerFinder::~CReducerFinder() 497 { 498 for( CReducersHash::const_iterator it = m_hash.begin(); it != m_hash.end(); it++ ) 499 { 500 const TReducers& v = it->second; 501 for(TReducers::const_iterator vit = v.begin(); vit != v.end(); vit++ ) 502 delete const_cast<CLeadingTerm*>(*vit); 503 } 504 } 505 506 CReducerFinder::CReducerFinder(const SchreyerSyzygyComputation& data): m_data(data), m_hash() 507 { 508 509 const ideal& L = data.m_idLeads; 510 const ring& R = data.m_rBaseRing; 511 // const SchreyerSyzygyComputationFlags& attributes = data.m_atttributes; 512 // 513 // const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 514 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; 515 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 516 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 517 518 519 assume( L != NULL ); 520 assume( R != NULL ); 521 assume( R == currRing ); 522 523 for( int k = IDELEMS(L) - 1; k >= 0; k-- ) 524 { 525 const poly a = L->m[k]; assume( a != NULL ); 526 527 // NOTE: label is k \in 0 ... |L|-1!!! 528 m_hash[p_GetComp(a, R)].push_back( new CLeadingTerm(k, a, R) ); 529 } 530 } 531 532 491 533 CLCM::CLCM(const SchreyerSyzygyComputation& data): std::vector<bool>(), m_data(data), m_compute(false) 492 534 { … … 606 648 poly a2 = pNext(a); 607 649 650 // Splitting 2-terms Leading syzygy module 608 651 if( a2 != NULL ) 609 652 { … … 633 676 if( a2 == NULL ) 634 677 { 635 aa = p_Mult_mm(aa, L->m[r], R); 636 a2 = FindReducer(aa, a); 678 aa = p_Mult_mm(aa, L->m[r], R); a2 = m_div.FindReducer(aa, a); 637 679 } 638 680 assume( a2 != NULL ); … … 677 719 } 678 720 679 poly SchreyerSyzygyComputation::FindReducer(poly product,poly syzterm) const721 poly CReducerFinder::FindReducer(const poly product, const poly syzterm) const 680 722 { 681 723 // return FROM_NAMESPACE(INTERNAL, _FindReducer(product, syzterm, m_idLeads, m_LS, m_rBaseRing, m_atttributes)); … … 685 727 // const SchreyerSyzygyComputationFlags attributes) 686 728 687 const ideal& L = m_ idLeads;688 const ideal& LS = m_ LS;689 const ring& r = m_ rBaseRing;690 const SchreyerSyzygyComputationFlags& attributes = m_ atttributes;729 const ideal& L = m_data.m_idLeads; 730 const ideal& LS = m_data.m_LS; 731 const ring& r = m_data.m_rBaseRing; 732 const SchreyerSyzygyComputationFlags& attributes = m_data.m_atttributes; 691 733 692 734 … … 700 742 assume( L != NULL ); 701 743 702 intc = 0;744 long c = 0; 703 745 704 746 if (syzterm != NULL) … … 706 748 707 749 assume( c >= 0 && c < IDELEMS(L) ); 708 709 if (__ SYZCHECK__ && syzterm != NULL)750 751 if (__DEBUG__ && (syzterm != NULL)) 710 752 { 711 753 const poly m = L->m[c]; … … 722 764 } 723 765 724 // looking for an appropriate diviser q = L[k]... 725 for( int k = IDELEMS(L)-1; k>= 0; k-- ) 726 { 727 const poly p = L->m[k]; 728 729 // ... which divides the product, looking for the _1st_ appropriate one! 730 if( !p_LmDivisibleBy(p, product, r) ) 731 continue; 766 const long comp = p_GetComp(product, r); 767 const unsigned long not_sev = ~p_GetShortExpVector(product, r); 768 769 assume( comp >= 0 ); 770 771 // looking for an appropriate diviser p = L[k]... 772 #if 1 773 CReducersHash::const_iterator it = m_hash.find(p_GetComp(product, r)); // same module component 774 775 if( it == m_hash.end() ) 776 return NULL; 777 778 const TReducers& reducers = it->second; 779 780 for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ ) 781 { 782 const poly p = (*vit)->m_lt; 783 784 assume( p_GetComp(p, r) == comp ); 785 786 const int k = (*vit)->m_label; 787 788 assume( L->m[k] == p ); 789 790 const unsigned long p_sev = (*vit)->m_sev; 791 792 assume( p_sev == p_GetShortExpVector(p, r) ); 793 #else 794 for( int k = IDELEMS(L)-1; k>= 0; k-- ) 795 { 796 const poly p = L->m[k]; 797 798 if ( p_GetComp(p, r) != comp ) 799 continue; 800 801 const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!! 802 #endif 803 804 if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) ) 805 continue; 806 807 // // ... which divides the product, looking for the _1st_ appropriate one! 808 // if( !p_LmDivisibleByNoComp(p, product, r) ) // included inside p_LmShortDivisibleBy! 809 // continue; 732 810 733 811 … … 758 836 BOOLEAN ok = TRUE; 759 837 838 // TODO: FindReducer in LS !!! there should be no divisors! 760 839 for(int kk = IDELEMS(LS)-1; kk>= 0; kk-- ) 761 840 { … … 842 921 while (spoly != NULL) 843 922 { 844 poly t = FindReducer(spoly, NULL);923 poly t = m_div.FindReducer(spoly, NULL); 845 924 846 925 p_LmDelete(&spoly, r); … … 942 1021 // NOTE: only LT(term4reduction) should be used in the following: 943 1022 poly product = pp_Mult_mm(multiplier, term4reduction, r); 944 s = FindReducer(product, syztermCheck);1023 s = m_div.FindReducer(product, syztermCheck); 945 1024 p_Delete(&product, r); 946 1025 }
Note: See TracChangeset
for help on using the changeset viewer.