Commit 937ad45b authored by Mikaël Salson's avatar Mikaël Salson

BinReadStorage: Allow not to instantiate a list of sequence.

parent e9a7b7c7
......@@ -15,10 +15,13 @@ BinReadStorage::BinReadStorage()
:nb_bins(0), bins(NULL), score_bins(NULL), nb_scores(NULL), total_nb_scores(0), max_score(0),
nb_inserted(0), nb_stored(0), smallest_bin_not_empty(~0) {}
void BinReadStorage::init(size_t nb_bins, size_t max_score, const VirtualReadScore *vrs) {
void BinReadStorage::init(size_t nb_bins, size_t max_score, const VirtualReadScore *vrs, bool no_list) {
this->nb_bins = nb_bins;
this->max_score = max_score;
bins = new list<Sequence>[nb_bins+1];
if (no_list)
bins = NULL;
else
bins = new list<Sequence>[nb_bins+1];
score_bins = new double[nb_bins+1];
nb_scores = new size_t[nb_bins+1];
......
......@@ -75,8 +75,11 @@ public:
* to be max_score. If higher score are met, they are put in the nb_bins+1 bin.
* The class doesn't destruct the VirtualReadScore. It is the responsability of the caller.
* @pre all scores must be >= 0
* @param no_list: don't create a list (useful for storing only stats,
* false by default: lists are created). If the option is set to true, the
* function add() must not be called but only the addScore().
*/
void init(size_t nb_bins, size_t max_score, const VirtualReadScore *vrs);
void init(size_t nb_bins, size_t max_score, const VirtualReadScore *vrs, bool no_list = false);
~BinReadStorage();
......
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