Changeset daa4e5 in git for dyn_modules/syzextra/syzextra.cc
- Timestamp:
- Nov 21, 2012, 5:43:11 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- da9d522d025bd8d8edf9686d84441705b53f89bd
- Parents:
- 68fedf3295a64608c08e75ff1fba1dc2a5c9ef32
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-21 17:43:11+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
r68fedf rdaa4e5 32 32 #include <polys/simpleideals.h> 33 33 34 #include <polys/kbuckets.h> // for kBucket* 35 #include <polys/nc/summator.h> // for CPolynomialSummator 36 #include <polys/operations/p_Mult_q.h> // for MIN_LENGTH_BUCKET 37 34 38 #include <kernel/kstd1.h> 35 39 #include <kernel/polys.h> … … 682 686 683 687 poly aa = leadmonom(a, R); assume( aa != NULL); // :( 688 689 684 690 poly t = TraverseTail(aa, r); 685 691 … … 903 909 904 910 assume( c >= 0 && c < IDELEMS(T) ); 905 911 kBucket_pt bucket = kBucketCreate(r); kbTest(bucket); 912 913 // kBucketInit(bucket, NULL, 0); // not needed!? 914 906 915 poly p = leadmonom(syz_lead, r); // :( 907 poly spoly = pp_Mult_qq(p, T->m[c], r); 916 // poly spoly = pp_Mult_qq(p, T->m[c], r); 917 kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], pLength(T->m[c])); // TODO: store length of tails separately!? 918 kbTest(bucket); 908 919 p_Delete(&p, r); 909 910 920 911 921 c = p_GetComp(syz_2, r) - 1; … … 913 923 914 924 p = leadmonom(syz_2, r); // :( 915 spoly = p_Add_q(spoly, pp_Mult_qq(p, T->m[c], r), r); 925 // spoly = p_Add_q(spoly, pp_Mult_qq(p, T->m[c], r), r); 926 kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], pLength(T->m[c])); 927 kbTest(bucket); 916 928 p_Delete(&p, r); 917 929 918 poly tail = syz_2; // TODO: use bucket!? 919 920 while (spoly != NULL) 921 { 922 poly t = m_div.FindReducer(spoly, NULL, m_checker); 923 924 p_LmDelete(&spoly, r); 930 // TODO: use bucket!? 931 const bool bUsePolynomial = TEST_OPT_NOT_BUCKETS; // || (pLength(spoly) < MIN_LENGTH_BUCKET); 932 CPolynomialSummator tail(r, bUsePolynomial); 933 tail.AddAndDelete(syz_2, 1); 934 935 936 kbTest(bucket); 937 for( poly spoly = kBucketExtractLm(bucket); spoly != NULL; p_LmDelete(&spoly, r), spoly = kBucketExtractLm(bucket)) 938 { 939 kbTest(bucket); 940 poly t = m_div.FindReducer(spoly, NULL, m_checker); 925 941 926 942 if( t != NULL ) … … 931 947 assume( c >= 0 && c < IDELEMS(T) ); 932 948 933 spoly = p_Add_q(spoly, pp_Mult_qq(p, T->m[c], r), r); 949 kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], pLength(T->m[c])); 950 // spoly = p_Add_q(spoly, pp_Mult_qq(p, T->m[c], r), r); 934 951 935 952 p_Delete(&p, r); 936 953 937 tail = p_Add_q(tail, t, r); 938 } 939 } 940 954 tail.AddAndDelete(t, 1); 955 } // otherwise discard that leading term altogether! 956 kbTest(bucket); 957 } 958 959 // now bucket must be empty! 960 kbTest(bucket); 961 assume( kBucketClear(bucket) == NULL ); 962 kBucketDestroy(&bucket); // TODO: reuse the bucket!!! 963 941 964 return tail; 942 965 } … … 970 993 assume( T != NULL ); 971 994 972 poly s = NULL;973 995 974 996 if( (!__TAILREDSYZ__) || m_lcm.Check(multiplier) ) 997 { 998 const bool bUsePolynomial = TEST_OPT_NOT_BUCKETS; // || (pLength(tail) < MIN_LENGTH_BUCKET); 999 CPolynomialSummator sum(r, bUsePolynomial); 1000 // poly s = NULL; 975 1001 for(poly p = tail; p != NULL; p = pNext(p)) // iterate over the tail 976 s = p_Add_q(s, ReduceTerm(multiplier, p, NULL), r); 977 978 return s; 1002 sum += ReduceTerm(multiplier, p, NULL); 1003 return sum; 1004 } 1005 1006 return NULL; 1007 979 1008 } 980 1009
Note: See TracChangeset
for help on using the changeset viewer.