Graph C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Groups Pages
base_weighted_undirected_vertex.hpp
Go to the documentation of this file.
1 
10 #ifndef BASE_WEIGHTED_UNDIRECTED_VERTEX_HPP_INCLUDED
11 #define BASE_WEIGHTED_UNDIRECTED_VERTEX_HPP_INCLUDED
12 
13 // Standard Library
14 #include <vector>
15 // Graph C++ Library
17 
19 namespace gcl
20 {
21 
30  template <class EdgeAttributesType>
31  class base_weighted_undirected_vertex : public base_undirected_vertex<EdgeAttributesType>
32  {
33  // ============================================================================================
34  // *** Information about the vertex.
35  private:
36  double strength;
37  // ============================================================================================
38  // *** Member functions.
39  public:
42  double get_strength();
43  void neighbour_insert(EdgeAttributesType _edge);
44  protected:
46  };
47 
48 } // End of namespace gcl.
49 
50 
51 
52 // ================================================================================================
53 // ================================================================================================
54 template <class EdgeAttributesType>
56 {
57  return strength;
58 }
59 
60 // ================================================================================================
61 // ================================================================================================
62 template <class EdgeAttributesType>
64 {
65  strength += _edge.weight;
66  this->base_vertex_neighbour_insert(this->id_degree, _edge);
67 }
68 
69 // ================================================================================================
70 // ================================================================================================
71 template <class EdgeAttributesType>
73 {
74  // Resets the number of types of vertices.
75  this->set_nb_of_types_of_degrees(1);
76  // Resets the variables inherited from base_undirected_vertex.
77  this->base_undirected_vertex_clear();
78  // Resets the strength.
79  strength = 0;
80 }
81 
82 
83 
84 #endif // BASE_WEIGHTED_UNDIRECTED_VERTEX_HPP_INCLUDED
base_weighted_undirected_vertex()
Constructor.
Definition: base_weighted_undirected_vertex.hpp:40
double get_strength()
Returns the local clustering coefficient.
Definition: base_weighted_undirected_vertex.hpp:55
virtual ~base_weighted_undirected_vertex()
Destructor.
Definition: base_weighted_undirected_vertex.hpp:41
void base_weighted_undirected_vertex_clear()
Reinitializes the vertex.
Definition: base_weighted_undirected_vertex.hpp:72
Virtual base class for vertices in undirected graphs.
Virtual template base class for vertices in undirected graphs.
Definition: base_undirected_vertex.hpp:33
Virtual template base class for vertices in undirected graphs.
Definition: base_weighted_undirected_vertex.hpp:31
void neighbour_insert(EdgeAttributesType _edge)
Adds a vertex to the neighbourhood of the vertex.
Definition: base_weighted_undirected_vertex.hpp:63