Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
39namespace ogdf {
40namespace energybased {
41namespace fmmm {
42
45class 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
64public:
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
80private:
82 int value;
83};
84
85}
86}
87}
Includes declaration of graph class.
Class for the representation of nodes.
Definition Graph_d.h:241
Data structure for representing nodes and an int value (needed for class ogdf/list) to perform bucket...
Definition Node.h:45
void set_Node(node v, int a)
Definition Node.h:71
friend std::istream & operator>>(std::istream &input, Node &A)
Definition Node.h:59
friend std::ostream & operator<<(std::ostream &output, const Node &A)
Definition Node.h:48
node get_node() const
Definition Node.h:78
friend int value(const Node &A)
Definition Node.h:46
The namespace for all OGDF objects.