Commit 6c00a4f7 authored by Cyprien Borée's avatar Cyprien Borée

Redistribute bins

parent a36f5250
Pipeline #34492 failed with stages
in 2 minutes and 53 seconds
......@@ -39,9 +39,20 @@ void BinReadStorage::reallocate(){
auto new_bins = new list<Sequence>[nb_bins+1];
auto new_score_bins = new double[nb_bins+1];
auto new_nb_scores = new size_t[nb_bins+1];
new_bins[0] = bins[0];
new_score_bins[0] = score_bins[0];
new_nb_scores[0] = nb_scores[0];
for(auto const& i : bins[0]){
float score = scorer->getScore(i);
size_t bin = scoreToBin(score);
addScore(bin, score);
all_read_lengths += i.sequence.length();
if (nb_stored < getMaxNbReadsStored()) {
new_bins[bin].push_back(i);
nb_stored++;
if (bin < (size_t)smallest_bin_not_empty){
smallest_bin_not_empty = bin;
}
}
}
delete [] bins;
delete [] score_bins;
delete [] nb_scores;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment