Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
AugmentationModule.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/List.h>
36#include <ogdf/basic/basic.h>
37#include <ogdf/basic/memory.h>
38
39namespace ogdf {
40
57public:
59 AugmentationModule() : m_nAddedEdges(0) { }
60
61 // destruction
62 virtual ~AugmentationModule() { }
63
65 void call(Graph& G) {
66 List<edge> L;
67 call(G, L);
68 }
69
71 void operator()(Graph& G) { call(G); }
72
78 void call(Graph& G, List<edge>& L) {
79 doCall(G, L);
80 m_nAddedEdges = L.size();
81 }
82
88 void operator()(Graph& G, List<edge>& L) { call(G, L); }
89
91 int numberOfAddedEdges() const { return m_nAddedEdges; }
92
93protected:
99 virtual void doCall(Graph& G, List<edge>& L) = 0;
100
101private:
103
105};
106
107}
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Basic declarations, included by all source files.
The base class for graph augmentation algorithms.
void operator()(Graph &G, List< edge > &L)
Calls the augmentation module for graph G.
int numberOfAddedEdges() const
Returns the number of added edges.
void call(Graph &G, List< edge > &L)
Calls the augmentation module for graph G.
void operator()(Graph &G)
Calls the augmentation module for graph G.
virtual void doCall(Graph &G, List< edge > &L)=0
Implements the augmentation algorithm for graph G.
AugmentationModule()
Initializes an augmentation module.
void call(Graph &G)
Calls the augmentation module for graph G.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
int size() const
Returns the number of elements in the list.
Definition List.h:1488
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition memory.h:92
Declaration of memory manager for allocating small pieces of memory.
The namespace for all OGDF objects.