83 int size()
const override {
return m_pLevel.
size(); }
86 int high()
const override {
return m_pLevel.
high(); }
89 int pos(
node v)
const override {
return m_pos[v]; }
93 return (m_direction == TraversingDir::downward) ? m_lowerAdjNodes[v] :
99 return (dir == TraversingDir::downward) ? m_lowerAdjNodes[v] :
105 return (m_direction == TraversingDir::downward) ? *m_pLevel[i-1] : *m_pLevel[i+1];
128 void permute(RNG &rng);
133 bool transpose(
node v);
135 void print(std::ostream &os)
const;
137 void buildAdjNodes(
int i);
138 void buildAdjNodes();
152 for(
int i = 0; i < m_pLevel.high(); ++i) {
153 Level &level = *m_pLevel[i];
155 for(
int j = 0; j <= level.
high(); ++j)
The parameterized class Array implements dynamic arrays of type E.
NodeArray< Array< node > > m_lowerAdjNodes
(Sorted) adjacent nodes on lower level.
Representation of proper hierarchies used by Sugiyama-layout.
TraversingDir m_direction
The current direction of layer-by-layer sweep.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
void permute()
Permutes the order of nodes on each level.
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
NodeArray< int > m_nSet
(Only used by buildAdjNodes().)
INDEX high() const
Returns the maximal array index.
Declaration of interfaces used in Sugiyama framework.
int high() const override
Returns the maximal array index (= size()-1).
const Array< node > & adjNodes(node v) const
Returns the adjacent nodes of v (according to direction()).
Array< Level * > m_pLevel
The array of all levels.
Representation of levels in hierarchies.
Declaration of Hierarchy class.
void permute(INDEX l, INDEX r)
Randomly permutes the subarray with index set [l..r].
Array< node > m_nodes
The nodes on this level.
Declaration and implementation of Level class.
int high() const override
Returns the maximal array index of a level (= size()-1).
Level & operator[](int i)
Returns the i-th level.
const Array< node > & adjNodes(node v, TraversingDir dir) const override
Returns the adjacent nodes of v.
Declaration and implementation of EdgeArray class.
TraversingDir direction() const
Returns the current direction of layer-by-layer sweep.
INDEX size() const
Returns the size (number of elements) of the array.
Declaration of graph copy classes.
Class for the representation of nodes.
int size() const override
Returns the number of levels.
const Hierarchy & hierarchy() const override
int pos(node v) const override
Returns the position of node v on its level.
void direction(TraversingDir dir)
Sets the current direction of layer-by-layer sweep.
NodeArray< int > m_pos
The position of a node on its level.
The namespace for all OGDF objects.
void print(std::ostream &os, const Array< E, INDEX > &a, char delim=' ')
Prints array a to output stream os using delimiter delim.
const Level & operator[](int i) const override
Returns the i-th level.
NodeArray< Array< node > > m_upperAdjNodes
(Sorted) adjacent nodes on upper level.
const Level & adjLevel(int i) const
Returns the adjacent level of level i (according to direction()).
Representation of proper hierarchies used by Sugiyama-layout.