From a6b6f91bfd5a86ee88297b27f18c2bc7d38f6db4 Mon Sep 17 00:00:00 2001 From: cjamin Date: Wed, 14 Jun 2017 07:45:09 +0000 Subject: Remove birth<=death check (should be done by the caller if necessary) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/read_persistence_from_file@2544 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ce50159f4bf779a2a42d357cf1c2aa290feaf9b9 --- src/common/include/gudhi/reader_utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common/include') diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h index 35af09bd..8df20dcc 100644 --- a/src/common/include/gudhi/reader_utils.h +++ b/src/common/include/gudhi/reader_utils.h @@ -305,6 +305,7 @@ Reads a file containing persistence intervals. Each line might contain 2, 3 or 4 values: [[field] dimension] birth death The output iterator `out` is used this way: `*out++ = std::make_tuple(dim, birth, death);` where `dim` is an `int`, `birth` a `double`, and `death` a `double`. +Note: the function does not check that birth <= death. **/ template void read_persistence_intervals_and_dimension(std::string const& filename, OutputIterator out) { @@ -326,7 +327,6 @@ void read_persistence_intervals_and_dimension(std::string const& filename, Outpu if (n >= 2) { //int field = (n == 4 ? static_cast(numbers[0]) : -1); int dim = (n >= 3 ? static_cast(numbers[n - 3]) : -1); - GUDHI_CHECK(numbers[n - 2] <= numbers[n - 1], "Error: birth > death."); *out++ = std::make_tuple(dim, numbers[n - 2], numbers[n - 1]); } } @@ -338,6 +338,7 @@ Reads a file containing persistence intervals. Each line might contain 2, 3 or 4 values: [[field] dimension] birth death The return value is an `std::map>>` where `dim` is an `int`, `birth` a `double`, and `death` a `double`. +Note: the function does not check that birth <= death. **/ std::map>> read_persistence_intervals_grouped_by_dimension(std::string const& filename) { @@ -357,6 +358,7 @@ If `only_this_dim` is >= 0, only the lines where dimension = `only_this_dim` (or where dimension is not specified) are returned. The return value is an `std::vector>` where `dim` is an `int`, `birth` a `double`, and `death` a `double`. +Note: the function does not check that birth <= death. **/ std::vector> read_persistence_intervals_in_dimension(std::string const& filename, int only_this_dim = -1) { -- cgit v1.2.3