From 9b4c31ef855bf5c98718675a9caab52e8d8514e7 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 5 Aug 2016 09:58:11 +0000 Subject: Fix the 3 billions of simplices limit Add some comment and documentation about the new limit (4 billions) Rephrase third party library installation documentation git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/3billions_simplices_fix@1420 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 95b20677e455b61578da74aabbd3764b4a27816d --- src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Persistent_cohomology/include/gudhi') diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h index a7d1e463..d3da812e 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h @@ -41,6 +41,7 @@ #include #include #include +#include // for std::out_of_range namespace Gudhi { @@ -89,6 +90,7 @@ class Persistent_cohomology { * * @param[in] cpx Complex for which the persistent homology is computed. * cpx is a model of FilteredComplex + * @exception std::out_of_range In case the number of simplices is more than Simplex_key type numeric limit. */ explicit Persistent_cohomology(Complex_ds& cpx) : cpx_(&cpx), @@ -106,6 +108,9 @@ class Persistent_cohomology { interval_length_policy(&cpx, 0), column_pool_(), // memory pools for the CAM cell_pool_() { + if (cpx_->num_simplices() > std::numeric_limits::max()) { + throw std::out_of_range ("The number of simplices is more than Simplex_key type numeric limit."); + } Simplex_key idx_fil = 0; for (auto sh : cpx_->filtration_simplex_range()) { cpx_->assign_key(sh, idx_fil); -- cgit v1.2.3