10 #ifndef BASE_DIRECTED_VERTEX_HPP_INCLUDED
11 #define BASE_DIRECTED_VERTEX_HPP_INCLUDED
32 template <
class EdgeAttributesType>
38 const unsigned int id_in_degree;
39 const unsigned int id_out_degree;
43 unsigned int undirected_projection_degree;
44 unsigned int nb_undirected_projection_triangles;
45 double local_undirected_projection_clustering_coefficient;
46 unsigned int nb_reciprocal_edges;
76 template <
class EdgeAttributesType>
81 template <
class EdgeAttributesType>
84 return this->get_base_vertex_degrees(id_in_degree);
89 template <
class EdgeAttributesType>
92 return this->get_base_vertex_degrees(id_out_degree);
97 template <
class EdgeAttributesType>
100 return undirected_projection_degree;
105 template <
class EdgeAttributesType>
108 return nb_reciprocal_edges;
113 template <
class EdgeAttributesType>
116 return nb_undirected_projection_triangles;
121 template <
class EdgeAttributesType>
124 return local_undirected_projection_clustering_coefficient;
129 template <
class EdgeAttributesType>
133 nb_undirected_projection_triangles = _value;
135 local_undirected_projection_clustering_coefficient = ( 2. * nb_undirected_projection_triangles ) / (undirected_projection_degree * (undirected_projection_degree - 1));
140 template <
class EdgeAttributesType>
144 nb_reciprocal_edges = _value;
146 undirected_projection_degree = this->get_out_degree() + this->get_in_degree() - ( this->get_nb_reciprocal_edges() / 2 ) ;
151 template <
class EdgeAttributesType>
154 this->base_vertex_neighbour_insert(id_in_degree, _edge);
159 template <
class EdgeAttributesType>
162 this->base_vertex_neighbour_insert(id_out_degree, _edge);
167 template <
class EdgeAttributesType>
170 return this->base_vertex_neighbour_begin(id_in_degree);
175 template <
class EdgeAttributesType>
178 return this->base_vertex_neighbour_end(id_in_degree);
183 template <
class EdgeAttributesType>
186 return this->base_vertex_neighbour_begin(id_out_degree);
191 template <
class EdgeAttributesType>
194 return this->base_vertex_neighbour_end(id_out_degree);
199 template <
class EdgeAttributesType>
203 this->set_nb_of_types_of_degrees(2);
205 this->base_vertex_clear();
207 nb_reciprocal_edges = 0;
208 nb_undirected_projection_triangles = 0;
209 local_undirected_projection_clustering_coefficient = 0;
210 undirected_projection_degree = 0;
215 #endif // BASE_DIRECTED_VERTEX_HPP_INCLUDED
double get_local_undirected_projection_clustering_coefficient()
Returns the local clustering coefficient (regardless of the direction of the edges).
Definition: base_directed_vertex.hpp:122
std::list< EdgeAttributesType >::iterator iterator
Typedef for iterators used to browse the neighbourhood of the vertex.
Definition: base_vertex.hpp:35
void in_neighbour_insert(EdgeAttributesType _edge)
Adds a vertex to the in neighbourhood of the vertex.
Definition: base_directed_vertex.hpp:152
virtual ~base_directed_vertex()
Destructor.
Definition: base_directed_vertex.hpp:51
unsigned int get_out_degree()
Returns the degree of the vertex.
Definition: base_directed_vertex.hpp:90
gcl::base_vertex< EdgeAttributesType >::iterator in_neighbour_end()
Returns an operator pointing at the end the in neighbours container.
Definition: base_directed_vertex.hpp:176
gcl::base_vertex< EdgeAttributesType >::iterator in_neighbour_begin()
Returns an operator pointing at the beginning the in neighbours container.
Definition: base_directed_vertex.hpp:168
Virtual base class for vertices in graphs.
void base_directed_vertex_clear()
Reinitializes the vertex.
Definition: base_directed_vertex.hpp:200
void set_nb_undirected_projection_triangles(unsigned int _value)
Sets the number of triangles the vertex is a part of (regardless of the direction of the edges)...
Definition: base_directed_vertex.hpp:130
unsigned int get_nb_reciprocal_edges()
Returns the number of reciprocal edges the vertex has.
Definition: base_directed_vertex.hpp:106
void set_nb_reciprocal_edges(unsigned int _value)
Sets the number of reciprocal edges the vertiex has.
Definition: base_directed_vertex.hpp:141
gcl::base_vertex< EdgeAttributesType >::iterator out_neighbour_end()
Returns an operator pointing at the end the out neighbours container.
Definition: base_directed_vertex.hpp:192
Virtual template base class for vertices in directed graphs.
Definition: base_directed_vertex.hpp:33
unsigned int get_nb_undirected_projection_triangles()
Returns the number of triangles the vertex is a part of (regardless of the direction of the edges)...
Definition: base_directed_vertex.hpp:114
base_directed_vertex()
Constructor.
Definition: base_directed_vertex.hpp:77
unsigned int get_undirected_projection_degree()
Returns the degree that the vertex has in the undirected version of the directed graph.
Definition: base_directed_vertex.hpp:98
Virtual template base class for vertices in graphs.
Definition: base_vertex.hpp:30
gcl::base_vertex< EdgeAttributesType >::iterator out_neighbour_begin()
Returns an operator pointing at the beginning the out neighbours container.
Definition: base_directed_vertex.hpp:184
void out_neighbour_insert(EdgeAttributesType _edge)
Adds a vertex to the out neighbourhood of the vertex.
Definition: base_directed_vertex.hpp:160
unsigned int get_in_degree()
Returns the degree of the vertex.
Definition: base_directed_vertex.hpp:82