Graph C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Groups Pages
hms_directed_vertex.hpp
Go to the documentation of this file.
1 
10 #ifndef HMS_DIRECTED_VERTEX_HPP_INCLUDED
11 #define HMS_DIRECTED_VERTEX_HPP_INCLUDED
12 
13 // Graph C++ Library
14 #include "base_directed_vertex.hpp"
15 #include "edge_attributes.hpp"
16 
18 namespace gcl
19 {
20 
29  class hms_directed_vertex : public gcl::base_directed_vertex<gcl::simple_edge>
30  {
31  // ============================================================================================
32  // *** Objects related to the graph.
33  private:
34  // Numbers of hidden variables (in this case 2)
35  const unsigned int nb_hidden_variables;
36  // ============================================================================================
37  // *** Information about the vertex.
38  private:
39  // Position of the vertex in the metric space.
40  std::vector<double> metric_space_position;
41  // Hidden variables of the vertex.
42  std::vector<double> hidden_variables;
43  // ============================================================================================
44  // *** Member functions.
45  public:
48  std::vector<double> get_metric_space_position();
49  std::vector<double> get_hidden_variables();
50  void set_metric_space_position(std::vector<double> _values);
51  void set_hidden_variables(std::vector<double> _values);
52  void clear();
53  };
54 
55 } // End of namespace gcl.
56 
57 
58 
59 // ================================================================================================
60 // ================================================================================================
62 {
63  clear();
64 }
65 
66 // ================================================================================================
67 // ================================================================================================
69 {
70  return metric_space_position;
71 }
72 
73 // ================================================================================================
74 // ================================================================================================
76 {
77  return hidden_variables;
78 }
79 
80 // ================================================================================================
81 // ================================================================================================
82 void gcl::hms_directed_vertex::set_metric_space_position(std::vector<double> _values)
83 {
84  metric_space_position = _values;
85 }
86 
87 // ================================================================================================
88 // ================================================================================================
89 void gcl::hms_directed_vertex::set_hidden_variables(std::vector<double> _values)
90 {
91  hidden_variables = _values;
92 }
93 
94 // ================================================================================================
95 // ================================================================================================
97 {
98  // Reintializes the variables inherited from the class base_directed_vertex.
99  base_directed_vertex_clear();
100  // Resets the vector containing the position in the metric space.
101  metric_space_position.clear();
102  // Resets the vector containing the hidden variables.
103  hidden_variables.clear();
104  hidden_variables.resize(nb_hidden_variables,0);
105 }
106 
107 
108 
109 #endif // HMS_DIRECTED_VERTEX_HPP_INCLUDED
hms_directed_vertex()
Constructor.
Definition: hms_directed_vertex.hpp:61
void set_metric_space_position(std::vector< double > _values)
Sets the position of the vertex in the metric space.
Definition: hms_directed_vertex.hpp:82
Classes of attributes for edges (ex.: simple edge, weighted edge).
std::vector< double > get_metric_space_position()
Returns the _idx-th coordinate of position of the vertex.
Definition: hms_directed_vertex.hpp:68
Virtual template base class for vertices in directed graphs.
Definition: base_directed_vertex.hpp:33
void clear()
Reinitializes the vertex (specific variables).
Definition: hms_directed_vertex.hpp:96
std::vector< double > get_hidden_variables()
Returns the _idx-th hidden variable.
Definition: hms_directed_vertex.hpp:75
~hms_directed_vertex()
Destructor.
Definition: hms_directed_vertex.hpp:47
Virtual base class for vertices in directed graphs.
void set_hidden_variables(std::vector< double > _values)
Sets the hidden variables.
Definition: hms_directed_vertex.hpp:89
Class for vertices in random directed graphs embedded in a hidden metric space.
Definition: hms_directed_vertex.hpp:29