Changeset 821 for cpp/frams/genetics/fB


Ignore:
Timestamp:
10/10/18 01:13:05 (5 years ago)
Author:
Maciej Komosinski
Message:

Performance and stability improvements in fB, fH, and fL; improved parsing and math evaluations in fL

Location:
cpp/frams/genetics/fB
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fB/fB_conv.cpp

    r802 r821  
    163163                                fHgenotype.getNextToken(fHpos, line, '\n');
    164164                                map->add(ranges[t][q].begin, ranges[t][q].end, lastpos, fHpos - 1);
     165                                lastpos = fHpos;
    165166                        }
    166167                }
  • cpp/frams/genetics/fB/fB_oper.cpp

    r802 r821  
    3939}
    4040
    41 bool Geno_fB::hasStick(SString genotype)
     41bool Geno_fB::hasStick(const SString &genotype)
    4242{
    4343        for (int i = 0; i < fB_GenoHelpers::geneCount(genotype); i++)
     
    194194}
    195195
    196 SString Geno_fB::detokenizeSequence(std::list<SString> tokenlist)
     196SString Geno_fB::detokenizeSequence(std::list<SString> *tokenlist)
    197197{
    198198        SString res = "";
    199         for (std::list<SString>::iterator it = tokenlist.begin(); it != tokenlist.end(); it++)
     199        for (std::list<SString>::iterator it = tokenlist->begin(); it != tokenlist->end(); it++)
    200200        {
    201201                res += (*it);
     
    204204}
    205205
    206 std::list<SString> Geno_fB::tokenizeSequence(SString genotype)
     206std::list<SString> Geno_fB::tokenizeSequence(const SString &genotype)
    207207{
    208208        std::list<SString> res;
     
    278278                        chg = (double)def.len() / line.len();
    279279                }
    280                 line = detokenizeSequence(tokenized);
     280                line = detokenizeSequence(&tokenized);
    281281                break;
    282282        }
     
    297297                        tokenized.insert(it, res);
    298298                        chg = (double)classdef.len() / line.len();
    299                         line = detokenizeSequence(tokenized);
     299                        line = detokenizeSequence(&tokenized);
    300300                        break;
    301301                }
     
    312312                letter.directWrite()[0] = 'a' + randomN(26);
    313313                tokenized.insert(it, letter);
    314                 line = detokenizeSequence(tokenized);
     314                line = detokenizeSequence(&tokenized);
    315315                break;
    316316        }
     
    323323                std::advance(it, rndid);
    324324                tokenized.erase(it);
    325                 line = detokenizeSequence(tokenized);
     325                line = detokenizeSequence(&tokenized);
    326326                break;
    327327        }
     
    363363//              SString result = line.substr(0, cuts[0]) + second +
    364364//                      line.substr(cuts[1], cuts[2] - cuts[1]) + first + line.substr(cuts[3]);
    365                 line = detokenizeSequence(res);
     365                line = detokenizeSequence(&res);
    366366                chg = (float)(cuts[3] - cuts[2] + cuts[1] - cuts[0]) / line.len();
    367367                break;
  • cpp/frams/genetics/fB/fB_oper.h

    r797 r821  
    3030{
    3131private:
    32         bool hasStick(SString genotype);
    33         SString detokenizeSequence(std::list<SString> tokenlist);
    34         std::list<SString> tokenizeSequence(SString genotype);
     32        bool hasStick(const SString &genotype);
     33        SString detokenizeSequence(std::list<SString> *tokenlist);
     34        std::list<SString> tokenizeSequence(const SString &genotype);
    3535
    3636public:
Note: See TracChangeset for help on using the changeset viewer.