Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::internal Namespace Reference

Classes

class  FaceAdjContainer
 Container for the adjacency entries in a face. More...
 
class  FaceAdjIterator
 Forward iterator for adjacency entries in a face. More...
 
class  GraphArrayIteratorBase
 
class  GraphElement
 The base class for objects used by (hyper)graphs. More...
 
class  GraphIteratorBase
 
class  GraphList
 Lists of graph objects (like nodes, edges, etc.). More...
 
class  GraphListBase
 Base class for GraphElement lists. More...
 
class  GraphObjectContainer
 

Typedefs

template<class ArrayType >
using GraphArrayConstIterator = GraphArrayIteratorBase< ArrayType, true >
 
template<class ArrayType >
using GraphArrayIterator = GraphArrayIteratorBase< ArrayType, false >
 
template<class GraphObjectPtr >
using GraphIterator = GraphIteratorBase< GraphObjectPtr, false >
 
template<class GraphObjectPtr >
using GraphReverseIterator = GraphIteratorBase< GraphObjectPtr, true >
 

Functions

template<typename CONTAINER , typename TYPE , typename ITERATOR >
ITERATOR chooseIteratorByFastTest (CONTAINER &container, std::function< bool(const TYPE &)> includeElement)
 
template<typename CONTAINER , typename TYPE , typename ITERATOR >
ITERATOR chooseIteratorBySlowTest (CONTAINER &container, std::function< bool(const TYPE &)> includeElement, int size)
 
template<typename CONTAINER , typename TYPE , typename ITERATOR >
ITERATOR chooseIteratorFrom (CONTAINER &container, std::function< bool(const TYPE &)> includeElement, bool isFastTest)
 Returns an iterator to a random element in the container. More...
 
template<>
void getAllEdges (const Graph &G, Array< edge > &edges)
 
template<typename CONTAINER >
void getAllEdges (const Graph &G, CONTAINER &edges)
 
template<>
void getAllNodes (const Graph &G, Array< node > &nodes)
 
template<typename CONTAINER >
void getAllNodes (const Graph &G, CONTAINER &nodes)
 

Typedef Documentation

◆ GraphArrayConstIterator

template<class ArrayType >
using ogdf::internal::GraphArrayConstIterator = typedef GraphArrayIteratorBase<ArrayType, true>

Definition at line 104 of file graph_iterators.h.

◆ GraphArrayIterator

template<class ArrayType >
using ogdf::internal::GraphArrayIterator = typedef GraphArrayIteratorBase<ArrayType, false>

Definition at line 103 of file graph_iterators.h.

◆ GraphIterator

template<class GraphObjectPtr >
using ogdf::internal::GraphIterator = typedef GraphIteratorBase<GraphObjectPtr,false>

Definition at line 43 of file graph_iterators.h.

◆ GraphReverseIterator

template<class GraphObjectPtr >
using ogdf::internal::GraphReverseIterator = typedef GraphIteratorBase<GraphObjectPtr,true>

Definition at line 44 of file graph_iterators.h.

Function Documentation

◆ chooseIteratorByFastTest()

template<typename CONTAINER , typename TYPE , typename ITERATOR >
ITERATOR ogdf::internal::chooseIteratorByFastTest ( CONTAINER &  container,
std::function< bool(const TYPE &)>  includeElement 
)
See also
chooseIteratorFrom

Don't allocate additional space but count the number of feasible elements instead.

Definition at line 107 of file list_templates.h.

◆ chooseIteratorBySlowTest()

template<typename CONTAINER , typename TYPE , typename ITERATOR >
ITERATOR ogdf::internal::chooseIteratorBySlowTest ( CONTAINER &  container,
std::function< bool(const TYPE &)>  includeElement,
int  size 
)
See also
chooseIteratorFrom

Store elements in permuted order and call includeElement at most once per element.

Definition at line 142 of file list_templates.h.

◆ chooseIteratorFrom()

template<typename CONTAINER , typename TYPE , typename ITERATOR >
ITERATOR ogdf::internal::chooseIteratorFrom ( CONTAINER &  container,
std::function< bool(const TYPE &)>  includeElement,
bool  isFastTest 
)

Returns an iterator to a random element in the container.

Takes linear time (given that includeElement runs in constant time). An invalid iterator is returned iff no feasible element exists. When includeElement has a non-constant runtime it is recommended to set isFastTest to false.

Template Parameters
CONTAINERType of the container. Any iterable container that implements size() is applicable.
TYPEType of elements returned by the iterator of the container.
Parameters
containerThe container that we want to pick an element from.
includeElementSpecifies for each element whether it is feasible to be chosen. Defaults to all elements being feasible. Must return the same value when called twice with the same element.
isFastTestShould be set to false to prevent querying the same element multiple times for feasibility. Note that this will result in additional space allocated linear in the size of the container.
Returns
An iterator to the picked element or an invalid iterator if no such element exists.

Definition at line 188 of file list_templates.h.

◆ getAllEdges() [1/2]

template<>
void ogdf::internal::getAllEdges ( const Graph G,
Array< edge > &  edges 
)
inline

Definition at line 1469 of file Graph_d.h.

◆ getAllEdges() [2/2]

template<typename CONTAINER >
void ogdf::internal::getAllEdges ( const Graph G,
CONTAINER &  edges 
)
inline

Definition at line 1461 of file Graph_d.h.

◆ getAllNodes() [1/2]

template<>
void ogdf::internal::getAllNodes ( const Graph G,
Array< node > &  nodes 
)
inline

Definition at line 1452 of file Graph_d.h.

◆ getAllNodes() [2/2]

template<typename CONTAINER >
void ogdf::internal::getAllNodes ( const Graph G,
CONTAINER &  nodes 
)
inline

Definition at line 1444 of file Graph_d.h.