summaryrefslogtreecommitdiff
path: root/cython/include
diff options
context:
space:
mode:
Diffstat (limited to 'cython/include')
-rw-r--r--cython/include/Alpha_complex_interface.h2
-rw-r--r--cython/include/Bottleneck_distance_interface.h2
-rw-r--r--cython/include/Cubical_complex_interface.h2
-rw-r--r--cython/include/Euclidean_strong_witness_complex_interface.h2
-rw-r--r--cython/include/Euclidean_witness_complex_interface.h2
-rw-r--r--cython/include/Off_reader_interface.h2
-rw-r--r--cython/include/Persistent_cohomology_interface.h28
-rw-r--r--cython/include/Reader_utils_interface.h2
-rw-r--r--cython/include/Rips_complex_interface.h19
-rw-r--r--cython/include/Simplex_tree_interface.h2
-rw-r--r--cython/include/Strong_witness_complex_interface.h2
-rw-r--r--cython/include/Subsampling_interface.h2
-rw-r--r--cython/include/Tangential_complex_interface.h15
-rw-r--r--cython/include/Witness_complex_interface.h2
14 files changed, 44 insertions, 40 deletions
diff --git a/cython/include/Alpha_complex_interface.h b/cython/include/Alpha_complex_interface.h
index d47db71f..8cf527fc 100644
--- a/cython/include/Alpha_complex_interface.h
+++ b/cython/include/Alpha_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Bottleneck_distance_interface.h b/cython/include/Bottleneck_distance_interface.h
index d5fbf6ea..5ad9d77d 100644
--- a/cython/include/Bottleneck_distance_interface.h
+++ b/cython/include/Bottleneck_distance_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Cubical_complex_interface.h b/cython/include/Cubical_complex_interface.h
index fad92c2c..85b717b3 100644
--- a/cython/include/Cubical_complex_interface.h
+++ b/cython/include/Cubical_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Euclidean_strong_witness_complex_interface.h b/cython/include/Euclidean_strong_witness_complex_interface.h
index b9dd8177..d86355d6 100644
--- a/cython/include/Euclidean_strong_witness_complex_interface.h
+++ b/cython/include/Euclidean_strong_witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Euclidean_witness_complex_interface.h b/cython/include/Euclidean_witness_complex_interface.h
index 2a09b3b5..dc303533 100644
--- a/cython/include/Euclidean_witness_complex_interface.h
+++ b/cython/include/Euclidean_witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Off_reader_interface.h b/cython/include/Off_reader_interface.h
index 0ca55500..f6b14f38 100644
--- a/cython/include/Off_reader_interface.h
+++ b/cython/include/Off_reader_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Persistent_cohomology_interface.h b/cython/include/Persistent_cohomology_interface.h
index 55028fd0..8cf71a4e 100644
--- a/cython/include/Persistent_cohomology_interface.h
+++ b/cython/include/Persistent_cohomology_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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
@@ -85,6 +85,32 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
return persistence;
}
+ std::vector<std::pair<std::vector<int>, std::vector<int>>> persistence_pairs() {
+ auto pairs = persistent_cohomology::Persistent_cohomology<FilteredComplex,
+ persistent_cohomology::Field_Zp>::get_persistent_pairs();
+
+ std::vector<std::pair<std::vector<int>, std::vector<int>>> persistence_pairs;
+ persistence_pairs.reserve(pairs.size());
+ for (auto pair : pairs) {
+ std::vector<int> birth;
+ if (get<0>(pair) != stptr_->null_simplex()) {
+ for (auto vertex : stptr_->simplex_vertex_range(get<0>(pair))) {
+ birth.push_back(vertex);
+ }
+ }
+
+ std::vector<int> death;
+ if (get<1>(pair) != stptr_->null_simplex()) {
+ for (auto vertex : stptr_->simplex_vertex_range(get<1>(pair))) {
+ death.push_back(vertex);
+ }
+ }
+
+ persistence_pairs.push_back(std::make_pair(birth, death));
+ }
+ return persistence_pairs;
+ }
+
private:
// A copy
FilteredComplex* stptr_;
diff --git a/cython/include/Reader_utils_interface.h b/cython/include/Reader_utils_interface.h
index 8ec34f61..5f7527d9 100644
--- a/cython/include/Reader_utils_interface.h
+++ b/cython/include/Reader_utils_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * 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/cython/include/Rips_complex_interface.h b/cython/include/Rips_complex_interface.h
index 02985727..8b6c9c35 100644
--- a/cython/include/Rips_complex_interface.h
+++ b/cython/include/Rips_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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
@@ -25,9 +25,7 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Rips_complex.h>
-#include <gudhi/Points_off_io.h>
#include <gudhi/distance_functions.h>
-#include <gudhi/reader_utils.h>
#include "Simplex_tree_interface.h"
@@ -56,21 +54,6 @@ class Rips_complex_interface {
}
}
- Rips_complex_interface(const std::string& file_name, double threshold, bool euclidean, bool from_file = true) {
- if (euclidean) {
- // Rips construction where file_name is an OFF file
- Gudhi::Points_off_reader<Point_d> off_reader(file_name);
- rips_complex_ = new Rips_complex<Simplex_tree_interface<>::Filtration_value>(off_reader.get_point_cloud(),
- threshold,
- Gudhi::Euclidean_distance());
- } else {
- // Rips construction where values is a distance matrix
- Distance_matrix distances =
- Gudhi::read_lower_triangular_matrix_from_csv_file<Simplex_tree_interface<>::Filtration_value>(file_name);
- rips_complex_ = new Rips_complex<Simplex_tree_interface<>::Filtration_value>(distances, threshold);
- }
- }
-
~Rips_complex_interface() {
delete rips_complex_;
}
diff --git a/cython/include/Simplex_tree_interface.h b/cython/include/Simplex_tree_interface.h
index 54a4f824..3481eeff 100644
--- a/cython/include/Simplex_tree_interface.h
+++ b/cython/include/Simplex_tree_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Strong_witness_complex_interface.h b/cython/include/Strong_witness_complex_interface.h
index d05eaac5..3c72c916 100644
--- a/cython/include/Strong_witness_complex_interface.h
+++ b/cython/include/Strong_witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Subsampling_interface.h b/cython/include/Subsampling_interface.h
index b0f4a50a..f990da0c 100644
--- a/cython/include/Subsampling_interface.h
+++ b/cython/include/Subsampling_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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/cython/include/Tangential_complex_interface.h b/cython/include/Tangential_complex_interface.h
index 0c3a510e..71418886 100644
--- a/cython/include/Tangential_complex_interface.h
+++ b/cython/include/Tangential_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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
@@ -45,24 +45,19 @@ class Tangential_complex_interface {
using TC = Tangential_complex<Dynamic_kernel, CGAL::Dynamic_dimension_tag, CGAL::Parallel_tag>;
public:
- Tangential_complex_interface(const std::vector<std::vector<double>>& points) {
+ Tangential_complex_interface(int intrisic_dim, const std::vector<std::vector<double>>& points) {
Dynamic_kernel k;
- unsigned intrisic_dim = 0;
- if (points.size() > 0)
- intrisic_dim = points[0].size() - 1;
tangential_complex_ = new TC(points, intrisic_dim, k);
tangential_complex_->compute_tangential_complex();
num_inconsistencies_ = tangential_complex_->number_of_inconsistent_simplices();
}
- Tangential_complex_interface(const std::string& off_file_name, bool from_file = true) {
- Gudhi::Points_off_reader<Point_d> off_reader(off_file_name);
+ Tangential_complex_interface(int intrisic_dim, const std::string& off_file_name, bool from_file = true) {
Dynamic_kernel k;
- unsigned intrisic_dim = 0;
+
+ Gudhi::Points_off_reader<Point_d> off_reader(off_file_name);
std::vector<Point_d> points = off_reader.get_point_cloud();
- if (points.size() > 0)
- intrisic_dim = points[0].size() - 1;
tangential_complex_ = new TC(points, intrisic_dim, k);
tangential_complex_->compute_tangential_complex();
diff --git a/cython/include/Witness_complex_interface.h b/cython/include/Witness_complex_interface.h
index 6501cc35..01b372e7 100644
--- a/cython/include/Witness_complex_interface.h
+++ b/cython/include/Witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): 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