summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorGard Spreemann <gspreemann@gmail.com>2018-06-14 20:39:01 +0200
committerGard Spreemann <gspreemann@gmail.com>2018-06-14 20:39:01 +0200
commitc524232f734de875d69e2f190f01a6c976024368 (patch)
treed8bba27646c367cb2b7c718354dd036892bcd629 /utilities
parent9899ae167f281d10b1684dfcd02c6838c5bf28df (diff)
GUDHI 2.2.0 as released by upstream in a tarball.upstream/2.2.0
Diffstat (limited to 'utilities')
-rw-r--r--utilities/Alpha_complex/CMakeLists.txt1
-rw-r--r--utilities/Alpha_complex/alpha_complex_3d_helper.h2
-rw-r--r--utilities/Alpha_complex/alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/alpha_complex_persistence.cpp22
-rw-r--r--utilities/Alpha_complex/alphacomplex.md13
-rw-r--r--utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Bitmap_cubical_complex/CMakeLists.txt1
-rw-r--r--utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp2
-rw-r--r--utilities/Bitmap_cubical_complex/cubicalcomplex.md12
-rw-r--r--utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp2
-rw-r--r--utilities/Bottleneck_distance/CMakeLists.txt1
-rw-r--r--utilities/Bottleneck_distance/bottleneck_distance.cpp2
-rw-r--r--utilities/Bottleneck_distance/bottleneckdistance.md12
-rw-r--r--utilities/Cech_complex/CMakeLists.txt14
-rw-r--r--utilities/Cech_complex/cech_persistence.cpp136
-rw-r--r--utilities/Cech_complex/cechcomplex.md38
-rw-r--r--utilities/Nerve_GIC/CMakeLists.txt5
-rwxr-xr-xutilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py4
-rw-r--r--utilities/Nerve_GIC/Nerve.cpp2
-rw-r--r--utilities/Nerve_GIC/VoronoiGIC.cpp2
-rw-r--r--utilities/Nerve_GIC/covercomplex.md13
-rw-r--r--utilities/Persistence_representations/CMakeLists.txt6
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/CMakeLists.txt7
-rw-r--r--utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp2
-rw-r--r--utilities/Rips_complex/CMakeLists.txt15
-rw-r--r--utilities/Rips_complex/rips_correlation_matrix_persistence.cpp171
-rw-r--r--utilities/Rips_complex/rips_distance_matrix_persistence.cpp2
-rw-r--r--utilities/Rips_complex/rips_persistence.cpp2
-rw-r--r--utilities/Rips_complex/ripscomplex.md66
-rw-r--r--utilities/Rips_complex/sparse_rips_persistence.cpp133
-rw-r--r--utilities/Witness_complex/CMakeLists.txt1
-rw-r--r--utilities/Witness_complex/strong_witness_persistence.cpp2
-rw-r--r--utilities/Witness_complex/weak_witness_persistence.cpp2
-rw-r--r--utilities/Witness_complex/witnesscomplex.md13
-rw-r--r--utilities/common/CMakeLists.txt1
-rw-r--r--utilities/common/off_file_from_shape_generator.cpp2
-rw-r--r--utilities/common/pointsetgenerator.md14
73 files changed, 725 insertions, 80 deletions
diff --git a/utilities/Alpha_complex/CMakeLists.txt b/utilities/Alpha_complex/CMakeLists.txt
index a2dfac20..7ace6064 100644
--- a/utilities/Alpha_complex/CMakeLists.txt
+++ b/utilities/Alpha_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Alpha_complex_utilities)
if(CGAL_FOUND)
diff --git a/utilities/Alpha_complex/alpha_complex_3d_helper.h b/utilities/Alpha_complex/alpha_complex_3d_helper.h
index a59f0654..a72fd96d 100644
--- a/utilities/Alpha_complex/alpha_complex_3d_helper.h
+++ b/utilities/Alpha_complex/alpha_complex_3d_helper.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Saclay (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp
index 8ef5ffb2..8cda0b70 100644
--- a/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -35,6 +35,8 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Alpha_complex/alpha_complex_persistence.cpp b/utilities/Alpha_complex/alpha_complex_persistence.cpp
index 2105220a..42390b0e 100644
--- a/utilities/Alpha_complex/alpha_complex_persistence.cpp
+++ b/utilities/Alpha_complex/alpha_complex_persistence.cpp
@@ -1,3 +1,25 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Vincent Rouvreau
+ *
+ * Copyright (C) 2016 Inria
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include <boost/program_options.hpp>
#include <CGAL/Epick_d.h>
diff --git a/utilities/Alpha_complex/alphacomplex.md b/utilities/Alpha_complex/alphacomplex.md
index aace85d3..0fe98837 100644
--- a/utilities/Alpha_complex/alphacomplex.md
+++ b/utilities/Alpha_complex/alphacomplex.md
@@ -1,6 +1,13 @@
-
-
-# Alpha complex #
+---
+layout: page
+title: "Alpha complex"
+meta_title: "Alpha complex"
+teaser: ""
+permalink: /alphacomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
## alpha_complex_persistence ##
diff --git a/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp
index cceac46e..cbe003ff 100644
--- a/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -30,6 +30,8 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp
index 188cf604..11010701 100644
--- a/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp
@@ -5,7 +5,7 @@
* Author(s): Vincent Rouvreau
* Pawel Dlotko - 2017 - Swansea University, UK
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -32,6 +32,8 @@
#include <CGAL/Periodic_3_Delaunay_triangulation_traits_3.h>
#include <CGAL/Periodic_3_Delaunay_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp
index 93be8a05..cdeeabfc 100644
--- a/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -31,6 +31,8 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
// For CGAL < 4.11
diff --git a/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp
index 5321bb0a..d030c88c 100644
--- a/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp
@@ -5,7 +5,7 @@
* Author(s): Vincent Rouvreau
* Pawel Dlotko - 2017 - Swansea University, UK
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -31,6 +31,8 @@
#include <CGAL/Periodic_3_regular_triangulation_traits_3.h>
#include <CGAL/Periodic_3_regular_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Bitmap_cubical_complex/CMakeLists.txt b/utilities/Bitmap_cubical_complex/CMakeLists.txt
index 676a730a..416db67f 100644
--- a/utilities/Bitmap_cubical_complex/CMakeLists.txt
+++ b/utilities/Bitmap_cubical_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Bitmap_cubical_complex_utilities)
add_executable ( cubical_complex_persistence cubical_complex_persistence.cpp )
diff --git a/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp b/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp
index 9d1bc08c..170aa684 100644
--- a/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp
+++ b/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/utilities/Bitmap_cubical_complex/cubicalcomplex.md b/utilities/Bitmap_cubical_complex/cubicalcomplex.md
index 6e1b2578..5b0404c3 100644
--- a/utilities/Bitmap_cubical_complex/cubicalcomplex.md
+++ b/utilities/Bitmap_cubical_complex/cubicalcomplex.md
@@ -1,7 +1,15 @@
+---
+layout: page
+title: "Cubical complex"
+meta_title: "Cubical complex"
+teaser: ""
+permalink: /cubicalcomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# Cubical complex#
-
## cubical_complex_persistence ##
This program computes persistent homology, by using the Bitmap_cubical_complex class, of cubical complexes provided in text files in Perseus style.
See [here](/doc/latest/fileformats.html#FileFormatsPerseus) for a description of the file format.
diff --git a/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp b/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp
index c812cb3a..e9ba5495 100644
--- a/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp
+++ b/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/utilities/Bottleneck_distance/CMakeLists.txt b/utilities/Bottleneck_distance/CMakeLists.txt
index d19e3b1c..2f35885c 100644
--- a/utilities/Bottleneck_distance/CMakeLists.txt
+++ b/utilities/Bottleneck_distance/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Bottleneck_distance_utilities)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
diff --git a/utilities/Bottleneck_distance/bottleneck_distance.cpp b/utilities/Bottleneck_distance/bottleneck_distance.cpp
index 9dd52b31..8f724f95 100644
--- a/utilities/Bottleneck_distance/bottleneck_distance.cpp
+++ b/utilities/Bottleneck_distance/bottleneck_distance.cpp
@@ -4,7 +4,7 @@
*
* Authors: Francois Godi, small modifications by Pawel Dlotko
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/utilities/Bottleneck_distance/bottleneckdistance.md b/utilities/Bottleneck_distance/bottleneckdistance.md
index 526f5822..939eb911 100644
--- a/utilities/Bottleneck_distance/bottleneckdistance.md
+++ b/utilities/Bottleneck_distance/bottleneckdistance.md
@@ -1,7 +1,15 @@
+---
+layout: page
+title: "Bottleneck distance"
+meta_title: "Bottleneck distance"
+teaser: ""
+permalink: /bottleneckdistance/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# Bottleneck distance #
-
## bottleneck_read_file_example ##
This program computes the Bottleneck distance between two persistence diagram files.
diff --git a/utilities/Cech_complex/CMakeLists.txt b/utilities/Cech_complex/CMakeLists.txt
new file mode 100644
index 00000000..30b99729
--- /dev/null
+++ b/utilities/Cech_complex/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.6)
+project(Cech_complex_utilities)
+
+add_executable(cech_persistence cech_persistence.cpp)
+target_link_libraries(cech_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+
+if (TBB_FOUND)
+ target_link_libraries(cech_persistence ${TBB_LIBRARIES})
+endif()
+
+add_test(NAME Cech_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:cech_persistence>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3")
+
+install(TARGETS cech_persistence DESTINATION bin)
diff --git a/utilities/Cech_complex/cech_persistence.cpp b/utilities/Cech_complex/cech_persistence.cpp
new file mode 100644
index 00000000..abd9dbcd
--- /dev/null
+++ b/utilities/Cech_complex/cech_persistence.cpp
@@ -0,0 +1,136 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Vincent Rouvreau
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gudhi/Cech_complex.h>
+#include <gudhi/distance_functions.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/Points_off_io.h>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+#include <limits> // infinity
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Point = std::vector<double>;
+using Point_cloud = std::vector<Point>;
+using Points_off_reader = Gudhi::Points_off_reader<Point>;
+using Cech_complex = Gudhi::cech_complex::Cech_complex<Simplex_tree, Point_cloud>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
+
+void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag,
+ Filtration_value& max_radius, int& dim_max, int& p, Filtration_value& min_persistence);
+
+int main(int argc, char* argv[]) {
+ std::string off_file_points;
+ std::string filediag;
+ Filtration_value max_radius;
+ int dim_max;
+ int p;
+ Filtration_value min_persistence;
+
+ program_options(argc, argv, off_file_points, filediag, max_radius, dim_max, p, min_persistence);
+
+ Points_off_reader off_reader(off_file_points);
+ Cech_complex cech_complex_from_file(off_reader.get_point_cloud(), max_radius);
+
+ // Construct the Cech complex in a Simplex Tree
+ Simplex_tree simplex_tree;
+
+ cech_complex_from_file.create_complex(simplex_tree, dim_max);
+ std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << simplex_tree.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ simplex_tree.initialize_filtration();
+
+ // Compute the persistence diagram of the complex
+ Persistent_cohomology pcoh(simplex_tree);
+ // initializes the coefficient field for homology
+ pcoh.init_coefficients(p);
+
+ pcoh.compute_persistent_cohomology(min_persistence);
+
+ // Output the diagram in filediag
+ if (filediag.empty()) {
+ pcoh.output_diagram();
+ } else {
+ std::ofstream out(filediag);
+ pcoh.output_diagram(out);
+ out.close();
+ }
+
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag,
+ Filtration_value& max_radius, int& dim_max, int& p, Filtration_value& min_persistence) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()("input-file", po::value<std::string>(&off_file_points),
+ "Name of an OFF file containing a point set.\n");
+
+ po::options_description visible("Allowed options", 100);
+ visible.add_options()("help,h", "produce help message")(
+ "output-file,o", po::value<std::string>(&filediag)->default_value(std::string()),
+ "Name of file in which the persistence diagram is written. Default print in std::cout")(
+ "max-radius,r",
+ po::value<Filtration_value>(&max_radius)->default_value(std::numeric_limits<Filtration_value>::infinity()),
+ "Maximal length of an edge for the Cech complex construction.")(
+ "cpx-dimension,d", po::value<int>(&dim_max)->default_value(1),
+ "Maximal dimension of the Cech complex we want to compute.")(
+ "field-charac,p", po::value<int>(&p)->default_value(11),
+ "Characteristic p of the coefficient field Z/pZ for computing homology.")(
+ "min-persistence,m", po::value<Filtration_value>(&min_persistence),
+ "Minimal lifetime of homology feature to be recorded. Default is 0. Enter a negative value to see zero length "
+ "intervals");
+
+ po::positional_options_description pos;
+ pos.add("input-file", 1);
+
+ po::options_description all;
+ all.add(visible).add(hidden);
+
+ po::variables_map vm;
+ po::store(po::command_line_parser(argc, argv).options(all).positional(pos).run(), vm);
+ po::notify(vm);
+
+ if (vm.count("help") || !vm.count("input-file")) {
+ std::cout << std::endl;
+ std::cout << "Compute the persistent homology with coefficient field Z/pZ \n";
+ std::cout << "of a Cech complex defined on a set of input points.\n \n";
+ std::cout << "The output diagram contains one bar per line, written with the convention: \n";
+ std::cout << " p dim b d \n";
+ std::cout << "where dim is the dimension of the homological feature,\n";
+ std::cout << "b and d are respectively the birth and death of the feature and \n";
+ std::cout << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl;
+
+ std::cout << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl;
+ std::cout << visible << std::endl;
+ std::abort();
+ }
+}
diff --git a/utilities/Cech_complex/cechcomplex.md b/utilities/Cech_complex/cechcomplex.md
new file mode 100644
index 00000000..f7817dbb
--- /dev/null
+++ b/utilities/Cech_complex/cechcomplex.md
@@ -0,0 +1,38 @@
+
+
+# Čech complex #
+
+## cech_persistence ##
+This program computes the persistent homology with coefficient field *Z/pZ* of
+a Čech complex defined on a set of input points, using Euclidean distance. 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**
+
+`cech_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 Čech complex construction.
+* `-d [ --cpx-dimension ]` (default = 1) Maximal dimension of the Čech 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**
+
+`cech_persistence ../../data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 2`
+
+**Example 2 with Z/3Z coefficients**
+
+`cech_persistence ../../data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 3`
diff --git a/utilities/Nerve_GIC/CMakeLists.txt b/utilities/Nerve_GIC/CMakeLists.txt
index 7762c8a0..215f9dfd 100644
--- a/utilities/Nerve_GIC/CMakeLists.txt
+++ b/utilities/Nerve_GIC/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Nerve_GIC_examples)
if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
@@ -21,4 +20,8 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
add_test(NAME Nerve_GIC_utilities_VoronoiGIC COMMAND $<TARGET_FILE:VoronoiGIC>
"human.off" "100")
+ install(TARGETS Nerve DESTINATION bin)
+ install(TARGETS VoronoiGIC DESTINATION bin)
+ install(FILES KeplerMapperVisuFromTxtFile.py km.py km.py.COPYRIGHT DESTINATION bin)
+
endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
diff --git a/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py b/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py
index c811f610..701e7a52 100755
--- a/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py
+++ b/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py
@@ -11,7 +11,7 @@ import argparse
Author(s): Mathieu Carriere
- Copyright (C) 2017 INRIA
+ Copyright (C) 2017 Inria
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
@@ -28,7 +28,7 @@ import argparse
"""
__author__ = "Mathieu Carriere"
-__copyright__ = "Copyright (C) 2017 INRIA"
+__copyright__ = "Copyright (C) 2017 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='Creates an html Keppler Mapper '
diff --git a/utilities/Nerve_GIC/Nerve.cpp b/utilities/Nerve_GIC/Nerve.cpp
index aefc3874..667129e0 100644
--- a/utilities/Nerve_GIC/Nerve.cpp
+++ b/utilities/Nerve_GIC/Nerve.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Mathieu Carrière
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/utilities/Nerve_GIC/VoronoiGIC.cpp b/utilities/Nerve_GIC/VoronoiGIC.cpp
index 54bb871e..33deca40 100644
--- a/utilities/Nerve_GIC/VoronoiGIC.cpp
+++ b/utilities/Nerve_GIC/VoronoiGIC.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Mathieu Carrière
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/utilities/Nerve_GIC/covercomplex.md b/utilities/Nerve_GIC/covercomplex.md
index f33cb2e0..683c1b75 100644
--- a/utilities/Nerve_GIC/covercomplex.md
+++ b/utilities/Nerve_GIC/covercomplex.md
@@ -1,6 +1,13 @@
-
-
-# Cover complex #
+---
+layout: page
+title: "Cover complex"
+meta_title: "Cover complex"
+teaser: ""
+permalink: /covercomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
## Nerve ##
diff --git a/utilities/Persistence_representations/CMakeLists.txt b/utilities/Persistence_representations/CMakeLists.txt
index 137eb0c1..fc51b1d6 100644
--- a/utilities/Persistence_representations/CMakeLists.txt
+++ b/utilities/Persistence_representations/CMakeLists.txt
@@ -10,6 +10,8 @@ function(add_persistence_representation_creation_utility creation_utility)
add_test(NAME Persistence_representation_utilities_${creation_utility} COMMAND $<TARGET_FILE:${creation_utility}>
${ARGN} "${CMAKE_CURRENT_BINARY_DIR}/../first.pers"
"${CMAKE_CURRENT_BINARY_DIR}/../second.pers")
+
+ install(TARGETS ${creation_utility} DESTINATION bin)
endfunction(add_persistence_representation_creation_utility)
function(add_persistence_representation_plot_utility plot_utility tool_extension)
@@ -26,6 +28,8 @@ function(add_persistence_representation_plot_utility plot_utility tool_extension
#add_test(NAME Persistence_representation_utilities_${plot_utility}_second_gnuplot COMMAND ${GNUPLOT_PATH}
# "-e" "load '${CMAKE_CURRENT_BINARY_DIR}/../second.pers${tool_extension}_GnuplotScript'")
endif()
+
+ install(TARGETS ${plot_utility} DESTINATION bin)
endfunction(add_persistence_representation_plot_utility)
function(add_persistence_representation_function_utility function_utility tool_extension)
@@ -44,6 +48,8 @@ function(add_persistence_representation_function_utility function_utility tool_e
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers${tool_extension}"
"${CMAKE_CURRENT_BINARY_DIR}/../second.pers${tool_extension}")
endif()
+
+ install(TARGETS ${function_utility} DESTINATION bin)
endfunction(add_persistence_representation_function_utility)
add_subdirectory(persistence_heat_maps)
diff --git a/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt b/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt
index 386e9fa5..89ef232f 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_heat_maps_utilities)
add_persistence_representation_creation_utility(create_pssk "10" "-1" "-1" "4" "-1")
diff --git a/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp
index 6739e0b6..2cbd812b 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
index ed8278a2..14d0db8f 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
index 63626853..12fceedc 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
index b4a1daa5..21c553b9 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
-* Copyright (C) 2016 INRIA (France)
+* Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
index c50f9ddb..99b0bd17 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
index 59ff3c24..a4b6e458 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp
index 25cd1067..5960a89f 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp
index 97ddb8f0..04f33915 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp b/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp
index 63711d83..e4402589 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt b/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt
index 897e12a3..649b72cb 100644
--- a/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_intervals_utilities)
@@ -7,6 +6,8 @@ add_executable ( plot_histogram_of_intervals_lengths plot_histogram_of_intervals
add_test(NAME plot_histogram_of_intervals_lengths COMMAND $<TARGET_FILE:plot_histogram_of_intervals_lengths>
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers" "-1")
+install(TARGETS plot_histogram_of_intervals_lengths DESTINATION bin)
+
add_persistence_representation_plot_utility(plot_persistence_intervals "")
add_persistence_representation_plot_utility(plot_persistence_Betti_numbers "")
@@ -18,6 +19,8 @@ add_test(NAME Persistence_representation_utilities_compute_number_of_dominant_in
COMMAND $<TARGET_FILE:compute_number_of_dominant_intervals>
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers" "-1" "2")
+install(TARGETS compute_number_of_dominant_intervals DESTINATION bin)
+
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
add_executable ( compute_bottleneck_distance compute_bottleneck_distance.cpp )
@@ -29,4 +32,6 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
"-1"
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers"
"${CMAKE_CURRENT_BINARY_DIR}/../second.pers")
+
+ install(TARGETS compute_bottleneck_distance DESTINATION bin)
endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
diff --git a/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp b/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
index 9102da79..3be3de8f 100644
--- a/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp b/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp
index c8290845..a6953b98 100644
--- a/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp b/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp
index b3d126f0..4f052f42 100644
--- a/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp b/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
index ccb5b645..f283971b 100644
--- a/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp b/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp
index b433c2b3..1cacbcd0 100644
--- a/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp b/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp
index 33387802..f92d5782 100644
--- a/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt b/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt
index d7087ed8..6b24d032 100644
--- a/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_landscapes_utilities)
add_persistence_representation_creation_utility(create_landscapes "-1")
diff --git a/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp
index 1a59be8c..4048f508 100644
--- a/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp
index 5062f521..253fa273 100644
--- a/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
index 5b5e9fa3..11fe2886 100644
--- a/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp
index 6030e994..59aad2f3 100644
--- a/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp
index c797a7a8..f32a92a1 100644
--- a/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt b/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt
index c5ea4bbf..36f3196b 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_lanscapes_on_grid_utilities)
# Need to set grid min and max for further average, distance and scalar_product
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
index 0b098d1a..47102087 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
index fd0fcd15..6cf2739d 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
index 01de3dee..9417be6b 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
index 78e8ef57..46e229bc 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
index dddb3615..39e438d2 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt b/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt
index a401c955..bc982094 100644
--- a/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_vectors_utilities)
add_persistence_representation_creation_utility(create_persistence_vectors "-1")
diff --git a/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp
index 0144e76f..45199838 100644
--- a/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp
index 7e66d25e..0db7dbec 100644
--- a/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
index 303c6e3e..8e99251b 100644
--- a/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp
index cc5e5393..364284e5 100644
--- a/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp
index aa33107d..550e47c5 100644
--- a/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Rips_complex/CMakeLists.txt b/utilities/Rips_complex/CMakeLists.txt
index baa571fa..4b565628 100644
--- a/utilities/Rips_complex/CMakeLists.txt
+++ b/utilities/Rips_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Rips_complex_utilities)
add_executable(rips_distance_matrix_persistence rips_distance_matrix_persistence.cpp)
@@ -7,15 +6,29 @@ target_link_libraries(rips_distance_matrix_persistence ${Boost_PROGRAM_OPTIONS_L
add_executable(rips_persistence rips_persistence.cpp)
target_link_libraries(rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+add_executable(rips_correlation_matrix_persistence rips_correlation_matrix_persistence.cpp)
+target_link_libraries(rips_correlation_matrix_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+
+add_executable(sparse_rips_persistence sparse_rips_persistence.cpp)
+target_link_libraries(sparse_rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+
if (TBB_FOUND)
target_link_libraries(rips_distance_matrix_persistence ${TBB_LIBRARIES})
target_link_libraries(rips_persistence ${TBB_LIBRARIES})
+ target_link_libraries(rips_correlation_matrix_persistence ${TBB_LIBRARIES})
+ target_link_libraries(sparse_rips_persistence ${TBB_LIBRARIES})
endif()
add_test(NAME Rips_complex_utility_from_rips_distance_matrix COMMAND $<TARGET_FILE:rips_distance_matrix_persistence>
"${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "-r" "1.0" "-d" "3" "-p" "3" "-m" "0")
add_test(NAME Rips_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:rips_persistence>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3")
+add_test(NAME Rips_complex_utility_from_rips_correlation_matrix COMMAND $<TARGET_FILE:rips_correlation_matrix_persistence>
+ "${CMAKE_SOURCE_DIR}/data/correlation_matrix/lower_triangular_correlation_matrix.csv" "-c" "0.3" "-d" "3" "-p" "3" "-m" "0")
+add_test(NAME Sparse_rips_complex_utility_on_tore_3D COMMAND $<TARGET_FILE:sparse_rips_persistence>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-e" "0.5" "-m" "0.2" "-d" "3" "-p" "2")
install(TARGETS rips_distance_matrix_persistence DESTINATION bin)
install(TARGETS rips_persistence DESTINATION bin)
+install(TARGETS rips_correlation_matrix_persistence DESTINATION bin)
+install(TARGETS sparse_rips_persistence DESTINATION bin)
diff --git a/utilities/Rips_complex/rips_correlation_matrix_persistence.cpp b/utilities/Rips_complex/rips_correlation_matrix_persistence.cpp
new file mode 100644
index 00000000..c78677d2
--- /dev/null
+++ b/utilities/Rips_complex/rips_correlation_matrix_persistence.cpp
@@ -0,0 +1,171 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Pawel Dlotko, Vincent Rouvreau
+ *
+ * Copyright (C) 2016 Inria
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gudhi/Rips_complex.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/reader_utils.h>
+#include <gudhi/writing_persistence_to_file.h>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+#include <limits> // infinity
+#include <algorithm> // for sort
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
+using Correlation_matrix = std::vector<std::vector<Filtration_value>>;
+using intervals_common = Gudhi::Persistence_interval_common<double, int>;
+
+void program_options(int argc, char* argv[], std::string& csv_matrix_file, std::string& filediag,
+ Filtration_value& correlation_min, int& dim_max, int& p, Filtration_value& min_persistence);
+
+int main(int argc, char* argv[]) {
+ std::string csv_matrix_file;
+ std::string filediag;
+ Filtration_value correlation_min;
+ int dim_max;
+ int p;
+ Filtration_value min_persistence;
+
+ program_options(argc, argv, csv_matrix_file, filediag, correlation_min, dim_max, p, min_persistence);
+
+ Correlation_matrix correlations =
+ Gudhi::read_lower_triangular_matrix_from_csv_file<Filtration_value>(csv_matrix_file);
+
+ Filtration_value threshold = 0;
+
+ // Given a correlation matrix M, we compute component-wise M'[i,j] = 1-M[i,j] to get a distance matrix:
+ for (size_t i = 0; i != correlations.size(); ++i) {
+ for (size_t j = 0; j != correlations[i].size(); ++j) {
+ correlations[i][j] = 1 - correlations[i][j];
+ // Here we make sure that the values of corelations lie between -1 and 1.
+ // If not, we throw an exception.
+ if ((correlations[i][j] < -1) || (correlations[i][j] > 1)) {
+ std::cerr << "The input matrix is not a correlation matrix. The program will now terminate. \n";
+ throw "The input matrix is not a correlation matrix. The program will now terminate. \n";
+ }
+ if (correlations[i][j] > threshold) threshold = correlations[i][j];
+ }
+ }
+
+ Rips_complex rips_complex_from_file(correlations, threshold);
+
+ // Construct the Rips complex in a Simplex Tree
+ Simplex_tree simplex_tree;
+
+ rips_complex_from_file.create_complex(simplex_tree, dim_max);
+ std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << simplex_tree.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ simplex_tree.initialize_filtration();
+
+ // Compute the persistence diagram of the complex
+ Persistent_cohomology pcoh(simplex_tree);
+ // initializes the coefficient field for homology
+ pcoh.init_coefficients(p);
+ // compute persistence
+ pcoh.compute_persistent_cohomology(min_persistence);
+
+ // invert the persistence diagram. The reason for this procedure is the following:
+ // The input to the program is a corelation matrix M. When processing it, it is
+ // turned into 1-M and the obtained persistence intervals are in '1-M' units.
+ // Below we reverse every (birth,death) pair into (1-birth, 1-death) pair
+ // so that the input and the output to the program is expressed in the same
+ // units.
+ auto pairs = pcoh.get_persistent_pairs();
+ std::vector<intervals_common> processed_persistence_intervals;
+ processed_persistence_intervals.reserve(pairs.size());
+ for (auto pair : pairs) {
+ double birth = 1 - simplex_tree.filtration(get<0>(pair));
+ double death = 1 - simplex_tree.filtration(get<1>(pair));
+ unsigned dimension = (unsigned)simplex_tree.dimension(get<0>(pair));
+ int field = get<2>(pair);
+ processed_persistence_intervals.push_back(intervals_common(birth, death, dimension, field));
+ }
+
+ // sort the processed intervals:
+ std::sort(processed_persistence_intervals.begin(), processed_persistence_intervals.end());
+
+ // and write them to a file
+ if (filediag.empty()) {
+ write_persistence_intervals_to_stream(processed_persistence_intervals);
+ } else {
+ std::ofstream out(filediag);
+ write_persistence_intervals_to_stream(processed_persistence_intervals, out);
+ }
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& csv_matrix_file, std::string& filediag,
+ Filtration_value& correlation_min, int& dim_max, int& p, Filtration_value& min_persistence) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()(
+ "input-file", po::value<std::string>(&csv_matrix_file),
+ "Name of file containing a corelation matrix. Can be square or lower triangular matrix. Separator is ';'.");
+ po::options_description visible("Allowed options", 100);
+ visible.add_options()("help,h", "produce help message")(
+ "output-file,o", po::value<std::string>(&filediag)->default_value(std::string()),
+ "Name of file in which the persistence diagram is written. Default print in std::cout")(
+ "min-edge-corelation,c", po::value<Filtration_value>(&correlation_min)->default_value(0),
+ "Minimal corelation of an edge for the Rips complex construction.")(
+ "cpx-dimension,d", po::value<int>(&dim_max)->default_value(1),
+ "Maximal dimension of the Rips complex we want to compute.")(
+ "field-charac,p", po::value<int>(&p)->default_value(11),
+ "Characteristic p of the coefficient field Z/pZ for computing homology.")(
+ "min-persistence,m", po::value<Filtration_value>(&min_persistence),
+ "Minimal lifetime of homology feature to be recorded. Default is 0. Enter a negative value to see zero length "
+ "intervals");
+
+ po::positional_options_description pos;
+ pos.add("input-file", 1);
+
+ po::options_description all;
+ all.add(visible).add(hidden);
+
+ po::variables_map vm;
+ po::store(po::command_line_parser(argc, argv).options(all).positional(pos).run(), vm);
+ po::notify(vm);
+
+ if (vm.count("help") || !vm.count("input-file")) {
+ std::cout << std::endl;
+ std::cout << "Compute the persistent homology with coefficient field Z/pZ \n";
+ std::cout << "of a Rips complex defined on a corelation matrix.\n \n";
+ std::cout << "The output diagram contains one bar per line, written with the convention: \n";
+ std::cout << " p dim b d \n";
+ std::cout << "where dim is the dimension of the homological feature,\n";
+ std::cout << "b and d are respectively the birth and death of the feature and \n";
+ std::cout << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl;
+
+ std::cout << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl;
+ std::cout << visible << std::endl;
+ std::abort();
+ }
+}
diff --git a/utilities/Rips_complex/rips_distance_matrix_persistence.cpp b/utilities/Rips_complex/rips_distance_matrix_persistence.cpp
index ca3c0327..53191ca7 100644
--- a/utilities/Rips_complex/rips_distance_matrix_persistence.cpp
+++ b/utilities/Rips_complex/rips_distance_matrix_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko, Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Rips_complex/rips_persistence.cpp b/utilities/Rips_complex/rips_persistence.cpp
index 8405c014..7cee927e 100644
--- a/utilities/Rips_complex/rips_persistence.cpp
+++ b/utilities/Rips_complex/rips_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/utilities/Rips_complex/ripscomplex.md b/utilities/Rips_complex/ripscomplex.md
index 4291fae7..6df49310 100644
--- a/utilities/Rips_complex/ripscomplex.md
+++ b/utilities/Rips_complex/ripscomplex.md
@@ -1,7 +1,15 @@
+---
+layout: page
+title: "Rips complex"
+meta_title: "Rips complex"
+teaser: ""
+permalink: /ripscomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# Rips complex #
-
## rips_persistence ##
This program computes the persistent homology with coefficient field *Z/pZ* of a Rips complex defined on a set of input points, using Euclidean distance. The output diagram contains one bar per line, written with the convention:
@@ -39,11 +47,63 @@ Same as `rips_persistence` but taking a distance matrix as input.
**Usage**
-`rips_persistence [options] <CSV input file>`
+`rips_distance_matrix_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**
`rips_distance_matrix_persistence data/distance_matrix/full_square_distance_matrix.csv -r 15 -d 3 -p 3 -m 0`
+
+
+## rips_correlation_matrix_persistence ##
+
+Same as `rips_distance_matrix_persistence` but taking a correlation matrix as input.
+
+**Usage**
+
+`rips_correlation_matrix_persistence [options] <CSV input file>`
+
+where
+`<CSV input file>` is the path to the file containing a correlation matrix. Can be square or lower triangular matrix. Separator is ';'.
+Note that no check is performed if the matrix given as the input is a correlation matrix.
+It is the user responsibility to ensure that this is the case.
+Please refer to data/correlation_matrix/lower_triangular_correlation_matrix.csv for an example of a file.
+
+**Example**
+
+`rips_correlation_matrix_persistence data/distance_matrix/full_square_distance_matrix.csv -r 15 -d 3 -p 3 -m 0`
+
+**Warning**
+
+As persistence diagrams points will be under the diagonal, bottleneck distance and persistence graphical tool will not work
+properly, this is a known issue.
+
+
+## sparse_rips_persistence ##
+This program computes the persistent homology with coefficient field *Z/pZ*
+of a sparse (1+epsilon)-approximation of the Rips complex defined on a set of input Euclidean points. 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**
+
+`sparse_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.
+* `-e [ --approximation ]` (default = .5) Epsilon, where the sparse Rips complex is a (1+epsilon)-approximation of the Rips complex.
+* `-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.
+
+**Example with Z/2Z coefficients**
+
+`sparse_rips_persistence ../../data/points/tore3D_1307.off -e .5 -m .2 -d 3 -p 2`
diff --git a/utilities/Rips_complex/sparse_rips_persistence.cpp b/utilities/Rips_complex/sparse_rips_persistence.cpp
new file mode 100644
index 00000000..bcd5c2c5
--- /dev/null
+++ b/utilities/Rips_complex/sparse_rips_persistence.cpp
@@ -0,0 +1,133 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Marc Glisse, Clément Maria
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gudhi/Sparse_rips_complex.h>
+#include <gudhi/distance_functions.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/Points_off_io.h>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Sparse_rips = Gudhi::rips_complex::Sparse_rips_complex<Filtration_value>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
+using Point = std::vector<double>;
+using Points_off_reader = Gudhi::Points_off_reader<Point>;
+
+void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag, double& epsilon,
+ int& dim_max, int& p, Filtration_value& min_persistence);
+
+int main(int argc, char* argv[]) {
+ std::string off_file_points;
+ std::string filediag;
+ double epsilon;
+ int dim_max;
+ int p;
+ Filtration_value min_persistence;
+
+ program_options(argc, argv, off_file_points, filediag, epsilon, dim_max, p, min_persistence);
+
+ Points_off_reader off_reader(off_file_points);
+ Sparse_rips sparse_rips(off_reader.get_point_cloud(), Gudhi::Euclidean_distance(), epsilon);
+
+ // Construct the Rips complex in a Simplex Tree
+ Simplex_tree simplex_tree;
+
+ sparse_rips.create_complex(simplex_tree, dim_max);
+ std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << simplex_tree.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ simplex_tree.initialize_filtration();
+
+ // Compute the persistence diagram of the complex
+ Persistent_cohomology pcoh(simplex_tree);
+ // initializes the coefficient field for homology
+ pcoh.init_coefficients(p);
+
+ pcoh.compute_persistent_cohomology(min_persistence);
+
+ // Output the diagram in filediag
+ if (filediag.empty()) {
+ pcoh.output_diagram();
+ } else {
+ std::ofstream out(filediag);
+ pcoh.output_diagram(out);
+ out.close();
+ }
+
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag, double& epsilon,
+ int& dim_max, int& p, Filtration_value& min_persistence) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()("input-file", po::value<std::string>(&off_file_points),
+ "Name of an OFF file containing a point set.\n");
+
+ po::options_description visible("Allowed options", 100);
+ visible.add_options()("help,h", "produce help message")(
+ "output-file,o", po::value<std::string>(&filediag)->default_value(std::string()),
+ "Name of file in which the persistence diagram is written. Default print in std::cout")(
+ "approximation,e", po::value<double>(&epsilon)->default_value(.5),
+ "Epsilon, where the sparse Rips complex is a (1+epsilon)-approximation of the Rips complex.")(
+ "cpx-dimension,d", po::value<int>(&dim_max)->default_value(1),
+ "Maximal dimension of the Rips complex we want to compute.")(
+ "field-charac,p", po::value<int>(&p)->default_value(11),
+ "Characteristic p of the coefficient field Z/pZ for computing homology.")(
+ "min-persistence,m", po::value<Filtration_value>(&min_persistence),
+ "Minimal lifetime of homology feature to be recorded. Default is 0. Enter a negative value to see zero length "
+ "intervals");
+
+ po::positional_options_description pos;
+ pos.add("input-file", 1);
+
+ po::options_description all;
+ all.add(visible).add(hidden);
+
+ po::variables_map vm;
+ po::store(po::command_line_parser(argc, argv).options(all).positional(pos).run(), vm);
+ po::notify(vm);
+
+ if (vm.count("help") || !vm.count("input-file")) {
+ std::cout << std::endl;
+ std::cout << "Compute the persistent homology with coefficient field Z/pZ \n";
+ std::cout << "of a sparse (1+epsilon)-approximation of the Rips complex \ndefined on a set of input points.\n \n";
+ std::cout << "The output diagram contains one bar per line, written with the convention: \n";
+ std::cout << " p dim b d \n";
+ std::cout << "where dim is the dimension of the homological feature,\n";
+ std::cout << "b and d are respectively the birth and death of the feature and \n";
+ std::cout << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl;
+
+ std::cout << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl;
+ std::cout << visible << std::endl;
+ std::abort();
+ }
+}
diff --git a/utilities/Witness_complex/CMakeLists.txt b/utilities/Witness_complex/CMakeLists.txt
index 125a41ff..ce5e29f2 100644
--- a/utilities/Witness_complex/CMakeLists.txt
+++ b/utilities/Witness_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Witness_complex_utilities)
# CGAL and Eigen3 are required for Euclidean version of Witness
diff --git a/utilities/Witness_complex/strong_witness_persistence.cpp b/utilities/Witness_complex/strong_witness_persistence.cpp
index 2fba631b..9d23df74 100644
--- a/utilities/Witness_complex/strong_witness_persistence.cpp
+++ b/utilities/Witness_complex/strong_witness_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Witness_complex/weak_witness_persistence.cpp b/utilities/Witness_complex/weak_witness_persistence.cpp
index 23fa93aa..1315d2ba 100644
--- a/utilities/Witness_complex/weak_witness_persistence.cpp
+++ b/utilities/Witness_complex/weak_witness_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Witness_complex/witnesscomplex.md b/utilities/Witness_complex/witnesscomplex.md
index 2341759b..da453cce 100644
--- a/utilities/Witness_complex/witnesscomplex.md
+++ b/utilities/Witness_complex/witnesscomplex.md
@@ -1,6 +1,13 @@
-
-
-# Witness complex #
+---
+layout: page
+title: "Witness complex"
+meta_title: "Witness complex"
+teaser: ""
+permalink: /witnesscomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
For more details about the witness complex, please read the [user manual of the package](/doc/latest/group__witness__complex.html).
diff --git a/utilities/common/CMakeLists.txt b/utilities/common/CMakeLists.txt
index b3e4b436..7f1d1cd7 100644
--- a/utilities/common/CMakeLists.txt
+++ b/utilities/common/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(off_file_from_shape_generator)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
diff --git a/utilities/common/off_file_from_shape_generator.cpp b/utilities/common/off_file_from_shape_generator.cpp
index afcd558c..5e3da7f7 100644
--- a/utilities/common/off_file_from_shape_generator.cpp
+++ b/utilities/common/off_file_from_shape_generator.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Saclay (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/utilities/common/pointsetgenerator.md b/utilities/common/pointsetgenerator.md
index 284715d4..c8c819b7 100644
--- a/utilities/common/pointsetgenerator.md
+++ b/utilities/common/pointsetgenerator.md
@@ -1,9 +1,15 @@
+---
+layout: page
+title: "OFF point set generator"
+meta_title: "OFF point set generator"
+teaser: ""
+permalink: /pointsetgenerator/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# common #
-
-## off_file_from_shape_generator ##
-
Generates a pointset and save it in an OFF file. Command-line is:
```