summaryrefslogtreecommitdiff
path: root/src/cython/include/Simplex_tree_interface.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-25 08:59:20 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-25 08:59:20 +0000
commitad9c182c0ffa8b517cd20d174de823db05250514 (patch)
treedc04f37ac0b8b3f42c36f6a608017d0d49c854f7 /src/cython/include/Simplex_tree_interface.h
parentbe37aaeadc31ed10ede53393237d939d4aa47c82 (diff)
Fix rips complex with the new interface
Remove mini simplex tree Fix persistent cohomology doc - only simplex tree used Remove useless type definition in Cython C++ interfaces git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2003 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fff43192b00df1c70d59109a6c14932013992ff1
Diffstat (limited to 'src/cython/include/Simplex_tree_interface.h')
-rw-r--r--src/cython/include/Simplex_tree_interface.h34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/cython/include/Simplex_tree_interface.h b/src/cython/include/Simplex_tree_interface.h
index 8e9dd966..19e02ca4 100644
--- a/src/cython/include/Simplex_tree_interface.h
+++ b/src/cython/include/Simplex_tree_interface.h
@@ -30,15 +30,17 @@
#include "Persistent_cohomology_interface.h"
+#include <iostream>
#include <vector>
#include <utility> // std::pair
-#include <iostream>
namespace Gudhi {
template<typename SimplexTreeOptions = Simplex_tree_options_full_featured>
class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> {
public:
+ typedef typename Simplex_tree<SimplexTreeOptions>::Filtration_value Filtration_value;
+ typedef typename Simplex_tree<SimplexTreeOptions>::Vertex_handle Vertex_handle;
typedef typename Simplex_tree<SimplexTreeOptions>::Simplex_handle Simplex_handle;
typedef typename std::pair<Simplex_handle, bool> Insertion_result;
using Simplex = std::vector<Vertex_handle>;
@@ -115,42 +117,12 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> {
return coface_tree;
}
- void graph_expansion(std::vector<std::vector<double>>&points, int max_dimension, double max_edge_length) {
- Graph_t prox_graph = compute_proximity_graph(points, max_edge_length, euclidean_distance<std::vector<double>>);
- Simplex_tree<SimplexTreeOptions>::insert_graph(prox_graph);
- Simplex_tree<SimplexTreeOptions>::expansion(max_dimension);
- Simplex_tree<SimplexTreeOptions>::initialize_filtration();
- }
-
- void graph_expansion(std::string& off_file_name, int max_dimension, double max_edge_length, bool from_file=true) {
- Gudhi::Points_off_reader<std::vector <double>> off_reader(off_file_name);
- // Check the read operation was correct
- if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << off_file_name << std::endl;
- } else {
- std::vector<std::vector <double>> points = off_reader.get_point_cloud();
- Graph_t prox_graph = compute_proximity_graph(points, max_edge_length,
- euclidean_distance<std::vector<double>>);
- Simplex_tree<SimplexTreeOptions>::insert_graph(prox_graph);
- Simplex_tree<SimplexTreeOptions>::expansion(max_dimension);
- Simplex_tree<SimplexTreeOptions>::initialize_filtration();
- }
- }
-
void create_persistence(Gudhi::Persistent_cohomology_interface<Simplex_tree<SimplexTreeOptions>>* pcoh) {
pcoh = new Gudhi::Persistent_cohomology_interface<Simplex_tree<SimplexTreeOptions>>(*this);
}
};
-struct Simplex_tree_options_mini : Simplex_tree_options_full_featured {
- // Not doing persistence, so we don't need those
- static const bool store_key = true;
- static const bool store_filtration = false;
- // I have few vertices
- typedef short Vertex_handle;
-};
-
} // namespace Gudhi
#endif // SIMPLEX_TREE_INTERFACE_H