10 #ifndef BASE_UNDIRECTED_VERTEX_HPP_INCLUDED
11 #define BASE_UNDIRECTED_VERTEX_HPP_INCLUDED
32 template <
class EdgeAttributesType>
42 unsigned int nb_triangles;
43 double local_clustering_coefficient;
66 template <
class EdgeAttributesType>
71 template <
class EdgeAttributesType>
74 return this->get_base_vertex_degrees(id_degree);
79 template <
class EdgeAttributesType>
87 template <
class EdgeAttributesType>
90 return local_clustering_coefficient;
95 template <
class EdgeAttributesType>
99 nb_triangles = _value;
101 local_clustering_coefficient = ( 2. * nb_triangles ) / ( this->get_degree() * ( this->get_degree() - 1. ) );
106 template <
class EdgeAttributesType>
109 this->base_vertex_neighbour_insert(id_degree, _edge);
114 template <
class EdgeAttributesType>
117 return this->base_vertex_neighbour_begin(id_degree);
122 template <
class EdgeAttributesType>
125 return this->base_vertex_neighbour_end(id_degree);
130 template <
class EdgeAttributesType>
134 this->set_nb_of_types_of_degrees(1);
136 this->base_vertex_clear();
140 local_clustering_coefficient = 0;
145 #endif // BASE_UNDIRECTED_VERTEX_HPP_INCLUDED
std::list< EdgeAttributesType >::iterator iterator
Typedef for iterators used to browse the neighbourhood of the vertex.
Definition: base_vertex.hpp:35
unsigned int get_nb_triangles()
Returns the number of triangles the vertex is a part of.
Definition: base_undirected_vertex.hpp:80
Virtual base class for vertices in graphs.
base_undirected_vertex()
Constructor.
Definition: base_undirected_vertex.hpp:67
virtual ~base_undirected_vertex()
Destructor.
Definition: base_undirected_vertex.hpp:48
const unsigned int id_degree
Index corresponding to the degree in degree-related vectors.
Definition: base_undirected_vertex.hpp:38
unsigned int get_degree()
Returns the degree of the vertex.
Definition: base_undirected_vertex.hpp:72
void base_undirected_vertex_clear()
Reinitializes the vertex.
Definition: base_undirected_vertex.hpp:131
gcl::base_vertex< EdgeAttributesType >::iterator neighbour_end()
Returns an operator pointing at the end the neighbours container.
Definition: base_undirected_vertex.hpp:123
void neighbour_insert(EdgeAttributesType _edge)
Adds a vertex to the neighbourhood of the vertex.
Definition: base_undirected_vertex.hpp:107
void set_nb_triangles(unsigned int _value)
Sets the number of triangles the vertex is a part of.
Definition: base_undirected_vertex.hpp:96
Virtual template base class for vertices in undirected graphs.
Definition: base_undirected_vertex.hpp:33
gcl::base_vertex< EdgeAttributesType >::iterator neighbour_begin()
Returns an operator pointing at the beginning the neighbours container.
Definition: base_undirected_vertex.hpp:115
Virtual template base class for vertices in graphs.
Definition: base_vertex.hpp:30
double get_local_clustering_coefficient()
Returns the local clustering coefficient.
Definition: base_undirected_vertex.hpp:88