From 882d4f7c9cf9876819c0b031d479cdf3af47674f Mon Sep 17 00:00:00 2001 From: pbarletta Date: Thu, 10 May 2018 11:46:02 -0300 Subject: [PATCH] Fixed bad nbr_of_frames calculation due to truncation. --- src/ANAmd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ANAmd.cpp b/src/ANAmd.cpp index 978dddf..e280b6c 100755 --- a/src/ANAmd.cpp +++ b/src/ANAmd.cpp @@ -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(md_step)); + std::vector atom_cnt_md(nbr_of_frames); std::vector CA_indices, AA_indices, include_CH_atoms; std::vector hetatm_atoms;