Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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  GraphIterator
 
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 >
 

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...
 

Typedef Documentation

◆ GraphArrayConstIterator

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

Definition at line 93 of file graph_iterators.h.

◆ GraphArrayIterator

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

Definition at line 92 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 75 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 110 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 156 of file list_templates.h.