Skip to content

Commit

Permalink
off by one error
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherkenny committed May 4, 2021
1 parent bad47cc commit 8e2b223
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/constraint_calc_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,11 +971,11 @@ List calc_psipartisan(arma::vec current_dists,

for(int r = 0; r < current_dists.size(); r++){
//current
rcounts(current_dists(r)-1, 0) += rvote(r);
dcounts(current_dists(r)-1, 1) += dvote(r);
rcounts(current_dists(r), 0) += rvote(r);
dcounts(current_dists(r), 1) += dvote(r);
// new
rcounts(new_dists(r)-1, 1) += rvote(r);
dcounts(new_dists(r)-1, 1) += dvote(r);
rcounts(new_dists(r), 1) += rvote(r);
dcounts(new_dists(r), 1) += dvote(r);
}
// Step 2: Compute Wasted Votes
IntegerMatrix rwaste(ndists, 2);
Expand Down

0 comments on commit 8e2b223

Please sign in to comment.