Changeset 386517 in git
- Timestamp:
- Sep 28, 2016, 1:05:17 PM (8 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- 57619d3c1fbf5786d4b190e43ff6ca3595ad0082
- Parents:
- 636703c69aef54d3171f4ee6279f0511f0d433cf
- git-author:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2016-09-28 13:05:17+02:00
- git-committer:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2017-12-15 12:17:07+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/syz4.cc
r636703 r386517 18 18 poly lt; 19 19 unsigned long sev; 20 unsigned int label;21 } CLeadingTerm_struct;22 23 typedef std::vector<const CLeadingTerm_struct*> TReducers_test;24 typedef std::map<long, TReducers_test> CReducersHash_test;25 26 static void initialize( CReducersHash_test&C, const ideal L)20 unsigned int comp; 21 } lt_struct; 22 23 typedef std::vector<const lt_struct*> lts_vector; 24 typedef std::map<long, lts_vector> lts_hash; 25 26 static void initialize(lts_hash &C, const ideal L) 27 27 { 28 28 if( L != NULL ) … … 34 34 if( a != NULL ) 35 35 { 36 CLeadingTerm_struct *CLT 37 = (CLeadingTerm_struct*)omalloc(sizeof(CLeadingTerm_struct)); 36 lt_struct *CLT = (lt_struct*)omalloc(sizeof(lt_struct)); 38 37 CLT->lt = a; 39 38 CLT->sev = p_GetShortExpVector(a, R); 40 CLT-> label= k;39 CLT->comp = k; 41 40 C[p_GetComp(a, R)].push_back( CLT ); 42 41 } … … 45 44 } 46 45 47 static void deleteCRH( CReducersHash_test*C)48 { 49 for ( CReducersHash_test::iterator it = C->begin(); it != C->end(); it++) {50 TReducers_test& v = it->second;51 for ( TReducers_test::const_iterator vit = v.begin(); vit != v.end();52 vit++) {53 omfree(const_cast< CLeadingTerm_struct*>(*vit));46 static void deleteCRH(lts_hash *C) 47 { 48 for (lts_hash::iterator it = C->begin(); it != C->end(); it++) { 49 lts_vector& v = it->second; 50 for (lts_vector::const_iterator vit = v.begin(); vit != v.end(); 51 vit++) { 52 omfree(const_cast<lt_struct*>(*vit)); 54 53 } 55 54 v.erase(v.begin(), v.end()); … … 58 57 } 59 58 60 bool IsDivisible(const CReducersHash_test *C, const poly product) 61 { 62 CReducersHash_test::const_iterator m_itr 63 = C->find(p_GetComp(product, currRing)); 59 bool IsDivisible(const lts_hash *C, const poly product) 60 { 61 lts_hash::const_iterator m_itr = C->find(p_GetComp(product, currRing)); 64 62 if (m_itr == C->end()) { 65 63 return false; 66 64 } 67 TReducers_test::const_iterator m_current = (m_itr->second).begin();68 TReducers_test::const_iterator m_finish = (m_itr->second).end();65 lts_vector::const_iterator m_current = (m_itr->second).begin(); 66 lts_vector::const_iterator m_finish = (m_itr->second).end(); 69 67 const unsigned long m_not_sev = ~p_GetShortExpVector(product, currRing); 70 68 for ( ; m_current != m_finish; ++m_current) { … … 79 77 static poly TraverseTail_test(poly multiplier, const int tail, 80 78 const ideal previous_module, const std::vector<bool> &variables, 81 const CReducersHash_test *m_div, const CReducersHash_test*m_checker);79 const lts_hash *m_div, const lts_hash *m_checker); 82 80 static poly ComputeImage_test(poly multiplier, const int tail, 83 81 const ideal previous_module, const std::vector<bool> &variables, 84 const CReducersHash_test *m_div, const CReducersHash_test*m_checker);82 const lts_hash *m_div, const lts_hash *m_checker); 85 83 static inline poly ReduceTerm_test(poly multiplier, poly term4reduction, 86 84 poly syztermCheck, const ideal previous_module, 87 const std::vector<bool> &variables, const CReducersHash_test*m_div,88 const CReducersHash_test*m_checker);85 const std::vector<bool> &variables, const lts_hash *m_div, 86 const lts_hash *m_checker); 89 87 static poly leadmonom_test(const poly p, const ring r, const bool bSetZeroComp = true); 90 88 … … 122 120 123 121 static poly TraverseNF_test(const poly a, const ideal previous_module, 124 const std::vector<bool> &variables, const CReducersHash_test*m_div,125 const CReducersHash_test*m_checker)122 const std::vector<bool> &variables, const lts_hash *m_div, 123 const lts_hash *m_checker) 126 124 { 127 125 const ring R = currRing; … … 201 199 static poly TraverseTail_test(poly multiplier, const int tail, 202 200 const ideal previous_module, const std::vector<bool> &variables, 203 const CReducersHash_test *m_div, const CReducersHash_test*m_checker)201 const lts_hash *m_div, const lts_hash *m_checker) 204 202 { 205 203 const ring& r = currRing; … … 264 262 static poly ComputeImage_test(poly multiplier, const int t, 265 263 const ideal previous_module, const std::vector<bool> &variables, 266 const CReducersHash_test *m_div, const CReducersHash_test*m_checker)264 const lts_hash *m_div, const lts_hash *m_checker) 267 265 { 268 266 const poly tail = previous_module->m[t]->next; … … 341 339 342 340 poly FindReducer(const poly multiplier, const poly t, const poly syzterm, 343 const CReducersHash_test *syz_checker, const CReducersHash_test*m_div)341 const lts_hash *syz_checker, const lts_hash *m_div) 344 342 { 345 343 const ring r = currRing; 346 CReducersHash_test::const_iterator m_itr 347 = m_div->find(p_GetComp(t, currRing)); 344 lts_hash::const_iterator m_itr = m_div->find(p_GetComp(t, currRing)); 348 345 if (m_itr == m_div->end()) { 349 346 return NULL; 350 347 } 351 TReducers_test::const_iterator m_current = (m_itr->second).begin();352 TReducers_test::const_iterator m_finish = (m_itr->second).end();348 lts_vector::const_iterator m_current = (m_itr->second).begin(); 349 lts_vector::const_iterator m_finish = (m_itr->second).end(); 353 350 if (m_current == m_finish) { 354 351 return NULL; … … 363 360 } 364 361 const poly p = (*m_current)->lt; 365 const int k = (*m_current)-> label;362 const int k = (*m_current)->comp; 366 363 p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t 367 364 p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k])) … … 386 383 static inline poly ReduceTerm_test(poly multiplier, poly term4reduction, 387 384 poly syztermCheck, const ideal previous_module, 388 const std::vector<bool> &variables, const CReducersHash_test*m_div,389 const CReducersHash_test*m_checker)385 const std::vector<bool> &variables, const lts_hash *m_div, 386 const lts_hash *m_checker) 390 387 { 391 388 const ring r = currRing; … … 580 577 581 578 static void computeLiftings(const resolvente res, const int index, 582 std::vector<bool> &variables, CReducersHash_test*&hash_previous_module)579 std::vector<bool> &variables, lts_hash *&hash_previous_module) 583 580 { 584 581 update_variables(variables, res[index-1]); 585 CReducersHash_test *hash_current_module = new CReducersHash_test();582 lts_hash *hash_current_module = new lts_hash(); 586 583 initialize(*hash_current_module, res[index]); 587 584 poly p; … … 611 608 std::vector<bool> variables; 612 609 variables.resize(currRing->N, true); 613 CReducersHash_test *hash_previous_module = new CReducersHash_test();610 lts_hash *hash_previous_module = new lts_hash(); 614 611 initialize(*hash_previous_module, res[index-1]); 615 612 while (!idIs0(res[index])) {
Note: See TracChangeset
for help on using the changeset viewer.