Changeset 5582


Ignore:
Timestamp:
Jul 28, 2017, 6:28:27 PM (3 months ago)
Author:
lindanl
Message:

Bug fixed for editd.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/editd/editd.cpp

    r5580 r5582  
    7373    if(matchList.empty()) return;
    7474
    75     //remove the duplicates
    76     bool cleared = true;
    77     while(cleared){
    78         cleared = false;
    79         for (unsigned i=0; i<matchList.size()-1; i++){
    80             if(matchList[i].pos == matchList[i+1].pos && matchList[i].dist == matchList[i+1].dist){
    81                 matchList.erase(matchList.begin() + i);
    82                 cleared = true;
    83             }
    84         }
    85     }
    86 
    8775    //Sort match position
    8876    bool exchanged = true;
     
    9886                matchList[i+1].dist = tmp_dist;
    9987                exchanged = true;
     88            }
     89        }
     90    }
     91
     92    //remove the duplicates
     93    bool cleared = true;
     94    while(cleared){
     95        cleared = false;
     96        for (unsigned i=0; i<matchList.size()-1; i++){
     97            if(matchList[i].pos == matchList[i+1].pos && matchList[i].dist == matchList[i+1].dist){
     98                matchList.erase(matchList.begin() + i);
     99                cleared = true;
    100100            }
    101101        }
     
    164164}
    165165
     166
     167std::string createName(const std::vector<std::string> & patterns) {
     168    std::string name = "";
     169    for(unsigned i=0; i<patterns.size(); i++)
     170        name += patterns[i];
     171    return name;
     172}
     173
    166174class PatternKernel final: public pablo::PabloKernel {
    167175public:
     
    176184
    177185PatternKernel::PatternKernel(const std::unique_ptr<kernel::KernelBuilder> & b, const std::vector<std::string> & patterns)
    178 : PabloKernel(b, std::string(patterns[0]), {{b->getStreamSetTy(4), "pat"}}, {{b->getStreamSetTy(editDistance + 1), "E"}})
    179 , mPatterns(patterns) {
     186: PabloKernel(b, createName(patterns), {{b->getStreamSetTy(4), "pat"}}, {{b->getStreamSetTy(editDistance + 1), "E"}})
     187, mPatterns(patterns) { 
    180188}
    181189
Note: See TracChangeset for help on using the changeset viewer.