Skip to content

Commit

Permalink
Fixed bad nbr_of_frames calculation due to truncation.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgbarletta committed May 10, 2018
1 parent c3a0144 commit 882d4f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ANAmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ int MD_ANA(const std::string& in_filename, const std::string& in_md_filename,
double poly_vol = 0;
unsigned int frame_cnt = 1;
unsigned int max_atom_cnt = 0;
const unsigned int nbr_of_frames = (md_end - md_start + 1) / md_step;
const auto nbr_of_frames =
ceil((md_end - md_start + 1) / static_cast<float>(md_step));

std::vector<unsigned int> atom_cnt_md(nbr_of_frames);
std::vector<unsigned int> CA_indices, AA_indices, include_CH_atoms;
std::vector<unsigned int> hetatm_atoms;
Expand Down

0 comments on commit 882d4f7

Please sign in to comment.