Skip to content

Commit

Permalink
Maximum memory usage reduced, sequence is deleted when profile is cre…
Browse files Browse the repository at this point in the history
…ated.
  • Loading branch information
cesarpomar committed May 25, 2022
1 parent f7d117a commit e9e4632
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void Alignment::readAlignment() {
}

void Alignment::clearAlignmentSeqs() {
seqs.clear();
seqs.resize(0);
}

void Alignment::clearAlignment() {
Expand Down
2 changes: 1 addition & 1 deletion src/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace veryfasttree {
const std::string codesStringNT = "ACGT";

const std::string name = "VeryFastTree";
const std::string version = "3.1.0";
const std::string version = "3.1.1";
const std::string compileFlags =
"(OpenMP"
#ifdef __AVX__
Expand Down
5 changes: 4 additions & 1 deletion src/NeighbourJoining.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ AbsNeighbourJoining(void)::printNJInternal(std::ostream &out, bool useLen) {
}

AbsNeighbourJoining(void)::seqsToProfiles() {
profiles.resize(maxnodes, Profile(nPos, constraintSeqs.size()));
profiles.reserve(maxnodes);
profiles.resize(seqs.size(), Profile(nPos, constraintSeqs.size()));
uint8_t charToCode[256];
int64_t counts[256] = {}; /*Array of zeros*/

Expand Down Expand Up @@ -266,6 +267,7 @@ AbsNeighbourJoining(void)::seqsToProfiles() {
profile.weights[j] = 1.0;
}
}
seqs[i] = std::string();
if (!constraintSeqs.empty()) {
auto &constraintSeq = constraintSeqs[i];
for (int64_t j = 0; j < (int64_t) constraintSeq.size(); j++) {
Expand All @@ -288,6 +290,7 @@ AbsNeighbourJoining(void)::seqsToProfiles() {
}
}
}
profiles.resize(maxnodes, Profile(nPos, constraintSeqs.size()));

int64_t totCount = 0;
for (int i = 0; i < 256; i++) {
Expand Down

0 comments on commit e9e4632

Please sign in to comment.