11#ifndef GRAPH_SIMPLICIAL_COMPLEX_H_ 
   12#define GRAPH_SIMPLICIAL_COMPLEX_H_ 
   14#include <boost/graph/adjacency_list.hpp> 
   27struct edge_filtration_t {
 
   28  typedef boost::edge_property_tag kind;
 
   32struct vertex_filtration_t {
 
   33  typedef boost::vertex_property_tag kind;
 
   42template <
typename SimplicialComplexForProximityGraph>
 
   43using Proximity_graph = 
typename boost::adjacency_list < boost::vecS, boost::vecS, boost::directedS
 
   44, boost::property < vertex_filtration_t, typename SimplicialComplexForProximityGraph::Filtration_value >
 
   45, boost::property < edge_filtration_t, typename SimplicialComplexForProximityGraph::Filtration_value >>;
 
   59template< 
typename SimplicialComplexForProximityGraph
 
   60          , 
typename ForwardPointRange
 
   63    const ForwardPointRange& points,
 
   64    typename SimplicialComplexForProximityGraph::Filtration_value threshold,
 
   66  using Vertex_handle = 
typename SimplicialComplexForProximityGraph::Vertex_handle;
 
   67  using Filtration_value = 
typename SimplicialComplexForProximityGraph::Filtration_value;
 
   69  std::vector<std::pair< Vertex_handle, Vertex_handle >> edges;
 
   70  std::vector< Filtration_value > edges_fil;
 
   71  std::map< Vertex_handle, Filtration_value > vertices;
 
   76  for (
auto it_u = points.begin(); it_u != points.end(); ++it_u) {
 
   78    for (
auto it_v = it_u + 1; it_v != points.end(); ++it_v, ++idx_v) {
 
   79      fil = distance(*it_u, *it_v);
 
   80      if (fil <= threshold) {
 
   81        edges.emplace_back(idx_u, idx_v);
 
   82        edges_fil.push_back(fil);
 
   91  auto vertex_prop = 
boost::get(vertex_filtration_t(), skel_graph);
 
   93  typename boost::graph_traits<Proximity_graph<SimplicialComplexForProximityGraph>>::vertex_iterator vi, vi_end;
 
   94  for (std::tie(vi, vi_end) = boost::vertices(skel_graph);
 
   96    boost::put(vertex_prop, *vi, 0.);
 
constexpr auto & get(Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value > &i) noexcept
Partial specialization of get for Gudhi::persistence_matrix::Persistence_interval.
Definition: persistence_interval.h:199
 
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
 
typename boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, boost::property< vertex_filtration_t, typename SimplicialComplexForProximityGraph::Filtration_value >, boost::property< edge_filtration_t, typename SimplicialComplexForProximityGraph::Filtration_value > > Proximity_graph
Proximity_graph contains the vertices and edges with their filtration values in order to store the re...
Definition: graph_simplicial_complex.h:45
 
Proximity_graph< SimplicialComplexForProximityGraph > compute_proximity_graph(const ForwardPointRange &points, typename SimplicialComplexForProximityGraph::Filtration_value threshold, Distance distance)
Computes the proximity graph of the points.
Definition: graph_simplicial_complex.h:62
 
Value type for a filtration function on a cell complex.
Definition: FiltrationValue.h:20
 
Handle type for the vertices of a cell complex.
Definition: VertexHandle.h:15