Changeset 1d79ec in git
- Timestamp:
- Nov 12, 2017, 11:46:21 AM (6 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 0dc033e870e300d7150670fda5b4719cf753b37e
- Parents:
- 3d0ce76d08bab57556cda4600514c027f7ee3391
- git-author:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2017-11-12 11:46:21+01:00
- git-committer:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2017-12-15 12:17:08+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/syz4.cc
r3d0ce7 r1d79ec 60 60 61 61 typedef std::vector<lt_struct> lts_vector; 62 typedef std::map<long, lts_vector> lts_hash; 63 64 static void initialize_lts_hash(lts_hash &C, const ideal L) 62 63 static void initialize_hash(lts_vector *C, const ideal L) 65 64 { 66 65 const ring R = currRing; … … 74 73 } 75 74 76 #define delete_lts_hash(C) C->clear()77 78 75 static poly find_reducer(const poly multiplier, const poly t, 79 const lts_hash *hash_previous_module) 80 { 81 const ring r = currRing; 82 lts_hash::const_iterator itr 83 = hash_previous_module->find(__p_GetComp(t, r)); 84 if (unlikely(itr == hash_previous_module->end())) { 76 const lts_vector *hash_previous_module) 77 { 78 const ring r = currRing; 79 const lts_vector v = hash_previous_module[__p_GetComp(t, r)]; 80 lts_vector::const_iterator itr_curr = v.begin(); 81 lts_vector::const_iterator itr_end = v.end(); 82 if (unlikely(itr_curr == itr_end)) { 85 83 return NULL; 86 84 } 87 lts_vector::const_iterator itr_curr = (itr->second).begin();88 lts_vector::const_iterator itr_end = (itr->second).end();89 85 const poly q = p_New(r); 90 86 pNext(q) = NULL; … … 111 107 static poly traverse_tail(const poly multiplier, const int comp, 112 108 const ideal previous_module, const std::vector<bool> &variables, 113 const lts_ hash*hash_previous_module);109 const lts_vector *hash_previous_module); 114 110 #else 115 111 static poly compute_image(const poly multiplier, const int comp, 116 112 const ideal previous_module, const std::vector<bool> &variables, 117 const lts_ hash*hash_previous_module);113 const lts_vector *hash_previous_module); 118 114 #define traverse_tail compute_image 119 115 #endif // CACHE … … 121 117 static poly reduce_term(const poly multiplier, const poly term, 122 118 const ideal previous_module, const std::vector<bool> &variables, 123 const lts_ hash*hash_previous_module)119 const lts_vector *hash_previous_module) 124 120 { 125 121 poly s = find_reducer(multiplier, term, hash_previous_module); … … 139 135 static poly compute_image(const poly multiplier, const int comp, 140 136 const ideal previous_module, const std::vector<bool> &variables, 141 const lts_ hash*hash_previous_module)137 const lts_vector *hash_previous_module) 142 138 { 143 139 const poly tail = previous_module->m[comp]->next; … … 219 215 static poly traverse_tail(const poly multiplier, const int comp, 220 216 const ideal previous_module, const std::vector<bool> &variables, 221 const lts_ hash*hash_previous_module)217 const lts_vector *hash_previous_module) 222 218 { 223 219 cache_term *T = &(Cache[comp]); … … 235 231 static poly lift_ext_LT(const poly a, const ideal previous_module, 236 232 const std::vector<bool> &variables, 237 const lts_ hash*hash_previous_module)233 const lts_vector *hash_previous_module) 238 234 { 239 235 const ring R = currRing; … … 462 458 initialize_cache(res[index-1]->ncols); 463 459 #endif // CACHE 464 lts_ hash *hash_previous_module = new lts_hash();465 initialize_ lts_hash(*hash_previous_module, res[index-1]);460 lts_vector *hash_previous_module = new lts_vector[res[index-1]->rank+1]; 461 initialize_hash(hash_previous_module, res[index-1]); 466 462 for (int j = res[index]->ncols-1; j >= 0; j--) { 467 463 res[index]->m[j]->next->next = lift_ext_LT(res[index]->m[j], 468 464 res[index-1], variables, hash_previous_module); 469 465 } 470 delete_lts_hash(hash_previous_module); 471 delete(hash_previous_module); 466 delete[](hash_previous_module); 472 467 #if CACHE 473 468 delete_cache(res[index-1]->ncols);
Note: See TracChangeset
for help on using the changeset viewer.