diff options
author | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-09-28 16:41:20 +0000 |
---|---|---|
committer | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-09-28 16:41:20 +0000 |
commit | 69fa48ea8bf9fd9e49363ab405d3e55306be848b (patch) | |
tree | ffb76069fb3993fcce59d61117d03954f5c1e974 | |
parent | 468f9f1fcf5a818d1615b3102f6324f67a0a825c (diff) |
Release CAM cells.
There are a lot of intrusive containers in there, and I believe that most could be replaced with regular containers.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@800 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 7246d7db0511ac6bffee2f645c006416a986629d
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bea06e2..047079bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ if(MSVC) # Turn off some VC++ warnings SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wsign-compare") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wno-sign-compare") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O0") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") endif() @@ -76,7 +76,7 @@ else() add_subdirectory(src/Bottleneck/test) # GudhUI - add_subdirectory(src/GudhUI) + #add_subdirectory(src/GudhUI) # data points generator add_subdirectory(data/points/generator) diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h index 05f70c39..efe20151 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h @@ -266,13 +266,10 @@ class Persistent_cohomology { } ~Persistent_cohomology() { -// Clean the remaining columns in the matrix. - for (auto & cam_ref : cam_) { - cam_ref.col_.clear(); - } -// Clean the transversal lists + // Clean the transversal lists for (auto & transverse_ref : transverse_idx_) { - transverse_ref.second.row_->clear(); + // Release all the cells + transverse_ref.second.row_->clear_and_dispose([&](Cell*p){cell_pool_.destroy(p);}); delete transverse_ref.second.row_; } } @@ -600,6 +597,8 @@ class Persistent_cohomology { Simplex_key key_tmp = dsets_.find_set(curr_col->class_key_); ds_repr_[key_tmp] = &(*(result_insert_cam.first)); result_insert_cam.first->class_key_ = key_tmp; + // intrusive containers don't own their elements, we have to release them manually + curr_col->col_.clear_and_dispose([&](Cell*p){cell_pool_.destroy(p);}); column_pool_.destroy(curr_col); // delete curr_col; } } |