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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.