summaryrefslogtreecommitdiff
path: root/src/Persistence_representations/include/gudhi/Persistence_intervals.h
diff options
context:
space:
mode:
authorVincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com>2019-12-20 16:04:50 +0100
committerGitHub <noreply@github.com>2019-12-20 16:04:50 +0100
commit2842ab896b21e4577198216e814084cfd88d989c (patch)
tree99fb1073da4a589ecd5503e635f6370bafbba374 /src/Persistence_representations/include/gudhi/Persistence_intervals.h
parent0d3675360ce4c23d9fd4c7c157810c31ed06403b (diff)
parent291286815e282c9693f17615f8c46a49f87bf887 (diff)
Merge pull request #164 from VincentRouvreau/failed_tests_on_x86_fix
Fix #118 - protect some bottleneck tests
Diffstat (limited to 'src/Persistence_representations/include/gudhi/Persistence_intervals.h')
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_intervals.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Persistence_representations/include/gudhi/Persistence_intervals.h b/src/Persistence_representations/include/gudhi/Persistence_intervals.h
index e2db4572..ea4220ea 100644
--- a/src/Persistence_representations/include/gudhi/Persistence_intervals.h
+++ b/src/Persistence_representations/include/gudhi/Persistence_intervals.h
@@ -6,6 +6,8 @@
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
+ * - 2019/12 Vincent Rouvreau: Fix #118 - Make histogram_of_lengths and cumulative_histogram_of_lengths
+ * return the exact number_of_bins (was failing on x86)
*/
#ifndef PERSISTENCE_INTERVALS_H_
@@ -335,6 +337,9 @@ std::vector<size_t> Persistence_intervals::histogram_of_lengths(size_t number_of
getchar();
}
}
+ // we want number of bins equals to number_of_bins (some unexpected results on x86)
+ result[number_of_bins-1]+=result[number_of_bins];
+ result.resize(number_of_bins);
if (dbg) {
for (size_t i = 0; i != result.size(); ++i) std::cerr << result[i] << std::endl;