summaryrefslogtreecommitdiff
path: root/src/Nerve_GIC/example
diff options
context:
space:
mode:
authormcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-07-03 18:25:45 +0000
committermcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-07-03 18:25:45 +0000
commit9f799012e531d4ea7cd85b815911d6271031c0e9 (patch)
treeb47a60226c075ce82c8e2732fa6066b30872bc7f /src/Nerve_GIC/example
parent2e0fed6817558aa0e887eb228642f7ebdd302d4c (diff)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/Nerve_GIC@2579 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 697cb9e3146f0b068c6df4e74d972958e793d94b
Diffstat (limited to 'src/Nerve_GIC/example')
-rw-r--r--src/Nerve_GIC/example/GIC.cpp10
-rw-r--r--src/Nerve_GIC/example/GIC.txt89
-rw-r--r--src/Nerve_GIC/example/GICvoronoi.cpp10
-rw-r--r--src/Nerve_GIC/example/GICvoronoi.txt563
-rw-r--r--src/Nerve_GIC/example/MapperDeltaCoord.cpp12
-rw-r--r--src/Nerve_GIC/example/MapperDeltaCoord.txt143
-rw-r--r--src/Nerve_GIC/example/MapperDeltaFunc.cpp10
-rw-r--r--src/Nerve_GIC/example/MapperDeltaFunc.dot10
-rw-r--r--src/Nerve_GIC/example/Nerve.cpp8
9 files changed, 30 insertions, 825 deletions
diff --git a/src/Nerve_GIC/example/GIC.cpp b/src/Nerve_GIC/example/GIC.cpp
index 0f50f712..aba0927d 100644
--- a/src/Nerve_GIC/example/GIC.cpp
+++ b/src/Nerve_GIC/example/GIC.cpp
@@ -32,6 +32,8 @@ void usage(int nbArgs, char * const progName) {
int main(int argc, char **argv) {
if ((argc != 6) && (argc != 7)) usage(argc, (argv[0] - 1));
+ using Point = std::vector<float>;
+
std::string off_file_name(argv[1]);
double threshold = atof(argv[2]);
int coord = atoi(argv[3]);
@@ -43,8 +45,8 @@ int main(int argc, char **argv) {
// Init of a graph induced complex from an OFF file
// ----------------------------------------------------------------------------
- Gudhi::graph_induced_complex::Graph_induced_complex GIC;
- GIC.set_verbose(verb);
+ Gudhi::graph_induced_complex::Graph_induced_complex<Point> GIC;
+ GIC.set_verbose(verb); GIC.set_mask();
bool check = GIC.read_point_cloud(off_file_name);
@@ -54,7 +56,7 @@ int main(int argc, char **argv) {
GIC.set_color_from_coordinate(coord);
GIC.set_function_from_coordinate(coord);
- GIC.set_graph_from_rips(threshold);
+ GIC.set_graph_from_rips(threshold, Gudhi::Euclidean_distance());
GIC.set_resolution_double(resolution); GIC.set_gain(gain);
GIC.set_cover_from_function(1);
@@ -63,7 +65,7 @@ int main(int argc, char **argv) {
GIC.plot_txt();
- Simplex_tree stree; GIC.create_complex(stree);
+ Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
std::streambuf* streambufffer = std::cout.rdbuf();
std::ostream output_stream(streambufffer);
diff --git a/src/Nerve_GIC/example/GIC.txt b/src/Nerve_GIC/example/GIC.txt
deleted file mode 100644
index 79f61e92..00000000
--- a/src/Nerve_GIC/example/GIC.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-Graph induced complex is of dimension 1 - 87 simplices - 44 vertices.
-Iterator on graph induced complex simplices
-0
-1
-2
-2 1
-3
-3 0
-4
-4 2
-5
-5 3
-6
-6 5
-7
-7 4
-8
-8 7
-9
-9 6
-10
-10 8
-11
-11 9
-12
-12 11
-13
-13 10
-14
-14 12
-15
-15 13
-16
-16 14
-17
-17 15
-18
-18 16
-18 17
-19
-19 18
-20
-21
-22
-22 20
-23
-23 19
-24
-24 21
-25
-25 23
-26
-26 24
-27
-27 22
-28
-28 25
-29
-29 26
-30
-30 27
-31
-31 28
-32
-32 30
-33
-33 29
-34
-34 32
-35
-35 31
-36
-36 33
-37
-37 34
-37 35
-37 36
-38
-38 37
-39
-39 38
-40
-40 39
-41
-41 40
-42
-42 41
-43
-43 42
diff --git a/src/Nerve_GIC/example/GICvoronoi.cpp b/src/Nerve_GIC/example/GICvoronoi.cpp
index 8061c42d..013d6290 100644
--- a/src/Nerve_GIC/example/GICvoronoi.cpp
+++ b/src/Nerve_GIC/example/GICvoronoi.cpp
@@ -32,6 +32,8 @@ void usage(int nbArgs, char * const progName) {
int main(int argc, char **argv) {
if ((argc != 3) && (argc != 4)) usage(argc, (argv[0] - 1));
+ using Point = std::vector<float>;
+
std::string off_file_name(argv[1]);
int m = atoi(argv[2]);
bool verb = 0; if(argc == 4) verb = 1;
@@ -40,8 +42,8 @@ int main(int argc, char **argv) {
// Init of a graph induced complex from an OFF file
// ----------------------------------------------------------------------------
- Gudhi::graph_induced_complex::Graph_induced_complex GIC;
- GIC.set_verbose(verb);
+ Gudhi::graph_induced_complex::Graph_induced_complex<Point> GIC;
+ GIC.set_verbose(verb); GIC.set_mask();
bool check = GIC.read_point_cloud(off_file_name);
@@ -52,13 +54,13 @@ int main(int argc, char **argv) {
GIC.set_graph_from_OFF(off_file_name);
- GIC.set_cover_from_Voronoi(m);
+ GIC.set_cover_from_Voronoi(Gudhi::Euclidean_distance(),m);
GIC.find_GIC_simplices();
GIC.plot_OFF();
- Simplex_tree stree; GIC.create_complex(stree);
+ Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
std::streambuf* streambufffer = std::cout.rdbuf();
std::ostream output_stream(streambufffer);
diff --git a/src/Nerve_GIC/example/GICvoronoi.txt b/src/Nerve_GIC/example/GICvoronoi.txt
deleted file mode 100644
index 34517933..00000000
--- a/src/Nerve_GIC/example/GICvoronoi.txt
+++ /dev/null
@@ -1,563 +0,0 @@
-Graph induced complex is of dimension 2 - 561 simplices - 100 vertices.
-Iterator on graph induced complex simplices
-0
-1
-2
-3
-3 0
-4
-4 1
-5
-6
-7
-8
-9
-9 1
-10
-11
-11 1
-11 9
-11 9 1
-12
-12 1
-12 11
-12 11 1
-13
-13 2
-14
-14 11
-15
-15 4
-16
-16 2
-16 15
-17
-17 3
-18
-19
-19 8
-20
-20 11
-20 12
-20 12 11
-21
-22
-22 12
-23
-23 22
-24
-24 19
-25
-25 0
-25 3
-25 18
-26
-26 1
-26 4
-26 4 1
-27
-27 26
-28
-28 27
-29
-30
-31
-31 30
-32
-32 30
-32 31
-32 31 30
-33
-33 1
-33 4
-33 4 1
-33 24
-33 29
-34
-34 5
-34 21
-35
-35 2
-35 16
-35 16 2
-36
-36 17
-37
-37 24
-37 29
-38
-38 3
-38 25
-38 25 3
-39
-39 8
-39 25
-39 38
-39 38 25
-40
-40 7
-40 19
-40 24
-40 24 19
-40 37
-40 37 24
-40 39
-41
-41 5
-41 34
-41 34 5
-42
-42 21
-42 41
-43
-43 5
-43 41
-43 41 5
-43 42
-43 42 41
-44
-44 14
-44 27
-45
-45 21
-46
-46 8
-46 19
-46 19 8
-46 39
-46 39 8
-47
-47 0
-47 3
-47 3 0
-47 19
-47 38
-47 38 3
-47 39
-47 39 38
-47 40
-47 40 19
-47 40 39
-47 46
-47 46 19
-47 46 39
-48
-48 37
-48 45
-49
-49 10
-49 37
-49 48
-49 48 37
-50
-50 10
-50 37
-50 45
-50 49
-50 49 10
-50 49 37
-51
-51 45
-51 48
-51 48 45
-51 50
-51 50 45
-52
-52 27
-52 30
-52 31
-52 31 30
-53
-53 10
-53 45
-53 48
-53 48 45
-53 50
-53 50 10
-54
-54 6
-55
-55 54
-56
-56 44
-57
-57 13
-58
-58 24
-58 29
-58 33
-58 33 24
-58 33 29
-58 37
-58 37 24
-58 37 29
-59
-59 7
-59 29
-60
-60 1
-60 12
-60 12 1
-60 22
-60 22 12
-60 26
-60 26 1
-60 27
-60 27 26
-60 44
-60 44 27
-60 56
-60 56 44
-61
-61 5
-61 21
-61 34
-61 34 5
-61 34 21
-61 42
-61 42 21
-61 43
-61 43 5
-61 43 42
-62
-62 6
-62 54
-62 54 6
-62 55
-62 55 54
-63
-63 6
-63 62
-63 62 6
-64
-64 10
-64 48
-64 49
-64 49 10
-64 49 48
-64 53
-64 53 10
-64 53 48
-65
-65 21
-65 45
-65 45 21
-65 50
-65 50 45
-65 53
-65 53 50
-66
-66 14
-66 44
-66 44 14
-66 56
-66 56 44
-67
-67 13
-67 57
-67 57 13
-68
-68 2
-68 13
-68 13 2
-68 35
-68 35 2
-69
-69 21
-69 34
-69 34 21
-69 41
-69 41 34
-69 42
-69 42 21
-69 42 41
-69 65
-69 65 21
-70
-70 11
-70 14
-70 14 11
-70 20
-70 20 11
-70 56
-70 66
-70 66 14
-70 66 56
-71
-71 6
-71 54
-71 54 6
-71 55
-71 55 54
-71 62
-71 62 55
-71 63
-71 63 6
-71 63 62
-72
-72 37
-72 48
-72 48 37
-72 51
-72 51 48
-73
-73 3
-73 17
-73 17 3
-73 36
-73 36 17
-74
-74 7
-74 8
-74 39
-74 39 8
-74 40
-74 40 7
-74 40 39
-74 52
-74 59
-74 59 7
-75
-75 4
-75 15
-75 15 4
-76
-76 15
-76 75
-76 75 15
-77
-77 4
-77 75
-77 75 4
-78
-78 4
-78 26
-78 26 4
-78 27
-78 27 26
-78 28
-78 28 27
-78 75
-78 77
-78 77 4
-78 77 75
-79
-79 9
-79 11
-79 11 9
-79 14
-79 14 11
-79 27
-79 30
-79 32
-79 32 30
-79 44
-79 44 14
-79 44 27
-79 52
-79 52 27
-79 52 30
-80
-80 0
-80 25
-80 25 0
-80 39
-80 39 25
-80 47
-80 47 0
-80 47 39
-81
-81 2
-81 4
-81 15
-81 15 4
-81 16
-81 16 2
-81 16 15
-81 27
-81 29
-81 33
-81 33 4
-81 33 29
-81 52
-81 52 27
-81 59
-81 59 29
-81 74
-81 74 52
-81 74 59
-81 75
-81 78
-81 78 27
-81 78 75
-82
-82 2
-82 75
-82 81
-82 81 2
-82 81 75
-83
-83 0
-83 3
-83 3 0
-83 25
-83 25 0
-83 73
-83 73 3
-84
-84 1
-84 8
-84 19
-84 19 8
-84 24
-84 24 19
-84 33
-84 33 1
-84 33 24
-84 74
-84 74 8
-85
-85 17
-85 36
-85 36 17
-85 73
-85 73 36
-86
-86 6
-86 63
-86 63 6
-87
-87 3
-87 17
-87 17 3
-87 18
-87 25
-87 25 3
-87 25 18
-88
-88 17
-88 18
-88 85
-88 85 17
-88 87
-88 87 17
-88 87 18
-89
-89 63
-89 86
-89 86 63
-90
-90 7
-90 37
-90 40
-90 40 7
-90 40 37
-90 59
-90 59 7
-91
-91 21
-91 45
-91 45 21
-91 53
-91 53 45
-91 65
-91 65 21
-91 65 53
-92
-92 9
-92 55
-92 71
-92 71 55
-93
-93 2
-93 15
-93 16
-93 16 15
-93 35
-93 35 2
-93 35 16
-93 75
-93 76
-93 76 15
-93 76 75
-93 82
-93 82 2
-93 82 75
-94
-94 1
-94 9
-94 9 1
-94 31
-94 32
-94 32 31
-94 52
-94 52 31
-94 55
-94 74
-94 74 52
-94 79
-94 79 9
-94 79 32
-94 84
-94 84 1
-94 84 74
-94 92
-94 92 9
-94 92 55
-95
-95 18
-95 25
-95 25 18
-95 83
-95 83 25
-95 85
-95 88
-95 88 18
-95 88 85
-96
-96 63
-96 86
-96 86 63
-96 89
-96 89 63
-96 89 86
-97
-97 73
-97 83
-97 83 73
-97 85
-97 85 73
-97 95
-97 95 83
-97 95 85
-98
-98 12
-98 20
-98 20 12
-98 22
-98 22 12
-98 23
-98 23 22
-98 56
-98 60
-98 60 22
-98 60 56
-98 70
-98 70 20
-98 70 56
-99
-99 29
-99 37
-99 37 29
-99 50
-99 50 37
-99 51
-99 51 50
-99 59
-99 59 29
-99 72
-99 72 37
-99 72 51
-99 90
-99 90 37
-99 90 59
diff --git a/src/Nerve_GIC/example/MapperDeltaCoord.cpp b/src/Nerve_GIC/example/MapperDeltaCoord.cpp
index 84a25bad..9927f762 100644
--- a/src/Nerve_GIC/example/MapperDeltaCoord.cpp
+++ b/src/Nerve_GIC/example/MapperDeltaCoord.cpp
@@ -32,6 +32,8 @@ void usage(int nbArgs, char * const progName) {
int main(int argc, char **argv) {
if ((argc != 3) && (argc != 4)) usage(argc, (argv[0] - 1));
+ using Point = std::vector<float>;
+
std::string off_file_name(argv[1]);
int coord = atoi(argv[2]);
bool verb = 0; if(argc == 4) verb = 1;
@@ -40,8 +42,8 @@ int main(int argc, char **argv) {
// Init of a Mapper Delta from an OFF file
// ---------------------------------------
- Gudhi::graph_induced_complex::Graph_induced_complex GIC;
- GIC.set_verbose(verb);
+ Gudhi::graph_induced_complex::Graph_induced_complex<Point> GIC;
+ GIC.set_verbose(verb); GIC.set_mask(); GIC.set_subsampling();
bool check = GIC.read_point_cloud(off_file_name);
@@ -51,16 +53,16 @@ int main(int argc, char **argv) {
GIC.set_color_from_coordinate(coord);
GIC.set_function_from_coordinate(coord);
- GIC.set_graph_from_automatic_rips();
+ 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.find_GICMAP_simplices_with_functional_minimal_cover();
- GIC.plot_txt();
+ GIC.plot_pdf();
- Simplex_tree stree; GIC.create_complex(stree);
+ Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
std::streambuf* streambufffer = std::cout.rdbuf();
std::ostream output_stream(streambufffer);
diff --git a/src/Nerve_GIC/example/MapperDeltaCoord.txt b/src/Nerve_GIC/example/MapperDeltaCoord.txt
deleted file mode 100644
index faf832c7..00000000
--- a/src/Nerve_GIC/example/MapperDeltaCoord.txt
+++ /dev/null
@@ -1,143 +0,0 @@
-Mapper Delta is of dimension 1 - 141 simplices - 71 vertices.
-Iterator on Mapper Delta simplices
-0
-1
-2
-2 1
-3
-3 0
-4
-4 2
-5
-5 3
-6
-6 4
-7
-7 5
-8
-8 6
-9
-9 7
-10
-10 9
-11
-11 8
-12
-12 11
-13
-13 10
-14
-14 12
-15
-15 13
-16
-16 14
-17
-17 15
-18
-18 17
-19
-19 16
-20
-20 18
-21
-21 19
-22
-22 20
-23
-23 21
-24
-24 22
-25
-25 23
-26
-26 24
-27
-27 25
-28
-28 26
-28 27
-29
-29 28
-30
-30 29
-31
-32
-33
-33 30
-34
-34 31
-35
-35 32
-36
-36 34
-37
-37 33
-38
-38 35
-39
-39 37
-40
-40 38
-41
-41 36
-42
-42 39
-43
-43 40
-44
-44 41
-45
-45 42
-46
-46 44
-47
-47 43
-48
-48 45
-49
-49 46
-50
-50 47
-51
-51 48
-52
-52 49
-53
-53 50
-54
-54 51
-55
-55 52
-56
-56 53
-57
-57 54
-58
-58 55
-59
-59 56
-60
-60 57
-60 58
-60 59
-61
-61 60
-62
-62 61
-63
-63 62
-64
-64 63
-65
-65 64
-66
-66 65
-67
-67 66
-68
-68 67
-69
-69 68
-70
-70 69
diff --git a/src/Nerve_GIC/example/MapperDeltaFunc.cpp b/src/Nerve_GIC/example/MapperDeltaFunc.cpp
index fa95ca58..f3d57d2f 100644
--- a/src/Nerve_GIC/example/MapperDeltaFunc.cpp
+++ b/src/Nerve_GIC/example/MapperDeltaFunc.cpp
@@ -32,6 +32,8 @@ void usage(int nbArgs, char * const progName) {
int main(int argc, char **argv) {
if ((argc != 3) && (argc != 4)) usage(argc, (argv[0] - 1));
+ using Point = std::vector<float>;
+
std::string off_file_name(argv[1]);
std::string func_file_name = argv[2];
bool verb = 0; if(argc == 4) verb = 1;
@@ -40,8 +42,8 @@ int main(int argc, char **argv) {
// Init of a Mapper Delta from an OFF file
// ---------------------------------------
- Gudhi::graph_induced_complex::Graph_induced_complex GIC;
- GIC.set_verbose(verb);
+ Gudhi::graph_induced_complex::Graph_induced_complex<Point> GIC;
+ GIC.set_verbose(verb); GIC.set_mask(); GIC.set_subsampling();
bool check = GIC.read_point_cloud(off_file_name);
@@ -51,7 +53,7 @@ int main(int argc, char **argv) {
GIC.set_color_from_file(func_file_name);
GIC.set_function_from_file(func_file_name);
- GIC.set_graph_from_automatic_rips();
+ GIC.set_graph_from_automatic_rips(Gudhi::Euclidean_distance());
GIC.set_automatic_resolution_for_GICMAP(); GIC.set_gain();
GIC.set_cover_from_function(1);
@@ -60,7 +62,7 @@ int main(int argc, char **argv) {
GIC.plot_pdf();
- Simplex_tree stree; GIC.create_complex(stree);
+ Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
std::streambuf* streambufffer = std::cout.rdbuf();
std::ostream output_stream(streambufffer);
diff --git a/src/Nerve_GIC/example/MapperDeltaFunc.dot b/src/Nerve_GIC/example/MapperDeltaFunc.dot
deleted file mode 100644
index beafa7f1..00000000
--- a/src/Nerve_GIC/example/MapperDeltaFunc.dot
+++ /dev/null
@@ -1,10 +0,0 @@
-graph Mapper {
-0[shape=circle fontcolor=black color=black label="0:26" style=filled fillcolor="0, 1, 1"]
-1[shape=circle fontcolor=black color=black label="1:4" style=filled fillcolor="0.240095, 1, 1"]
-2[shape=circle fontcolor=black color=black label="2:11" style=filled fillcolor="0.209621, 1, 1"]
-3[shape=circle fontcolor=black color=black label="3:42" style=filled fillcolor="0.6, 1, 1"]
- 0 -- 1 [weight=15];
- 0 -- 2 [weight=15];
- 1 -- 3 [weight=15];
- 2 -- 3 [weight=15];
-} \ No newline at end of file
diff --git a/src/Nerve_GIC/example/Nerve.cpp b/src/Nerve_GIC/example/Nerve.cpp
index 8f8037d4..10c5ba3b 100644
--- a/src/Nerve_GIC/example/Nerve.cpp
+++ b/src/Nerve_GIC/example/Nerve.cpp
@@ -32,6 +32,8 @@ void usage(int nbArgs, char * const progName) {
int main(int argc, char **argv) {
if ((argc != 5) && (argc != 6)) usage(argc, (argv[0] - 1));
+ using Point = std::vector<float>;
+
std::string off_file_name(argv[1]);
int coord = atoi(argv[2]);
int resolution = atoi(argv[3]);
@@ -42,8 +44,8 @@ int main(int argc, char **argv) {
// Init of a Nerve from an OFF file
// --------------------------------
- Gudhi::graph_induced_complex::Graph_induced_complex GIC;
- GIC.set_verbose(verb);
+ Gudhi::graph_induced_complex::Graph_induced_complex<Point> GIC;
+ GIC.set_verbose(verb); GIC.set_mask();
bool check = GIC.read_point_cloud(off_file_name);
@@ -62,7 +64,7 @@ int main(int argc, char **argv) {
GIC.plot_txt();
- Simplex_tree stree; GIC.create_complex(stree);
+ Gudhi::graph_induced_complex::Simplex_tree stree; GIC.create_complex(stree);
std::streambuf* streambufffer = std::cout.rdbuf();
std::ostream output_stream(streambufffer);