Skip to content

Commit

Permalink
Simplify code to add constant to vector in buildEmission.
Browse files Browse the repository at this point in the history
  • Loading branch information
bredelings committed Mar 29, 2021
1 parent c158811 commit 0c3e670
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/updateHap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,11 @@ void UpdateSingleHap::calcExpectedWsaf( vector <double> & expectedWsaf, vector <


void UpdateSingleHap::buildEmission( double missCopyProb ) {
vector <double> noMissProb (this->nLoci_, log(1.0 - missCopyProb));
vector <double> t1omu = vecSum(llk0_, noMissProb); // t1 one minus u
vector <double> t2omu = vecSum(llk1_, noMissProb); // t2 one minus u

vector <double> t1omu = vecSum(llk0_, log(1.0 - missCopyProb)); // t1 one minus u
vector <double> t2omu = vecSum(llk1_, log(1.0 - missCopyProb)); // t2 one minus u

vector <double> missProb (this->nLoci_, log(missCopyProb));
vector <double> t1u = vecSum(llk0_, missProb);
vector <double> t2u = vecSum(llk1_, missProb);
vector <double> t1u = vecSum(llk0_, log(missCopyProb));
vector <double> t2u = vecSum(llk1_, log(missCopyProb));

assert(emission_.size() == 0 );
for ( size_t i = 0; i < this->nLoci_; i++) {
Expand Down

0 comments on commit 0c3e670

Please sign in to comment.