From ef4f1b9b2a6c30777696763198cd4b5494c8ab4d Mon Sep 17 00:00:00 2001 From: glisse Date: Sat, 25 Apr 2015 09:18:04 +0000 Subject: Let destructors do the cleanup. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@573 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a8e9e64a5317ab368832facdf8e34739cfe9b473 --- src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h | 3 +-- .../include/gudhi/Persistent_cohomology/Field_Zp.h | 3 --- .../include/gudhi/Persistent_cohomology/Multi_field.h | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) (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 4d274f53..3606754a 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h @@ -649,8 +649,7 @@ class Persistent_cohomology { Cell * tmp_cell_ptr = &(*tmp_it); target.col_.erase(tmp_it); // removed from column - coeff_field_.clear_coefficient(tmp_cell_ptr->coefficient_); - cell_pool_.free(tmp_cell_ptr); // delete from memory + cell_pool_.destroy(tmp_cell_ptr); // delete from memory } else { ++target_it; ++other_it; diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h index 5d0c9f9f..2349cdac 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h @@ -76,9 +76,6 @@ class Field_Zp { return plus_times_equal(0, y, (Element)w); } - void clear_coefficient(Element x) { - } - Element plus_equal(const Element& x, const Element& y) { return plus_times_equal(x, y, (Element)1); } diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h index 60ab7f41..c6fd5282 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h @@ -103,10 +103,6 @@ class Multi_field { } } - void clear_coefficient(Element & x) { - mpz_clear(x.get_mpz_t()); - } - /** \brief Returns the additive idendity \f$0_{\Bbbk}\f$ of the field.*/ const Element& additive_identity() const { return add_id_all; -- cgit v1.2.3