From 423e06352d4498361ee81d6a23aa2c77dd58d1c8 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 3 Apr 2018 15:05:53 +0000 Subject: Try to fix operator< for std::sort on CentOS git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3332 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: caaeb02c38a8adc8c09321e534f9b73181450acf --- src/common/include/gudhi/writing_persistence_to_file.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/common/include/gudhi/writing_persistence_to_file.h b/src/common/include/gudhi/writing_persistence_to_file.h index 49ccef84..766dd317 100644 --- a/src/common/include/gudhi/writing_persistence_to_file.h +++ b/src/common/include/gudhi/writing_persistence_to_file.h @@ -79,7 +79,7 @@ class Persistence_interval_common { * One intervals is smaller than the other if it has lower persistence. * Note that this operator do not take Arith_element into account when doing comparisions. **/ - inline bool operator<(const Persistence_interval_common& i2) { + bool operator<(const Persistence_interval_common& i2) const { return fabs(this->death_ - this->birth_) < fabs(i2.death_ - i2.birth_); } @@ -101,11 +101,6 @@ class Persistence_interval_common { Coefficient_field arith_element_; }; -template -bool operator<(const Persistence_interval_common& i1, - const Persistence_interval_common& i2) { - return i1.operator<(i2); - } /** * This function write a vector to a stream **/ @@ -116,6 +111,7 @@ void write_persistence_intervals_to_stream(const Persistence_interval_range& int out << interval << "\n"; } } + } #endif // WRITING_PERSISTENCE_TO_FILE_H -- cgit v1.2.3