summaryrefslogtreecommitdiff
path: root/src/Toplex_map
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-10-16 14:06:53 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-10-16 14:06:53 +0000
commit418180d74ea25cfc70a272ab7e883d93ecb31e93 (patch)
tree5344546add0836922cc270fd77b7da0344c2e094 /src/Toplex_map
parentc71dce7fe646cd4ca4da5f385cb0d97535e4d941 (diff)
Rename Lazy_Toplex_map accordingly to code conventions
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@3957 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 7e73d088dbc458f42219e6f7a50baf98d8db65ed
Diffstat (limited to 'src/Toplex_map')
-rw-r--r--src/Toplex_map/benchmark/CMakeLists.txt2
-rw-r--r--src/Toplex_map/benchmark/benchmark_tm.cpp (renamed from src/Toplex_map/benchmark/chrono.cpp)4
-rw-r--r--src/Toplex_map/example/simple_toplex_map.cpp4
-rw-r--r--src/Toplex_map/include/gudhi/Lazy_toplex_map.h (renamed from src/Toplex_map/include/gudhi/Lazy_Toplex_map.h)22
-rw-r--r--src/Toplex_map/test/lazy_toplex_map_unit_test.cpp6
5 files changed, 19 insertions, 19 deletions
diff --git a/src/Toplex_map/benchmark/CMakeLists.txt b/src/Toplex_map/benchmark/CMakeLists.txt
index c2f216bc..2d58a156 100644
--- a/src/Toplex_map/benchmark/CMakeLists.txt
+++ b/src/Toplex_map/benchmark/CMakeLists.txt
@@ -1,3 +1,3 @@
project(Toplex_map_benchmark)
-add_executable(toplex_map_chrono chrono.cpp)
+add_executable(Toplex_map_benchmark benchmark_tm.cpp)
diff --git a/src/Toplex_map/benchmark/chrono.cpp b/src/Toplex_map/benchmark/benchmark_tm.cpp
index e6172c61..5f13288c 100644
--- a/src/Toplex_map/benchmark/chrono.cpp
+++ b/src/Toplex_map/benchmark/benchmark_tm.cpp
@@ -4,7 +4,7 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Toplex_map.h>
-#include <gudhi/Lazy_Toplex_map.h>
+#include <gudhi/Lazy_toplex_map.h>
using namespace Gudhi;
@@ -119,7 +119,7 @@ int main(){
std::cout << "T Map \t \t";
chrono<Toplex_map>(n,d);
std::cout << "Lazy \t \t";
- chrono<Lazy_Toplex_map>(n,d);
+ chrono<Lazy_toplex_map>(n,d);
if(d<=15){
std::cout << "ST \t \t";
chrono<ST_wrapper>(n,d);
diff --git a/src/Toplex_map/example/simple_toplex_map.cpp b/src/Toplex_map/example/simple_toplex_map.cpp
index 0d80f94e..912d79a0 100644
--- a/src/Toplex_map/example/simple_toplex_map.cpp
+++ b/src/Toplex_map/example/simple_toplex_map.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2017
+ * Copyright (C) 2018
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,12 +20,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <gudhi/Lazy_Toplex_map.h>
#include <gudhi/Toplex_map.h>
#include <iostream>
#include <utility> // for pair
#include <vector>
+#include <cassert>
int main(int argc, char * const argv[]) {
using Simplex = Gudhi::Toplex_map::Simplex;
diff --git a/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h b/src/Toplex_map/include/gudhi/Lazy_toplex_map.h
index 5461c0a3..8cc5610a 100644
--- a/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h
+++ b/src/Toplex_map/include/gudhi/Lazy_toplex_map.h
@@ -13,7 +13,7 @@ namespace Gudhi {
* The lazy version is not always up to date as it requires clean operation in order to be.
*
* \ingroup toplex_map */
-class Lazy_Toplex_map {
+class Lazy_toplex_map {
public:
/** Vertex is the type of vertices. */
@@ -93,7 +93,7 @@ private:
};
template <typename Input_vertex_range>
-void Lazy_Toplex_map::insert_independent_simplex(const Input_vertex_range &vertex_range){
+void Lazy_toplex_map::insert_independent_simplex(const Input_vertex_range &vertex_range){
for(const Vertex& v : vertex_range)
if(!gamma0_lbounds.count(v)) gamma0_lbounds.emplace(v,1);
else gamma0_lbounds[v]++;
@@ -102,7 +102,7 @@ void Lazy_Toplex_map::insert_independent_simplex(const Input_vertex_range &verte
}
template <typename Input_vertex_range>
-bool Lazy_Toplex_map::insert_simplex(const Input_vertex_range &vertex_range){
+bool Lazy_toplex_map::insert_simplex(const Input_vertex_range &vertex_range){
Simplex sigma(vertex_range.begin(),vertex_range.end());
empty_toplex = (sigma.size()==0); //vérifier la gestion de empty face
Simplex_ptr sptr = std::make_shared<Simplex>(sigma);
@@ -124,7 +124,7 @@ bool Lazy_Toplex_map::insert_simplex(const Input_vertex_range &vertex_range){
}
template <typename Input_vertex_range>
-void Lazy_Toplex_map::remove_simplex(const Input_vertex_range &vertex_range){
+void Lazy_toplex_map::remove_simplex(const Input_vertex_range &vertex_range){
if(vertex_range.begin()==vertex_range.end()){
t0.clear();
gamma0_lbounds.clear();
@@ -146,7 +146,7 @@ void Lazy_Toplex_map::remove_simplex(const Input_vertex_range &vertex_range){
}
template <typename Input_vertex_range>
-bool Lazy_Toplex_map::membership(const Input_vertex_range &vertex_range){
+bool Lazy_toplex_map::membership(const Input_vertex_range &vertex_range){
if(t0.size()==0 && !empty_toplex) return false; //empty complex
if(vertex_range.begin()==vertex_range.end()) return true; //empty query simplex
Vertex v = best_index(vertex_range);
@@ -157,7 +157,7 @@ bool Lazy_Toplex_map::membership(const Input_vertex_range &vertex_range){
}
template <typename Input_vertex_range>
-bool Lazy_Toplex_map::all_facets_inside(const Input_vertex_range &vertex_range){
+bool Lazy_toplex_map::all_facets_inside(const Input_vertex_range &vertex_range){
Simplex sigma(vertex_range.begin(),vertex_range.end());
Vertex v = best_index(sigma);
if(!t0.count(v)) return false;
@@ -173,7 +173,7 @@ bool Lazy_Toplex_map::all_facets_inside(const Input_vertex_range &vertex_range){
}
/* Returns the remaining vertex */
-Lazy_Toplex_map::Vertex Lazy_Toplex_map::contraction(const Vertex x, const Vertex y){
+Lazy_toplex_map::Vertex Lazy_toplex_map::contraction(const Vertex x, const Vertex y){
if(!t0.count(x)) return y;
if(!t0.count(y)) return x;
Vertex k, d;
@@ -195,7 +195,7 @@ Lazy_Toplex_map::Vertex Lazy_Toplex_map::contraction(const Vertex x, const Verte
/* No facets insert_simplexed */
template <typename Input_vertex_range>
-inline void Lazy_Toplex_map::erase_max(const Input_vertex_range &vertex_range){
+inline void Lazy_toplex_map::erase_max(const Input_vertex_range &vertex_range){
Simplex sigma(vertex_range.begin(),vertex_range.end());
empty_toplex = false;
Simplex_ptr sptr = std::make_shared<Simplex>(sigma);
@@ -210,7 +210,7 @@ inline void Lazy_Toplex_map::erase_max(const Input_vertex_range &vertex_range){
}
template <typename Input_vertex_range>
-Lazy_Toplex_map::Vertex Lazy_Toplex_map::best_index(const Input_vertex_range &vertex_range) {
+Lazy_toplex_map::Vertex Lazy_toplex_map::best_index(const Input_vertex_range &vertex_range) {
Simplex tau(vertex_range.begin(),vertex_range.end());
std::size_t min = std::numeric_limits<size_t>::max(); Vertex arg_min = -1;
for(const Vertex& v : tau)
@@ -222,11 +222,11 @@ Lazy_Toplex_map::Vertex Lazy_Toplex_map::best_index(const Input_vertex_range &ve
return arg_min;
}
-std::size_t Lazy_Toplex_map::get_gamma0_lbound(const Vertex v) const{
+std::size_t Lazy_toplex_map::get_gamma0_lbound(const Vertex v) const{
return gamma0_lbounds.count(v) ? gamma0_lbounds.at(v) : 0;
}
-void Lazy_Toplex_map::clean(const Vertex v){
+void Lazy_toplex_map::clean(const Vertex v){
Toplex_map toplices;
std::unordered_map<int, std::vector<Simplex>> dsorted_simplices;
std::size_t max_dim = 0;
diff --git a/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp b/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp
index 77d464ae..5d71c295 100644
--- a/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp
+++ b/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp
@@ -1,6 +1,6 @@
#include <iostream>
#include <vector>
-#include <gudhi/Lazy_Toplex_map.h>
+#include <gudhi/Lazy_toplex_map.h>
#define BOOST_TEST_DYN_LINK
@@ -8,9 +8,9 @@
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(toplex_map) {
- using Vertex = Gudhi::Lazy_Toplex_map::Vertex;
+ using Vertex = Gudhi::Lazy_toplex_map::Vertex;
- Gudhi::Lazy_Toplex_map tm;
+ Gudhi::Lazy_toplex_map tm;
std::cout << "insert_simplex {1, 2, 3, 4}" << std::endl;
std::vector<Vertex> sigma1 = {1, 2, 3, 4};
tm.insert_simplex(sigma1);