Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Node.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Graph.h>
36 
37 #include <istream>
38 
39 namespace ogdf {
40 namespace energybased {
41 namespace fmmm {
42 
45 class Node {
46  friend int value(const Node& A) { return A.value; }
47 
48  friend std::ostream& operator<<(std::ostream& output, const Node& A) {
49  output << "node index ";
50  if (A.vertex == nullptr) {
51  output << "nil";
52  } else {
53  output << A.vertex->index();
54  }
55  output << " value " << A.value;
56  return output;
57  }
58 
59  friend std::istream& operator>>(std::istream& input, Node& A) {
60  input >> A.value;
61  return input;
62  }
63 
64 public:
66  Node() {
67  vertex = nullptr;
68  value = 0;
69  }
70 
71  void set_Node(node v, int a) {
72  vertex = v;
73  value = a;
74  }
75 
76  int get_value() const { return value; }
77 
78  node get_node() const { return vertex; }
79 
80 private:
82  int value;
83 };
84 
85 }
86 }
87 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::energybased::fmmm::Node::set_Node
void set_Node(node v, int a)
Definition: Node.h:71
ogdf::whaType::A
@ A
ogdf::energybased::fmmm::Node
Data structure for representing nodes and an int value (needed for class ogdf/list) to perform bucket...
Definition: Node.h:45
ogdf::energybased::fmmm::Node::get_node
node get_node() const
Definition: Node.h:78
ogdf::energybased::fmmm::Node::value
int value
Definition: Node.h:82
ogdf::energybased::fmmm::Node::Node
Node()
Constructor.
Definition: Node.h:66
ogdf::energybased::fmmm::Node::operator>>
friend std::istream & operator>>(std::istream &input, Node &A)
Definition: Node.h:59
ogdf::energybased::fmmm::Node::get_value
int get_value() const
Definition: Node.h:76
ogdf::energybased::fmmm::Node::value
friend int value(const Node &A)
Definition: Node.h:46
ogdf::energybased::fmmm::Node::operator<<
friend std::ostream & operator<<(std::ostream &output, const Node &A)
Definition: Node.h:48
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::energybased::fmmm::Node::vertex
node vertex
Definition: Node.h:81