Loading [MathJax]/extensions/tex2jax.js

Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
37namespace ogdf {
38namespace energybased {
39namespace fmmm {
40
43class Node {
44 friend int value(const Node& A) { return A.value; }
45
46 friend std::ostream& operator<<(std::ostream& output, const Node& A) {
47 output << "node index ";
48 if (A.vertex == nullptr) {
49 output << "nil";
50 } else {
51 output << A.vertex->index();
52 }
53 output << " value " << A.value;
54 return output;
55 }
56
57 friend std::istream& operator>>(std::istream& input, Node& A) {
58 input >> A.value;
59 return input;
60 }
61
62public:
64 Node() {
65 vertex = nullptr;
66 value = 0;
67 }
68
69 void set_Node(node v, int a) {
70 vertex = v;
71 value = a;
72 }
73
74 int get_value() const { return value; }
75
76 node get_node() const { return vertex; }
77
78private:
80 int value;
81};
82
83}
84}
85}
Includes declaration of graph class.
Class for the representation of nodes.
Definition Graph_d.h:177
Data structure for representing nodes and an int value (needed for class ogdf/list) to perform bucket...
Definition Node.h:43
void set_Node(node v, int a)
Definition Node.h:69
friend std::istream & operator>>(std::istream &input, Node &A)
Definition Node.h:57
friend std::ostream & operator<<(std::ostream &output, const Node &A)
Definition Node.h:46
node get_node() const
Definition Node.h:76
friend int value(const Node &A)
Definition Node.h:44
The namespace for all OGDF objects.