summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker/example
diff options
context:
space:
mode:
Diffstat (limited to 'src/Skeleton_blocker/example')
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp29
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp7
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_link.cpp2
3 files changed, 18 insertions, 20 deletions
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
index 2738c01c..5935a56d 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
@@ -35,24 +35,23 @@ using namespace skbl;
typedef Skeleton_blocker_complex<Skeleton_blocker_simple_traits> Complex;
typedef Complex::Vertex_handle Vertex_handle;
-typedef Complex::Simplex_handle Simplex_handle;
-typedef Complex::Simplex_handle Simplex;
+typedef Complex::Simplex Simplex;
int main(int argc, char *argv[]) {
- std::vector<Simplex_handle> simplices;
+ std::vector<Simplex> simplices;
// add 4 triangles of a tetrahedron 0123
- simplices.push_back(Simplex_handle(Vertex_handle(0), Vertex_handle(1), Vertex_handle(2)));
- simplices.push_back(Simplex_handle(Vertex_handle(1), Vertex_handle(2), Vertex_handle(3)));
- simplices.push_back(Simplex_handle(Vertex_handle(3), Vertex_handle(0), Vertex_handle(2)));
- simplices.push_back(Simplex_handle(Vertex_handle(3), Vertex_handle(0), Vertex_handle(1)));
+ simplices.push_back(Simplex(Vertex_handle(0), Vertex_handle(1), Vertex_handle(2)));
+ simplices.push_back(Simplex(Vertex_handle(1), Vertex_handle(2), Vertex_handle(3)));
+ simplices.push_back(Simplex(Vertex_handle(3), Vertex_handle(0), Vertex_handle(2)));
+ simplices.push_back(Simplex(Vertex_handle(3), Vertex_handle(0), Vertex_handle(1)));
// get complex from top faces
Complex complex(make_complex_from_top_faces<Complex>(simplices.begin(), simplices.end()));
std::cout << "Simplices:" << std::endl;
- for (const Simplex & s : complex.simplex_range())
+ for (const Simplex & s : complex.complex_simplex_range())
std::cout << s << " ";
std::cout << std::endl;
@@ -61,16 +60,16 @@ int main(int argc, char *argv[]) {
// now build a complex from its full list of simplices
simplices.clear();
- simplices.push_back(Simplex_handle(Vertex_handle(0)));
- simplices.push_back(Simplex_handle(Vertex_handle(1)));
- simplices.push_back(Simplex_handle(Vertex_handle(2)));
- simplices.push_back(Simplex_handle(Vertex_handle(0), Vertex_handle(1)));
- simplices.push_back(Simplex_handle(Vertex_handle(1), Vertex_handle(2)));
- simplices.push_back(Simplex_handle(Vertex_handle(2), Vertex_handle(0)));
+ simplices.push_back(Simplex(Vertex_handle(0)));
+ simplices.push_back(Simplex(Vertex_handle(1)));
+ simplices.push_back(Simplex(Vertex_handle(2)));
+ simplices.push_back(Simplex(Vertex_handle(0), Vertex_handle(1)));
+ simplices.push_back(Simplex(Vertex_handle(1), Vertex_handle(2)));
+ simplices.push_back(Simplex(Vertex_handle(2), Vertex_handle(0)));
complex = Complex(simplices.begin(), simplices.end());
std::cout << "Simplices:" << std::endl;
- for (const Simplex & s : complex.simplex_range())
+ for (const Simplex & s : complex.complex_simplex_range())
std::cout << s << " ";
std::cout << std::endl;
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
index 69557694..41b5ee00 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
@@ -37,7 +37,7 @@ using namespace skbl;
typedef Skeleton_blocker_complex<Skeleton_blocker_simple_traits> Complex;
typedef Complex::Vertex_handle Vertex_handle;
-typedef Complex::Simplex_handle Simplex;
+typedef Complex::Simplex Simplex;
Complex build_complete_complex(int n) {
// build a full complex with n vertices and 2^n-1 simplices
@@ -46,8 +46,7 @@ Complex build_complete_complex(int n) {
complex.add_vertex();
for (int i = 0; i < n; i++)
for (int j = 0; j < i; j++)
- // note that add_edge, add the edge and all its cofaces
- complex.add_edge(Vertex_handle(i), Vertex_handle(j));
+ complex.add_edge_without_blockers(Vertex_handle(i), Vertex_handle(j));
return complex;
}
@@ -77,7 +76,7 @@ int main(int argc, char *argv[]) {
// we use a reference to a simplex instead of a copy
// value here because a simplex is a set of integers
// and copying it cost time
- for (const Simplex & s : complex.simplex_range()) {
+ for (const Simplex & s : complex.complex_simplex_range()) {
++num_simplices;
if (s.dimension() % 2 == 0)
euler += 1;
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
index 002cbc49..5c717938 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
@@ -35,7 +35,7 @@ using namespace skbl;
typedef Skeleton_blocker_complex<Skeleton_blocker_simple_traits> Complex;
typedef Complex::Vertex_handle Vertex_handle;
typedef Complex::Root_vertex_handle Root_vertex_handle;
-typedef Complex::Simplex_handle Simplex;
+typedef Complex::Simplex Simplex;
int main(int argc, char *argv[]) {
// build a full complex with 4 vertices and 2^4-1 simplices