Changeset 1d79ec in git


Ignore:
Timestamp:
Nov 12, 2017, 11:46:21 AM (6 years ago)
Author:
Andreas Steenpass <steenpass@…>
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
Message:
chg: replace lts_hash by lts_vector[]
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/syz4.cc

    r3d0ce7 r1d79ec  
    6060
    6161typedef 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
     63static void initialize_hash(lts_vector *C, const ideal L)
    6564{
    6665    const ring R = currRing;
     
    7473}
    7574
    76 #define delete_lts_hash(C) C->clear()
    77 
    7875static 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)) {
    8583        return NULL;
    8684    }
    87     lts_vector::const_iterator itr_curr = (itr->second).begin();
    88     lts_vector::const_iterator itr_end = (itr->second).end();
    8985    const poly q = p_New(r);
    9086    pNext(q) = NULL;
     
    111107static poly traverse_tail(const poly multiplier, const int comp,
    112108        const ideal previous_module, const std::vector<bool> &variables,
    113         const lts_hash *hash_previous_module);
     109        const lts_vector *hash_previous_module);
    114110#else
    115111static poly compute_image(const poly multiplier, const int comp,
    116112        const ideal previous_module, const std::vector<bool> &variables,
    117         const lts_hash *hash_previous_module);
     113        const lts_vector *hash_previous_module);
    118114#define traverse_tail compute_image
    119115#endif   // CACHE
     
    121117static poly reduce_term(const poly multiplier, const poly term,
    122118        const ideal previous_module, const std::vector<bool> &variables,
    123         const lts_hash *hash_previous_module)
     119        const lts_vector *hash_previous_module)
    124120{
    125121    poly s = find_reducer(multiplier, term, hash_previous_module);
     
    139135static poly compute_image(const poly multiplier, const int comp,
    140136        const ideal previous_module, const std::vector<bool> &variables,
    141         const lts_hash *hash_previous_module)
     137        const lts_vector *hash_previous_module)
    142138{
    143139    const poly tail = previous_module->m[comp]->next;
     
    219215static poly traverse_tail(const poly multiplier, const int comp,
    220216        const ideal previous_module, const std::vector<bool> &variables,
    221         const lts_hash *hash_previous_module)
     217        const lts_vector *hash_previous_module)
    222218{
    223219    cache_term *T = &(Cache[comp]);
     
    235231static poly lift_ext_LT(const poly a, const ideal previous_module,
    236232        const std::vector<bool> &variables,
    237         const lts_hash *hash_previous_module)
     233        const lts_vector *hash_previous_module)
    238234{
    239235    const ring R = currRing;
     
    462458    initialize_cache(res[index-1]->ncols);
    463459#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]);
    466462    for (int j = res[index]->ncols-1; j >= 0; j--) {
    467463        res[index]->m[j]->next->next = lift_ext_LT(res[index]->m[j],
    468464                res[index-1], variables, hash_previous_module);
    469465    }
    470     delete_lts_hash(hash_previous_module);
    471     delete(hash_previous_module);
     466    delete[](hash_previous_module);
    472467#if CACHE
    473468    delete_cache(res[index-1]->ncols);
Note: See TracChangeset for help on using the changeset viewer.