summaryrefslogtreecommitdiff
path: root/src/Collapse
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-04-11 10:02:27 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-04-11 10:02:27 +0200
commit23ea38b9c879088c58e02ea4cf5aa5799e8d00b0 (patch)
tree415992276a120fc5f3519d33c84b386aafce8796 /src/Collapse
parentb5bb9fd2a129ab9c429a0c7c67ca4442e6e7b1b0 (diff)
Proper copyrights and doc for utils
Diffstat (limited to 'src/Collapse')
-rw-r--r--src/Collapse/include/gudhi/Flag_complex_sparse_matrix.h1
-rw-r--r--src/Collapse/utilities/collapse.md63
-rw-r--r--src/Collapse/utilities/distance_matrix_edge_collapse_rips_persistence.cpp10
-rw-r--r--src/Collapse/utilities/point_cloud_edge_collapse_rips_persistence.cpp10
4 files changed, 84 insertions, 0 deletions
diff --git a/src/Collapse/include/gudhi/Flag_complex_sparse_matrix.h b/src/Collapse/include/gudhi/Flag_complex_sparse_matrix.h
index edf3f415..09237500 100644
--- a/src/Collapse/include/gudhi/Flag_complex_sparse_matrix.h
+++ b/src/Collapse/include/gudhi/Flag_complex_sparse_matrix.h
@@ -5,6 +5,7 @@
* Copyright (C) 2018 Inria
*
* Modification(s):
+ * - 2020/03 Vincent Rouvreau: integration to the gudhi library
* - YYYY/MM Author: Description of the modification
*/
diff --git a/src/Collapse/utilities/collapse.md b/src/Collapse/utilities/collapse.md
new file mode 100644
index 00000000..9ca5077a
--- /dev/null
+++ b/src/Collapse/utilities/collapse.md
@@ -0,0 +1,63 @@
+---
+layout: page
+title: "Collapse"
+meta_title: "Edge collapse"
+teaser: ""
+permalink: /collapse/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
+
+
+## point_cloud_edge_collapse_rips_persistence ##
+This program computes the one-skeleton graph defined on a set of input points, using Euclidean distance, and collapse edges.
+This program finally computes persistent homology with coefficient field *Z/pZ* of the Rips complex built on top of these collapse edges.
+The output diagram contains one bar per line, written with the convention:
+
+`p dim birth death`
+
+where `dim` is the dimension of the homological feature, `birth` and `death` are respectively the birth and death of the feature, and `p` is the characteristic of the field *Z/pZ* used for homology coefficients (`p` must be a prime number).
+
+**Usage**
+
+`point_cloud_edge_collapse_rips_persistence [options] <OFF input file>`
+
+**Allowed options**
+
+* `-h [ --help ]` Produce help message
+* `-o [ --output-file ]` Name of file in which the persistence diagram is written. Default print in standard output.
+* `-r [ --max-edge-length ]` (default = inf) Maximal length of an edge for the Rips complex construction.
+* `-d [ --cpx-dimension ]` (default = 1) Maximal dimension of the Rips complex we want to compute.
+* `-p [ --field-charac ]` (default = 11) Characteristic p of the coefficient field Z/pZ for computing homology.
+* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals.
+
+Beware: this program may use a lot of RAM and take a lot of time if `max-edge-length` is set to a large value.
+
+**Example 1 with Z/2Z coefficients**
+
+`point_cloud_edge_collapse_rips_persistence ../../data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 2`
+
+**Example 2 with Z/3Z coefficients**
+
+`point_cloud_edge_collapse_rips_persistence ../../data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 3`
+
+
+## distance_matrix_edge_collapse_rips_persistence ##
+
+Same as `point_cloud_edge_collapse_rips_persistence` but taking a distance matrix as input.
+
+**Usage**
+
+`distance_matrix_edge_collapse_rips_persistence [options] <CSV input file>`
+
+where
+`<CSV input file>` is the path to the file containing a distance matrix. Can be square or lower triangular matrix. Separator is ';'.
+The code do not check if it is dealing with a distance matrix. It is the user responsibility to provide a valid input.
+Please refer to data/distance_matrix/lower_triangular_distance_matrix.csv for an example of a file.
+
+**Example**
+
+`distance_matrix_edge_collapse_rips_persistence data/distance_matrix/full_square_distance_matrix.csv -r 15 -d 3 -p 3 -m 0`
+
+
diff --git a/src/Collapse/utilities/distance_matrix_edge_collapse_rips_persistence.cpp b/src/Collapse/utilities/distance_matrix_edge_collapse_rips_persistence.cpp
index 56e9bab6..f6926224 100644
--- a/src/Collapse/utilities/distance_matrix_edge_collapse_rips_persistence.cpp
+++ b/src/Collapse/utilities/distance_matrix_edge_collapse_rips_persistence.cpp
@@ -1,3 +1,13 @@
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Siddharth Pritam, Vincent Rouvreau
+ *
+ * Copyright (C) 2020 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
+
#include <gudhi/Flag_complex_sparse_matrix.h>
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
diff --git a/src/Collapse/utilities/point_cloud_edge_collapse_rips_persistence.cpp b/src/Collapse/utilities/point_cloud_edge_collapse_rips_persistence.cpp
index 4b52e4c6..e322d3cd 100644
--- a/src/Collapse/utilities/point_cloud_edge_collapse_rips_persistence.cpp
+++ b/src/Collapse/utilities/point_cloud_edge_collapse_rips_persistence.cpp
@@ -1,3 +1,13 @@
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Siddharth Pritam, Vincent Rouvreau
+ *
+ * Copyright (C) 2020 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
+
#include <gudhi/Flag_complex_sparse_matrix.h>
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>