Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::HyperGraph::GraphArray< T, E > Class Template Reference

#include <ogdf/basic/HyperGraph.h>

+ Inheritance diagram for ogdf::HyperGraph::GraphArray< T, E >:

Public Member Functions

 GraphArray ()
 
 GraphArray (HyperGraph *pGraph)
 Creates a graph array attached to pGraph. More...
 
 GraphArray (HyperGraph *pGraph, const T &initialValue)
 Creates a graph array attached to pGraph with default value initialValue. More...
 
virtual ~GraphArray ()
 Destructor. More...
 
HyperGraph * graph () const
 Returns the graph the array is attached to. More...
 
const T & operator[] (const E *e) const
 Returns a const reference to the entry for an indexed element. More...
 
T & operator[] (const E *e)
 Returns a reference to the entry for an indexed element. More...
 

Protected Member Functions

virtual void setSize (int numElements)
 Implementation of GraphArrayBase::setSize(int). More...
 
- Protected Member Functions inherited from ogdf::Array< T >
 Array ()
 Creates an array with empty index set. More...
 
 Array (int s)
 Creates an array with index set [0..s-1]. More...
 
 Array (int a, int b)
 Creates an array with index set [a..b]. More...
 
 Array (int a, int b, const T &x)
 Creates an array with index set [a..b] and initializes each element with x. More...
 
 Array (std::initializer_list< T > initList)
 Creates an array containing the elements in the initializer list initList. More...
 
 Array (const Array< T, int > &A)
 Creates an array that is a copy of A. More...
 
 Array (Array< T, int > &&A)
 Creates an array containing the elements of A (move semantics). More...
 
 Array (const ArrayBuffer< T, int > &A)
 Creates an array that is a copy of A. The array-size is set to be the number of elements (not the capacity) of the buffer. More...
 
 ~Array ()
 Destruction. More...
 
int low () const
 Returns the minimal array index. More...
 
int high () const
 Returns the maximal array index. More...
 
int size () const
 Returns the size (number of elements) of the array. More...
 
bool empty () const
 Returns true iff there are no elements in the array. More...
 
const_reference operator[] (int i) const
 Returns a reference to the element at position i. More...
 
reference operator[] (int i)
 Returns a reference to the element at position i. More...
 
iterator begin ()
 Returns an iterator to the first element. More...
 
const_iterator begin () const
 Returns a const iterator to the first element. More...
 
const_iterator cbegin () const
 Returns a const iterator to the first element. More...
 
iterator end ()
 Returns an iterator to one past the last element. More...
 
const_iterator end () const
 Returns a const iterator to one past the last element. More...
 
const_iterator cend () const
 Returns a const iterator to one past the last element. More...
 
iterator rbegin ()
 Returns an iterator to the last element. More...
 
const_iterator rbegin () const
 Returns a const iterator to the last element. More...
 
const_iterator crbegin () const
 Returns a const iterator to the last element. More...
 
iterator rend ()
 Returns an iterator to one before the first element. More...
 
const_iterator rend () const
 Returns a const iterator to one before the first element. More...
 
const_iterator crend () const
 Returns a const iterator to one before the first element. More...
 
void init ()
 Reinitializes the array to an array with empty index set. More...
 
void init (int s)
 Reinitializes the array to an array with index set [0..s-1]. More...
 
void init (int a, int b)
 Reinitializes the array to an array with index set [a..b]. More...
 
void init (int a, int b, const T &x)
 Reinitializes the array to an array with index set [a..b] and sets all entries to x. More...
 
void fill (const T &x)
 Sets all elements to x. More...
 
void fill (int i, int j, const T &x)
 Sets elements in the intervall [i..j] to x. More...
 
void grow (int add, const T &x)
 Enlarges the array by add elements and sets new elements to x. More...
 
void grow (int add)
 Enlarges the array by add elements. More...
 
void resize (int newSize, const T &x)
 Resizes (enlarges or shrinks) the array to hold newSize elements and sets new elements to x. More...
 
void resize (int newSize)
 Resizes (enlarges or shrinks) the array to hold newSize elements. More...
 
Array< T, int > & operator= (const Array< T, int > &A)
 Assignment operator. More...
 
Array< T, int > & operator= (Array< T, int > &&A)
 Assignment operator (move semantics). More...
 
void swap (int i, int j)
 Swaps the elements at position i and j. More...
 
void permute (int l, int r)
 Randomly permutes the subarray with index set [l..r]. More...
 
void permute ()
 Randomly permutes the array. More...
 
void permute (int l, int r, RNG &rng)
 Randomly permutes the subarray with index set [l..r] using random number generator rng. More...
 
void permute (RNG &rng)
 Randomly permutes the array using random number generator rng. More...
 
int binarySearch (const T &e) const
 Performs a binary search for element e. More...
 
int binarySearch (int l, int r, const T &e) const
 Performs a binary search for element e within the array section [l, ..., r] . More...
 
int binarySearch (const T &e, const COMPARER &comp) const
 Performs a binary search for element e with comparer comp. More...
 
int binarySearch (int l, int r, const T &e, const COMPARER &comp) const
 Performs a binary search for element e within the array section [l, ..., r] with comparer comp. More...
 
