summaryrefslogtreecommitdiff
path: root/src/Nerve_GIC/example
diff options
context:
space:
mode:
authormcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-07-28 14:33:44 +0000
committermcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-07-28 14:33:44 +0000
commit99bff40a1028f8848cdcdc76d8f53ef3b9b9c43d (patch)
treecf324f7ccc7f64744a885df289162f52265ead21 /src/Nerve_GIC/example
parentd1fd9723fc49ee430203166fca71ea20b96f6b7b (diff)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/Nerve_GIC@2598 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 1624f24a6f87ac092e1761c9778741102fb37a3c
Diffstat (limited to 'src/Nerve_GIC/example')
-rw-r--r--src/Nerve_GIC/example/GIC.cpp19
-rw-r--r--src/Nerve_GIC/example/GICvoronoi.cpp15
-rw-r--r--src/Nerve_GIC/example/MapperDeltaCoord.cpp17
-rw-r--r--src/Nerve_GIC/example/MapperDeltaFunc.cpp17
-rw-r--r--src/Nerve_GIC/example/Nerve.cpp21
5 files changed, 37 insertions, 52 deletions
diff --git a/src/Nerve_GIC/example/GIC.cpp b/src/Nerve_GIC/example/GIC.cpp
index aba0927d..6e5c5ca7 100644
--- a/src/Nerve_GIC/example/GIC.cpp
+++ b/src/Nerve_GIC/example/GIC.cpp
@@ -30,7 +30,7 @@ void usage(int nbArgs, char * const progName) {
}
int main(int argc, char **argv) {
- if ((argc != 6) && (argc != 7)) usage(argc, (argv[0] - 1));
+ if ((argc != 6) && (argc != 7)) usage(argc, argv[0]);
using Point = std::vector<float>;
@@ -58,33 +58,30 @@ int main(int argc, char **argv) {
GIC.set_graph_from_rips(threshold, Gudhi::Euclidean_distance());
- GIC.set_resolution_double(resolution); GIC.set_gain(gain);
- GIC.set_cover_from_function(1);
+ GIC.set_resolution_with_interval_length(resolution); GIC.set_gain(gain);
+ GIC.set_cover_from_function();
GIC.find_GIC_simplices();
- GIC.plot_txt();
+ GIC.plot_TXT_for_KeplerMapper();
Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
- std::streambuf* streambufffer = std::cout.rdbuf();
- std::ostream output_stream(streambufffer);
-
// ----------------------------------------------------------------------------
// Display information about the graph induced complex
// ----------------------------------------------------------------------------
if(verb){
- output_stream << "Graph induced complex is of dimension " << stree.dimension() <<
+ std::cout << "Graph induced complex is of dimension " << stree.dimension() <<
" - " << stree.num_simplices() << " simplices - " <<
stree.num_vertices() << " vertices." << std::endl;
- output_stream << "Iterator on graph induced complex simplices" << std::endl;
+ std::cout << "Iterator on graph induced complex simplices" << std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- output_stream << vertex << " ";
+ std::cout << vertex << " ";
}
- output_stream << std::endl;
+ std::cout << std::endl;
}
}
}
diff --git a/src/Nerve_GIC/example/GICvoronoi.cpp b/src/Nerve_GIC/example/GICvoronoi.cpp
index 013d6290..2c4f5acf 100644
--- a/src/Nerve_GIC/example/GICvoronoi.cpp
+++ b/src/Nerve_GIC/example/GICvoronoi.cpp
@@ -30,7 +30,7 @@ void usage(int nbArgs, char * const progName) {
}
int main(int argc, char **argv) {
- if ((argc != 3) && (argc != 4)) usage(argc, (argv[0] - 1));
+ if ((argc != 3) && (argc != 4)) usage(argc, argv[0]);
using Point = std::vector<float>;
@@ -52,7 +52,7 @@ int main(int argc, char **argv) {
GIC.set_color_from_coordinate();
- GIC.set_graph_from_OFF(off_file_name);
+ GIC.set_graph_from_OFF();
GIC.set_cover_from_Voronoi(Gudhi::Euclidean_distance(),m);
@@ -62,24 +62,21 @@ int main(int argc, char **argv) {
Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
- std::streambuf* streambufffer = std::cout.rdbuf();
- std::ostream output_stream(streambufffer);
-
// ----------------------------------------------------------------------------
// Display information about the graph induced complex
// ----------------------------------------------------------------------------
if(verb){
- output_stream << "Graph induced complex is of dimension " << stree.dimension() <<
+ std::cout << "Graph induced complex is of dimension " << stree.dimension() <<
" - " << stree.num_simplices() << " simplices - " <<
stree.num_vertices() << " vertices." << std::endl;
- output_stream << "Iterator on graph induced complex simplices" << std::endl;
+ std::cout << "Iterator on graph induced complex simplices" << std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- output_stream << vertex << " ";
+ std::cout << vertex << " ";
}
- output_stream << std::endl;
+ std::cout << std::endl;
}
}
}
diff --git a/src/Nerve_GIC/example/MapperDeltaCoord.cpp b/src/Nerve_GIC/example/MapperDeltaCoord.cpp
index 9927f762..382649e8 100644
--- a/src/Nerve_GIC/example/MapperDeltaCoord.cpp
+++ b/src/Nerve_GIC/example/MapperDeltaCoord.cpp
@@ -30,7 +30,7 @@ void usage(int nbArgs, char * const progName) {
}
int main(int argc, char **argv) {
- if ((argc != 3) && (argc != 4)) usage(argc, (argv[0] - 1));
+ if ((argc != 3) && (argc != 4)) usage(argc, argv[0]);
using Point = std::vector<float>;
@@ -56,32 +56,29 @@ int main(int argc, char **argv) {
GIC.set_graph_from_automatic_rips(Gudhi::Euclidean_distance());
GIC.set_automatic_resolution_for_GICMAP(); GIC.set_gain();
- GIC.set_cover_from_function(1);
+ GIC.set_cover_from_function();
GIC.find_GICMAP_simplices_with_functional_minimal_cover();
- GIC.plot_pdf();
+ GIC.plot_DOT_for_neato();
Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
- std::streambuf* streambufffer = std::cout.rdbuf();
- std::ostream output_stream(streambufffer);
-
// ------------------------------------------
// Display information about the Mapper Delta
// ------------------------------------------
if(verb){
- output_stream << "Mapper Delta is of dimension " << stree.dimension() <<
+ std::cout << "Mapper Delta is of dimension " << stree.dimension() <<
" - " << stree.num_simplices() << " simplices - " <<
stree.num_vertices() << " vertices." << std::endl;
- output_stream << "Iterator on Mapper Delta simplices" << std::endl;
+ std::cout << "Iterator on Mapper Delta simplices" << std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- output_stream << vertex << " ";
+ std::cout << vertex << " ";
}
- output_stream << std::endl;
+ std::cout << std::endl;
}
}
}
diff --git a/src/Nerve_GIC/example/MapperDeltaFunc.cpp b/src/Nerve_GIC/example/MapperDeltaFunc.cpp
index f3d57d2f..586b733c 100644
--- a/src/Nerve_GIC/example/MapperDeltaFunc.cpp
+++ b/src/Nerve_GIC/example/MapperDeltaFunc.cpp
@@ -30,7 +30,7 @@ void usage(int nbArgs, char * const progName) {
}
int main(int argc, char **argv) {
- if ((argc != 3) && (argc != 4)) usage(argc, (argv[0] - 1));
+ if ((argc != 3) && (argc != 4)) usage(argc, argv[0]);
using Point = std::vector<float>;
@@ -56,32 +56,29 @@ int main(int argc, char **argv) {
GIC.set_graph_from_automatic_rips(Gudhi::Euclidean_distance());
GIC.set_automatic_resolution_for_GICMAP(); GIC.set_gain();
- GIC.set_cover_from_function(1);
+ GIC.set_cover_from_function();
GIC.find_GICMAP_simplices_with_functional_minimal_cover();
- GIC.plot_pdf();
+ GIC.plot_DOT_for_neato();
Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
- std::streambuf* streambufffer = std::cout.rdbuf();
- std::ostream output_stream(streambufffer);
-
// ------------------------------------------
// Display information about the Mapper Delta
// ------------------------------------------
if(verb){
- output_stream << "Mapper Delta is of dimension " << stree.dimension() <<
+ std::cout << "Mapper Delta is of dimension " << stree.dimension() <<
" - " << stree.num_simplices() << " simplices - " <<
stree.num_vertices() << " vertices." << std::endl;
- output_stream << "Iterator on Mapper Delta simplices" << std::endl;
+ std::cout << "Iterator on Mapper Delta simplices" << std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- output_stream << vertex << " ";
+ std::cout << vertex << " ";
}
- output_stream << std::endl;
+ std::cout << std::endl;
}
}
}
diff --git a/src/Nerve_GIC/example/Nerve.cpp b/src/Nerve_GIC/example/Nerve.cpp
index 10c5ba3b..e47982c4 100644
--- a/src/Nerve_GIC/example/Nerve.cpp
+++ b/src/Nerve_GIC/example/Nerve.cpp
@@ -30,7 +30,7 @@ void usage(int nbArgs, char * const progName) {
}
int main(int argc, char **argv) {
- if ((argc != 5) && (argc != 6)) usage(argc, (argv[0] - 1));
+ if ((argc != 5) && (argc != 6)) usage(argc, argv[0]);
using Point = std::vector<float>;
@@ -55,35 +55,32 @@ int main(int argc, char **argv) {
GIC.set_color_from_coordinate(coord);
GIC.set_function_from_coordinate(coord);
- GIC.set_graph_from_OFF(off_file_name);
+ GIC.set_graph_from_OFF();
- GIC.set_resolution_int(resolution); GIC.set_gain(gain);
- GIC.set_cover_from_function(0);
+ GIC.set_resolution_with_interval_number(resolution); GIC.set_gain(gain);
+ GIC.set_cover_from_function();
GIC.find_Nerve_simplices();
- GIC.plot_txt();
+ GIC.plot_TXT_for_KeplerMapper();
Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
- std::streambuf* streambufffer = std::cout.rdbuf();
- std::ostream output_stream(streambufffer);
-
// ----------------------------------------------------------------------------
// Display information about the graph induced complex
// ----------------------------------------------------------------------------
if(verb){
- output_stream << "Nerve is of dimension " << stree.dimension() <<
+ std::cout << "Nerve is of dimension " << stree.dimension() <<
" - " << stree.num_simplices() << " simplices - " <<
stree.num_vertices() << " vertices." << std::endl;
- output_stream << "Iterator on Nerve simplices" << std::endl;
+ std::cout << "Iterator on Nerve simplices" << std::endl;
for (auto f_simplex : stree.filtration_simplex_range()) {
for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
- output_stream << vertex << " ";
+ std::cout << vertex << " ";
}
- output_stream << std::endl;
+ std::cout << std::endl;
}
}
}