Namespaces | |
namespace | gcm |
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 . | |
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) |
Definition at line 110 of file graph_iterators.h.
Definition at line 108 of file graph_iterators.h.
using ogdf::internal::GraphIterator = typedef GraphIteratorBase<GraphObjectPtr, false> |
Definition at line 46 of file graph_iterators.h.
using ogdf::internal::GraphReverseIterator = typedef GraphIteratorBase<GraphObjectPtr, true> |
Definition at line 48 of file graph_iterators.h.
ITERATOR ogdf::internal::chooseIteratorByFastTest | ( | CONTAINER & | container, |
std::function< bool(const TYPE &)> | includeElement | ||
) |
Don't allocate additional space but count the number of feasible elements instead.
Definition at line 109 of file list_templates.h.
ITERATOR ogdf::internal::chooseIteratorBySlowTest | ( | CONTAINER & | container, |
std::function< bool(const TYPE &)> | includeElement, | ||
int | size | ||
) |
Store elements in permuted order and call includeElement at most once per element.
Definition at line 143 of file list_templates.h.
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
.
CONTAINER | Type of the container. Any iterable container that implements size() is applicable. |
TYPE | Type of elements returned by the iterator of the container. |
container | The container that we want to pick an element from. |
includeElement | Specifies 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. |
isFastTest | Should 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. |
Definition at line 186 of file list_templates.h.