int linearSearch (const T &e) const
 Performs a linear search for element e. More...
 
int linearSearch (const T &e, const COMPARER &comp) const
 Performs a linear search for element e with comparer comp. More...
 
void quicksort ()
 Sorts array using Quicksort. More...
 
void quicksort (int l, int r)
 Sorts subarray with index set [l, ..., r] using Quicksort. More...
 
void quicksort (const COMPARER &comp)
 Sorts array using Quicksort and a user-defined comparer comp. More...
 
void quicksort (int l, int r, const COMPARER &comp)
 Sorts the subarray with index set [l, ..., r] using Quicksort and a user-defined comparer comp. More...
 
void leftShift (ArrayBuffer< int, int > &ind)
 Removes the components listed in ind by shifting the remaining components to the left. More...
 
void leftShift (ArrayBuffer< int, int > &ind, const T &val)
 Removes the components listed in ind by shifting the remaining components to the left. More...
 

Protected Attributes

T m_initialValue
 The initial value for unset entries. More...
 
HyperGraph * m_pGraph
 The graph the array is attached to. More...
 

Friends

class HyperGraph
 

Additional Inherited Members

- Protected Types inherited from ogdf::Array< T >
using const_iterator = const T *
 Provides a random-access iterator that can read a const element in an array. More...
 
using const_reference = const T &
 Provides a reference to a const element stored in an array for reading and performing const operations. More...
 
using iterator = T *
 Provides a random-access iterator that can read or modify any element in an array. More...
 
using reference = T &
 Provides a reference to an element stored in an array. More...
 
using value_type = T
 Represents the data type stored in an array element. More...
 
- Static Protected Attributes inherited from ogdf::Array< T >
static const int maxSizeInsertionSort
 Threshold used by quicksort() such that insertion sort is called for instances smaller than maxSizeInsertionSort. More...
 
- Private Attributes inherited from ogdf::HyperGraph::GraphArrayBase< E >
GraphArrayBase< E > * m_next
 

the embedded prev pointer.

More...
 
GraphArrayBase< E > * m_prev
 

Detailed Description

template<typename T, typename E>
class ogdf::HyperGraph::GraphArray< T, E >

Definition at line 176 of file HyperGraph.h.

Constructor & Destructor Documentation

◆ GraphArray() [1/3]

template<typename T, typename E>
ogdf::HyperGraph::GraphArray< T, E >::GraphArray ( )
inline

Definition at line 181 of file HyperGraph.h.

◆ GraphArray() [2/3]

template<typename T, typename E>
ogdf::HyperGraph::GraphArray< T, E >::GraphArray ( HyperGraph *  pGraph)
inlineexplicit

Creates a graph array attached to pGraph.

Definition at line 184 of file HyperGraph.h.

◆ GraphArray() [3/3]

template<typename T, typename E>
ogdf::HyperGraph::GraphArray< T, E >::GraphArray ( HyperGraph *  pGraph,
const T &  initialValue 
)
inline

Creates a graph array attached to pGraph with default value initialValue.

Definition at line 193 of file HyperGraph.h.

◆ ~GraphArray()

template<typename T, typename E>
virtual ogdf::HyperGraph::GraphArray< T, E >::~GraphArray ( )
inlinevirtual

Destructor.

If the array is attached to a graph, the array will be detached before it is deallocated.

Definition at line 201 of file HyperGraph.h.

Member Function Documentation

◆ graph()

template<typename T, typename E>
HyperGraph* ogdf::HyperGraph::GraphArray< T, E >::graph ( ) const
inline

Returns the graph the array is attached to.

Definition at line 220 of file HyperGraph.h.

◆ operator[]() [1/2]

template<typename T, typename E>
const T& ogdf::HyperGraph::GraphArray< T, E >::operator[] ( const E *  e) const
inline

Returns a const reference to the entry for an indexed element.

Definition at line 208 of file HyperGraph.h.

◆ operator[]() [2/2]

template<typename T, typename E>
T& ogdf::HyperGraph::GraphArray< T, E >::operator[] ( const E *  e)
inline

Returns a reference to the entry for an indexed element.

Definition at line 214 of file HyperGraph.h.

◆ setSize()

template<typename T, typename E>
virtual void ogdf::HyperGraph::GraphArray< T, E >::setSize ( int  numElements)
inlineprotectedvirtual

Implementation of GraphArrayBase::setSize(int).

Implements ogdf::HyperGraph::GraphArrayBase< E >.

Definition at line 228 of file HyperGraph.h.

Friends And Related Function Documentation

◆ HyperGraph

template<typename T, typename E>
friend class HyperGraph
friend

Definition at line 178 of file HyperGraph.h.

Member Data Documentation

◆ m_initialValue

template<typename T, typename E>
T ogdf::HyperGraph::GraphArray< T, E >::m_initialValue
protected

The initial value for unset entries.

Definition at line 238 of file HyperGraph.h.

◆ m_pGraph

template<typename T, typename E>
HyperGraph* ogdf::HyperGraph::GraphArray< T, E >::m_pGraph
protected

The graph the array is attached to.

Definition at line 235 of file HyperGraph.h.


The documentation for this class was generated from the following file: