diff options
Diffstat (limited to 'src/cython/include')
-rw-r--r-- | src/cython/include/Alpha_complex_interface.h | 6 | ||||
-rw-r--r-- | src/cython/include/Bottleneck_distance_interface.h | 8 | ||||
-rw-r--r-- | src/cython/include/Cubical_complex_interface.h | 8 | ||||
-rw-r--r-- | src/cython/include/Euclidean_strong_witness_complex_interface.h | 10 | ||||
-rw-r--r-- | src/cython/include/Euclidean_witness_complex_interface.h | 10 | ||||
-rw-r--r-- | src/cython/include/Off_reader_interface.h | 6 | ||||
-rw-r--r-- | src/cython/include/Persistent_cohomology_interface.h | 33 | ||||
-rw-r--r-- | src/cython/include/Rips_complex_interface.h | 12 | ||||
-rw-r--r-- | src/cython/include/Simplex_tree_interface.h | 12 | ||||
-rw-r--r-- | src/cython/include/Strong_witness_complex_interface.h | 10 | ||||
-rw-r--r-- | src/cython/include/Subsampling_interface.h | 8 | ||||
-rw-r--r-- | src/cython/include/Tangential_complex_interface.h | 12 | ||||
-rw-r--r-- | src/cython/include/Witness_complex_interface.h | 9 |
13 files changed, 65 insertions, 79 deletions
diff --git a/src/cython/include/Alpha_complex_interface.h b/src/cython/include/Alpha_complex_interface.h index d74ff304..d47db71f 100644 --- a/src/cython/include/Alpha_complex_interface.h +++ b/src/cython/include/Alpha_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef ALPHA_COMPLEX_INTERFACE_H -#define ALPHA_COMPLEX_INTERFACE_H +#ifndef INCLUDE_ALPHA_COMPLEX_INTERFACE_H_ +#define INCLUDE_ALPHA_COMPLEX_INTERFACE_H_ #include <gudhi/Simplex_tree.h> #include <gudhi/Alpha_complex.h> @@ -79,4 +79,4 @@ class Alpha_complex_interface { } // namespace Gudhi -#endif // ALPHA_COMPLEX_INTERFACE_H +#endif // INCLUDE_ALPHA_COMPLEX_INTERFACE_H_ diff --git a/src/cython/include/Bottleneck_distance_interface.h b/src/cython/include/Bottleneck_distance_interface.h index 6819734b..d5fbf6ea 100644 --- a/src/cython/include/Bottleneck_distance_interface.h +++ b/src/cython/include/Bottleneck_distance_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef BOTTLENECK_DISTANCE_INTERFACE_H -#define BOTTLENECK_DISTANCE_INTERFACE_H +#ifndef INCLUDE_BOTTLENECK_DISTANCE_INTERFACE_H_ +#define INCLUDE_BOTTLENECK_DISTANCE_INTERFACE_H_ #include <gudhi/Bottleneck.h> @@ -45,9 +45,9 @@ namespace persistence_diagram { return bottleneck_distance(diag1, diag2); } -} // namespace alpha_complex +} // namespace persistence_diagram } // namespace Gudhi -#endif // BOTTLENECK_DISTANCE_INTERFACE_H +#endif // INCLUDE_BOTTLENECK_DISTANCE_INTERFACE_H_ diff --git a/src/cython/include/Cubical_complex_interface.h b/src/cython/include/Cubical_complex_interface.h index 4c53523b..7c0148f1 100644 --- a/src/cython/include/Cubical_complex_interface.h +++ b/src/cython/include/Cubical_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CUBICAL_COMPLEX_INTERFACE_H -#define CUBICAL_COMPLEX_INTERFACE_H +#ifndef INCLUDE_CUBICAL_COMPLEX_INTERFACE_H_ +#define INCLUDE_CUBICAL_COMPLEX_INTERFACE_H_ #include <gudhi/Bitmap_cubical_complex.h> #include <gudhi/Bitmap_cubical_complex_base.h> @@ -38,7 +38,6 @@ namespace cubical_complex { template<typename CubicalComplexOptions = Bitmap_cubical_complex_base<double>> class Cubical_complex_interface : public Bitmap_cubical_complex<CubicalComplexOptions> { public: - Cubical_complex_interface(const std::vector<unsigned>& dimensions, const std::vector<double>& top_dimensional_cells) : Bitmap_cubical_complex<CubicalComplexOptions>(dimensions, top_dimensional_cells) { @@ -47,12 +46,11 @@ class Cubical_complex_interface : public Bitmap_cubical_complex<CubicalComplexOp Cubical_complex_interface(const std::string& perseus_file) : Bitmap_cubical_complex<CubicalComplexOptions>(perseus_file.c_str()) { } - }; } // namespace cubical_complex } // namespace Gudhi -#endif // CUBICAL_COMPLEX_INTERFACE_H +#endif // INCLUDE_CUBICAL_COMPLEX_INTERFACE_H_ diff --git a/src/cython/include/Euclidean_strong_witness_complex_interface.h b/src/cython/include/Euclidean_strong_witness_complex_interface.h index 67d85e18..b9dd8177 100644 --- a/src/cython/include/Euclidean_strong_witness_complex_interface.h +++ b/src/cython/include/Euclidean_strong_witness_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef EUCLIDEAN_STRONG_WITNESS_COMPLEX_INTERFACE_H -#define EUCLIDEAN_STRONG_WITNESS_COMPLEX_INTERFACE_H +#ifndef INCLUDE_EUCLIDEAN_STRONG_WITNESS_COMPLEX_INTERFACE_H_ +#define INCLUDE_EUCLIDEAN_STRONG_WITNESS_COMPLEX_INTERFACE_H_ #include <gudhi/Simplex_tree.h> #include <gudhi/Euclidean_strong_witness_complex.h> @@ -50,7 +50,7 @@ class Euclidean_strong_witness_complex_interface { Euclidean_strong_witness_complex_interface(const std::vector<std::vector<double>>& landmarks, const std::vector<std::vector<double>>& witnesses) { landmarks_.reserve(landmarks.size()); - for(auto& landmark : landmarks) + for (auto& landmark : landmarks) landmarks_.emplace_back(landmark.begin(), landmark.end()); witness_complex_ = new Euclidean_strong_witness_complex<Dynamic_kernel>(landmarks_, witnesses); } @@ -87,7 +87,7 @@ class Euclidean_strong_witness_complex_interface { } // namespace witness_complex -} // namespace Gudhi +} // namespace Gudhi -#endif // EUCLIDEAN_STRONG_WITNESS_COMPLEX_INTERFACE_H +#endif // INCLUDE_EUCLIDEAN_STRONG_WITNESS_COMPLEX_INTERFACE_H_ diff --git a/src/cython/include/Euclidean_witness_complex_interface.h b/src/cython/include/Euclidean_witness_complex_interface.h index a2db6a2d..2a09b3b5 100644 --- a/src/cython/include/Euclidean_witness_complex_interface.h +++ b/src/cython/include/Euclidean_witness_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H -#define EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H +#ifndef INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_ +#define INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_ #include <gudhi/Simplex_tree.h> #include <gudhi/Euclidean_witness_complex.h> @@ -50,7 +50,7 @@ class Euclidean_witness_complex_interface { Euclidean_witness_complex_interface(const std::vector<std::vector<double>>& landmarks, const std::vector<std::vector<double>>& witnesses) { landmarks_.reserve(landmarks.size()); - for(auto& landmark : landmarks) + for (auto& landmark : landmarks) landmarks_.emplace_back(landmark.begin(), landmark.end()); witness_complex_ = new Euclidean_witness_complex<Dynamic_kernel>(landmarks_, witnesses); } @@ -86,7 +86,7 @@ class Euclidean_witness_complex_interface { } // namespace witness_complex -} // namespace Gudhi +} // namespace Gudhi -#endif // EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H +#endif // INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_ diff --git a/src/cython/include/Off_reader_interface.h b/src/cython/include/Off_reader_interface.h index 97d64d3e..0ca55500 100644 --- a/src/cython/include/Off_reader_interface.h +++ b/src/cython/include/Off_reader_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef OFF_READER_INTERFACE_H -#define OFF_READER_INTERFACE_H +#ifndef INCLUDE_OFF_READER_INTERFACE_H_ +#define INCLUDE_OFF_READER_INTERFACE_H_ #include <gudhi/Points_off_io.h> @@ -38,5 +38,5 @@ std::vector<std::vector<double>> read_points_from_OFF_file(const std::string& of } // namespace Gudhi -#endif // OFF_READER_INTERFACE_H +#endif // INCLUDE_OFF_READER_INTERFACE_H_ diff --git a/src/cython/include/Persistent_cohomology_interface.h b/src/cython/include/Persistent_cohomology_interface.h index 1ff0e09b..55028fd0 100644 --- a/src/cython/include/Persistent_cohomology_interface.h +++ b/src/cython/include/Persistent_cohomology_interface.h @@ -20,13 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef PERSISTENT_COHOMOLOGY_INTERFACE_H -#define PERSISTENT_COHOMOLOGY_INTERFACE_H +#ifndef INCLUDE_PERSISTENT_COHOMOLOGY_INTERFACE_H_ +#define INCLUDE_PERSISTENT_COHOMOLOGY_INTERFACE_H_ #include <gudhi/Persistent_cohomology.h> #include <vector> #include <utility> // for std::pair +#include <algorithm> // for sort namespace Gudhi { @@ -34,12 +35,10 @@ template<class FilteredComplex> class Persistent_cohomology_interface : public persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp> { private: - /* * Compare two intervals by dimension, then by length. */ struct cmp_intervals_by_dim_then_length { - explicit cmp_intervals_by_dim_then_length(FilteredComplex * sc) : sc_(sc) { } @@ -55,23 +54,26 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol }; public: - Persistent_cohomology_interface(FilteredComplex* stptr) : persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>(*stptr), stptr_(stptr) { } Persistent_cohomology_interface(FilteredComplex* stptr, bool persistence_dim_max) - : persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>(*stptr, - persistence_dim_max), - stptr_(stptr) { } + : persistent_cohomology::Persistent_cohomology<FilteredComplex, + persistent_cohomology::Field_Zp>(*stptr, persistence_dim_max), + stptr_(stptr) { } - std::vector<std::pair<int, std::pair<double, double>>> get_persistence(int homology_coeff_field, double min_persistence) { - persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>::init_coefficients(homology_coeff_field); - persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>::compute_persistent_cohomology(min_persistence); + std::vector<std::pair<int, std::pair<double, double>>> get_persistence(int homology_coeff_field, + double min_persistence) { + persistent_cohomology::Persistent_cohomology<FilteredComplex, + persistent_cohomology::Field_Zp>::init_coefficients(homology_coeff_field); + persistent_cohomology::Persistent_cohomology<FilteredComplex, + persistent_cohomology::Field_Zp>::compute_persistent_cohomology(min_persistence); // Custom sort and output persistence cmp_intervals_by_dim_then_length cmp(stptr_); - auto persistent_pairs = persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomology::Field_Zp>::get_persistent_pairs(); + auto persistent_pairs = persistent_cohomology::Persistent_cohomology<FilteredComplex, + persistent_cohomology::Field_Zp>::get_persistent_pairs(); std::sort(std::begin(persistent_pairs), std::end(persistent_pairs), cmp); std::vector<std::pair<int, std::pair<double, double>>> persistence; @@ -81,16 +83,13 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol stptr_->filtration(get<1>(pair))))); } return persistence; - } private: // A copy FilteredComplex* stptr_; - }; -} // namespace Gudhi - -#endif // PERSISTENT_COHOMOLOGY_INTERFACE_H +} // namespace Gudhi +#endif // INCLUDE_PERSISTENT_COHOMOLOGY_INTERFACE_H_ diff --git a/src/cython/include/Rips_complex_interface.h b/src/cython/include/Rips_complex_interface.h index 01df5366..1879bd74 100644 --- a/src/cython/include/Rips_complex_interface.h +++ b/src/cython/include/Rips_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef RIPS_COMPLEX_INTERFACE_H -#define RIPS_COMPLEX_INTERFACE_H +#ifndef INCLUDE_RIPS_COMPLEX_INTERFACE_H_ +#define INCLUDE_RIPS_COMPLEX_INTERFACE_H_ #include <gudhi/Simplex_tree.h> #include <gudhi/Rips_complex.h> @@ -53,7 +53,6 @@ class Rips_complex_interface { } else { // Rips construction where values is a distance matrix rips_complex_ = new Rips_complex<Simplex_tree_interface<>::Filtration_value>(values, threshold); - } } @@ -65,11 +64,10 @@ class Rips_complex_interface { threshold, Euclidean_distance()); } else { // Rips construction where values is a distance matrix - Distance_matrix distances = read_lower_triangular_matrix_from_csv_file<Simplex_tree_interface<>::Filtration_value>(file_name); + Distance_matrix distances = + 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); - } - } void create_simplex_tree(Simplex_tree_interface<>* simplex_tree, int dim_max) { @@ -85,4 +83,4 @@ class Rips_complex_interface { } // namespace Gudhi -#endif // RIPS_COMPLEX_INTERFACE_H +#endif // INCLUDE_RIPS_COMPLEX_INTERFACE_H_ diff --git a/src/cython/include/Simplex_tree_interface.h b/src/cython/include/Simplex_tree_interface.h index c2783e22..4266b3ef 100644 --- a/src/cython/include/Simplex_tree_interface.h +++ b/src/cython/include/Simplex_tree_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef SIMPLEX_TREE_INTERFACE_H -#define SIMPLEX_TREE_INTERFACE_H +#ifndef INCLUDE_SIMPLEX_TREE_INTERFACE_H_ +#define INCLUDE_SIMPLEX_TREE_INTERFACE_H_ #include <gudhi/graph_simplicial_complex.h> #include <gudhi/distance_functions.h> @@ -48,7 +48,6 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> { using Complex = std::vector<std::pair<Simplex, Filtration_value>>; public: - bool find_simplex(const Simplex& vh) { return (Base::find(vh) != Base::null_simplex()); } @@ -98,7 +97,6 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> { filtered_tree.push_back(std::make_pair(simplex, Base::filtration(f_simplex))); } return filtered_tree; - } Complex get_skeleton_tree(int dimension) { @@ -144,10 +142,8 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> { void create_persistence(Gudhi::Persistent_cohomology_interface<Base>* pcoh) { pcoh = new Gudhi::Persistent_cohomology_interface<Base>(*this); } - }; -} // namespace Gudhi - -#endif // SIMPLEX_TREE_INTERFACE_H +} // namespace Gudhi +#endif // INCLUDE_SIMPLEX_TREE_INTERFACE_H_ diff --git a/src/cython/include/Strong_witness_complex_interface.h b/src/cython/include/Strong_witness_complex_interface.h index 83bf0f3c..d05eaac5 100644 --- a/src/cython/include/Strong_witness_complex_interface.h +++ b/src/cython/include/Strong_witness_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef STRONG_WITNESS_COMPLEX_INTERFACE_H -#define STRONG_WITNESS_COMPLEX_INTERFACE_H +#ifndef INCLUDE_STRONG_WITNESS_COMPLEX_INTERFACE_H_ +#define INCLUDE_STRONG_WITNESS_COMPLEX_INTERFACE_H_ #include <gudhi/Simplex_tree.h> #include <gudhi/Strong_witness_complex.h> @@ -64,12 +64,10 @@ class Strong_witness_complex_interface { private: Strong_witness_complex<Nearest_landmark_table>* witness_complex_; - }; } // namespace witness_complex -} // namespace Gudhi - -#endif // STRONG_WITNESS_COMPLEX_INTERFACE_H +} // namespace Gudhi +#endif // INCLUDE_STRONG_WITNESS_COMPLEX_INTERFACE_H_ diff --git a/src/cython/include/Subsampling_interface.h b/src/cython/include/Subsampling_interface.h index 5fc16767..1c6032c0 100644 --- a/src/cython/include/Subsampling_interface.h +++ b/src/cython/include/Subsampling_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef SUBSAMPLING_INTERFACE_H -#define SUBSAMPLING_INTERFACE_H +#ifndef INCLUDE_SUBSAMPLING_INTERFACE_H_ +#define INCLUDE_SUBSAMPLING_INTERFACE_H_ #include <gudhi/choose_n_farthest_points.h> #include <gudhi/pick_n_random_points.h> @@ -112,10 +112,8 @@ std::vector<std::vector<double>> subsampling_sparsify_points_from_file(const std return subsampling_sparsify_points(points, min_squared_dist); } - } // namespace subsampling } // namespace Gudhi -#endif // SUBSAMPLING_INTERFACE_H - +#endif // INCLUDE_SUBSAMPLING_INTERFACE_H_ diff --git a/src/cython/include/Tangential_complex_interface.h b/src/cython/include/Tangential_complex_interface.h index 2ca4c393..5e9dc0e4 100644 --- a/src/cython/include/Tangential_complex_interface.h +++ b/src/cython/include/Tangential_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef TANGENTIAL_COMPLEX_INTERFACE_H -#define TANGENTIAL_COMPLEX_INTERFACE_H +#ifndef INCLUDE_TANGENTIAL_COMPLEX_INTERFACE_H_ +#define INCLUDE_TANGENTIAL_COMPLEX_INTERFACE_H_ #include <gudhi/Simplex_tree.h> #include <gudhi/Tangential_complex.h> @@ -33,6 +33,7 @@ #include <vector> #include <utility> // std::pair #include <iostream> +#include <string> namespace Gudhi { @@ -49,7 +50,7 @@ class Tangential_complex_interface { 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(); @@ -117,7 +118,6 @@ class Tangential_complex_interface { } // namespace tangential_complex -} // namespace Gudhi - -#endif // TANGENTIAL_COMPLEX_INTERFACE_H +} // namespace Gudhi +#endif // INCLUDE_TANGENTIAL_COMPLEX_INTERFACE_H_ diff --git a/src/cython/include/Witness_complex_interface.h b/src/cython/include/Witness_complex_interface.h index 4f2a903b..6501cc35 100644 --- a/src/cython/include/Witness_complex_interface.h +++ b/src/cython/include/Witness_complex_interface.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef WITNESS_COMPLEX_INTERFACE_H -#define WITNESS_COMPLEX_INTERFACE_H +#ifndef INCLUDE_WITNESS_COMPLEX_INTERFACE_H_ +#define INCLUDE_WITNESS_COMPLEX_INTERFACE_H_ #include <gudhi/Simplex_tree.h> #include <gudhi/Witness_complex.h> @@ -64,12 +64,11 @@ class Witness_complex_interface { private: Witness_complex<Nearest_landmark_table>* witness_complex_; - }; } // namespace witness_complex -} // namespace Gudhi +} // namespace Gudhi -#endif // WITNESS_COMPLEX_INTERFACE_H +#endif // INCLUDE_WITNESS_COMPLEX_INTERFACE_H_ |