From c524232f734de875d69e2f190f01a6c976024368 Mon Sep 17 00:00:00 2001 From: Gard Spreemann Date: Thu, 14 Jun 2018 20:39:01 +0200 Subject: GUDHI 2.2.0 as released by upstream in a tarball. --- cython/include/Alpha_complex_interface.h | 2 +- cython/include/Bottleneck_distance_interface.h | 2 +- cython/include/Cubical_complex_interface.h | 2 +- .../Euclidean_strong_witness_complex_interface.h | 2 +- .../include/Euclidean_witness_complex_interface.h | 2 +- cython/include/Off_reader_interface.h | 2 +- cython/include/Persistent_cohomology_interface.h | 28 +++++++++++++++++++++- cython/include/Reader_utils_interface.h | 2 +- cython/include/Rips_complex_interface.h | 19 +-------------- cython/include/Simplex_tree_interface.h | 2 +- cython/include/Strong_witness_complex_interface.h | 2 +- cython/include/Subsampling_interface.h | 2 +- cython/include/Tangential_complex_interface.h | 15 ++++-------- cython/include/Witness_complex_interface.h | 2 +- 14 files changed, 44 insertions(+), 40 deletions(-) (limited to 'cython/include') 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, std::vector>> persistence_pairs() { + auto pairs = persistent_cohomology::Persistent_cohomology::get_persistent_pairs(); + + std::vector, std::vector>> persistence_pairs; + persistence_pairs.reserve(pairs.size()); + for (auto pair : pairs) { + std::vector birth; + if (get<0>(pair) != stptr_->null_simplex()) { + for (auto vertex : stptr_->simplex_vertex_range(get<0>(pair))) { + birth.push_back(vertex); + } + } + + std::vector 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 #include -#include #include -#include #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 off_reader(file_name); - rips_complex_ = new Rips_complex::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::Filtration_value>(file_name); - rips_complex_ = new Rips_complex::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; public: - Tangential_complex_interface(const std::vector>& points) { + Tangential_complex_interface(int intrisic_dim, const std::vector>& 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 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 off_reader(off_file_name); std::vector 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 -- cgit v1.2.3