Dynamic arrays indexed with faces of a combinatorial embedding. More...
#include <ogdf/basic/FaceArray.h>
Public Types | |
using | const_iterator = internal::GraphArrayConstIterator< FaceArray< T > > |
The type for face array const iterators. | |
using | iterator = internal::GraphArrayIterator< FaceArray< T > > |
The type for face array iterators. | |
using | key_type = face |
The type for array keys. | |
using | value_type = T |
The type for array entries. | |
Public Member Functions | |
FaceArray () | |
Constructs an empty face array associated with no combinatorial embedding. | |
FaceArray (const ConstCombinatorialEmbedding &E) | |
Constructs a face array associated with E . | |
FaceArray (const ConstCombinatorialEmbedding &E, const T &x) | |
Constructs a face array associated with E . | |
FaceArray (const FaceArray< T > &A) | |
Constructs an face array that is a copy of A . | |
FaceArray (FaceArray< T > &&A) | |
Constructs a face array containing the elements of A (move semantics). | |
Access methods | |
These methods provide access to elements, size, and corresponding graph. | |
bool | valid () const |
Returns true iff the array is associated with a combinatorial embedding. | |
const ConstCombinatorialEmbedding * | embeddingOf () const |
Returns a pointer to the associated combinatorial embedding. | |
const T & | operator[] (face f) const |
Returns a reference to the element with index f . | |
T & | operator[] (face f) |
Returns a reference to the element with index f . | |
const T & | operator() (face f) const |
Returns a reference to the element with index f . | |
T & | operator() (face f) |
Returns a reference to the element with index f . | |
Iterators | |
These methods return bidirectional iterators to elements in the array. | |
iterator | begin () |
Returns an iterator to the first entry in the face array. | |
const_iterator | begin () const |
Returns a const iterator to the first entry in the face array. | |
const_iterator | cbegin () const |
Returns a const iterator to the first entry in the face array. | |
iterator | end () |
Returns an iterator to one-past-last entry in the face array. | |
const_iterator | end () const |
Returns a const iterator to one-past-last entry in the face array. | |
const_iterator | cend () const |
Returns a const iterator to one-past-last entry in the face array. | |
Initialization and assignment | |
These methods can be used to reinitialize the array, or to initialize all elements with a given value. | |
void | init () |
Reinitializes the array. Associates the array with no combinatorial embedding. | |
void | init (const ConstCombinatorialEmbedding &E) |
Reinitializes the array. Associates the array with E . | |
void | init (const ConstCombinatorialEmbedding &E, const T &x) |
Reinitializes the array. Associates the array with E . | |
void | fill (const T &x) |
Sets all array elements to x . | |
FaceArray< T > & | operator= (const FaceArray< T > &a) |
Assignment operator. | |
FaceArray< T > & | operator= (FaceArray< T > &&a) |
Assignment operator (move semantics). | |
Static Public Member Functions | |
Helper functions | |
These methods are mainly intended for internal use. | |
static key_type | findSuccKey (key_type key) |
static key_type | findPredKey (key_type key) |
Private Member Functions | |
virtual void | enlargeTable (int newTableSize) |
Virtual function called when table size has to be enlarged. | |
virtual void | reinit (int initTableSize) |
Virtual function called when table has to be reinitialized. | |
Private Member Functions inherited from ogdf::Array< T > | |
Array () | |
Creates an array with empty index set. | |
Array (Array< T, int > &&A) | |
Creates an array containing the elements of A (move semantics). | |
Array (const Array< T, int > &A) | |
Creates an array that is a copy of A . | |
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. | |
Array (int a, int b) | |
Creates an array with index set [a ..b ]. | |
Array (int a, int b, const T &x) | |
Creates an array with index set [a ..b ] and initializes each element with x . | |
Array (int s) | |
Creates an array with index set [0..s-1 ]. | |
Array (std::initializer_list< T > initList) | |
Creates an array containing the elements in the initializer list initList . | |
~Array () | |
Destruction. | |
int | low () const |
Returns the minimal array index. | |
int | high () const |
Returns the maximal array index. | |
int | size () const |
Returns the size (number of elements) of the array. | |
bool | empty () const |
Returns true iff there are no elements in the array. | |
const_reference | operator[] (int i) const |
Returns a reference to the element at position i . | |
reference | operator[] (int i) |
Returns a reference to the element at position i . | |
iterator | begin () |
Returns an iterator to the first element. | |
const_iterator | begin () const |
Returns a const iterator to the first element. | |
const_iterator | cbegin () const |
Returns a const iterator to the first element. | |
iterator | end () |
Returns an iterator to one past the last element. | |
const_iterator | end () const |
Returns a const iterator to one past the last element. | |
const_iterator | cend () const |
Returns a const iterator to one past the last element. | |
reverse_iterator | rbegin () |
Returns an reverse iterator to the last element. | |
const_reverse_iterator | rbegin () const |
Returns a const reverse iterator to the last element. | |
const_reverse_iterator | crbegin () const |
Returns a const reverse iterator to the last element. | |
reverse_iterator | rend () |
Returns an reverse iterator to one before the first element. | |
const_reverse_iterator | rend () const |
Returns a const reverse iterator to one before the first element. | |
const_reverse_iterator | crend () const |
Returns a const reverse iterator to one before the first element. | |
void | init () |
Reinitializes the array to an array with empty index set. | |
void | init (int s) |
Reinitializes the array to an array with index set [0..s-1 ]. | |
void | init (int a, int b) |
Reinitializes the array to an array with index set [a ..b ]. | |
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 . | |
void | fill (const T &x) |
Sets all elements to x . | |
void | fill (int i, int j, const T &x) |
Sets elements in the intervall [i ..j ] to x . | |
void | grow (int add, const T &x) |
Enlarges the array by add elements and sets new elements to x . | |
void | grow (int add) |
Enlarges the array by add elements. | |
void | resize (int newSize, const T &x) |
Resizes (enlarges or shrinks) the array to hold newSize elements and sets new elements to x . | |
void | resize (int newSize) |
Resizes (enlarges or shrinks) the array to hold newSize elements. | |
Array< T, int > & | operator= (const Array< T, int > &A) |
Assignment operator. | |
Array< T, int > & | operator= (Array< T, int > &&A) |
Assignment operator (move semantics). | |
bool | operator== (const Array< T, int > &L) const |
Equality operator. | |
bool | operator!= (const Array< T, int > &L) const |
Inequality operator. | |
void | swap (int i, int j) |
Swaps the elements at position i and j . | |
void | permute (int l, int r) |
Randomly permutes the subarray with index set [l ..r ]. | |
void | permute () |
Randomly permutes the array. | |
void | permute (int l, int r, RNG &rng) |
Randomly permutes the subarray with index set [l ..r ] using random number generator rng . | |
void | permute (RNG &rng) |
Randomly permutes the array using random number generator rng . | |
int | binarySearch (const T &e) const |
Performs a binary search for element e . | |
int | binarySearch (int l, int r, const T &e) const |
Performs a binary search for element e within the array section [l , ..., r ] . | |
int | binarySearch (const T &e, const COMPARER &comp) const |
Performs a binary search for element e with comparer comp . | |
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 . | |
int | linearSearch (const T &e) const |
Performs a linear search for element e . | |
int | linearSearch (const T &e, const COMPARER &comp) const |
Performs a linear search for element e with comparer comp . | |
void | quicksort () |
Sorts array using Quicksort. | |
void | quicksort (int l, int r) |
Sorts subarray with index set [l , ..., r ] using Quicksort. | |
void | quicksort (const COMPARER &comp) |
Sorts array using Quicksort and a user-defined comparer comp . | |
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 . | |
void | leftShift (ArrayBuffer< int, int > &ind) |
Removes the components listed in ind by shifting the remaining components to the left. | |
void | leftShift (ArrayBuffer< int, int > &ind, const T &val) |
Removes the components listed in ind by shifting the remaining components to the left. | |
Private Attributes | |
T | m_x |
The default value for array elements. | |
Additional Inherited Members | |
Protected Member Functions inherited from ogdf::FaceArrayBase | |
FaceArrayBase () | |
Initializes a face array not associated with a combinatorial embedding. | |
FaceArrayBase (const ConstCombinatorialEmbedding *pE) | |
Initializes a face array associated with pE . | |
FaceArrayBase (FaceArrayBase &base) | |
Moves face array base to this face array. | |
virtual | ~FaceArrayBase () |
void | moveRegister (FaceArrayBase &base) |
Moves array registration from base to this array. | |
void | reregister (const ConstCombinatorialEmbedding *pE) |
Associates the array with a new combinatorial embedding. | |
Protected Attributes inherited from ogdf::FaceArrayBase | |
const ConstCombinatorialEmbedding * | m_pEmbedding |
The associated combinatorial embedding. | |
Private Types inherited from ogdf::Array< T > | |
using | const_iterator = ArrayConstIterator< T > |
Provides a random-access iterator that can read a const element in an array. | |
using | const_reference = const T & |
Provides a reference to a const element stored in an array for reading and performing const operations. | |
using | const_reverse_iterator = ArrayConstReverseIterator< T > |
Provides a reverse random-access iterator that can read a const element in an array. | |
using | iterator = ArrayIterator< T > |
Provides a random-access iterator that can read or modify any element in an array. | |
using | reference = T & |
Provides a reference to an element stored in an array. | |
using | reverse_iterator = ArrayReverseIterator< T > |
Provides a reverse random-access iterator that can read or modify any element in an array. | |
using | value_type = T |
Represents the data type stored in an array element. | |
Static Private 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. | |
Dynamic arrays indexed with faces of a combinatorial embedding.
Face arrays represent a mapping from faces to data of type T. They adjust their table size automatically when the number of faces in the corresponding combinatorial embedding increases.
T | is the element type. |
Definition at line 126 of file FaceArray.h.
using ogdf::FaceArray< T >::const_iterator = internal::GraphArrayConstIterator<FaceArray<T> > |
The type for face array const iterators.
Definition at line 138 of file FaceArray.h.
using ogdf::FaceArray< T >::iterator = internal::GraphArrayIterator<FaceArray<T> > |
The type for face array iterators.
Definition at line 136 of file FaceArray.h.
using ogdf::FaceArray< T >::key_type = face |
The type for array keys.
Definition at line 131 of file FaceArray.h.
using ogdf::FaceArray< T >::value_type = T |
The type for array entries.
Definition at line 133 of file FaceArray.h.
|
inline |
Constructs an empty face array associated with no combinatorial embedding.
Definition at line 141 of file FaceArray.h.
|
inline |
Constructs a face array associated with E
.
Definition at line 144 of file FaceArray.h.
|
inline |
Constructs a face array associated with E
.
E | is the associated combinatorial embedding. |
x | is the default value for all array elements. |
Definition at line 152 of file FaceArray.h.
|
inline |
Constructs an face array that is a copy of A
.
Associates the array with the same combinatorial embedding as A
and copies all elements.
Definition at line 160 of file FaceArray.h.
|
inline |
Constructs a face array containing the elements of A
(move semantics).
Face array A
is empty afterwards and not associated with any combinatorial embedding.
Definition at line 166 of file FaceArray.h.
|
inline |
Returns an iterator to the first entry in the face array.
If the face array is empty, a null pointer iterator is returned.
Definition at line 219 of file FaceArray.h.
|
inline |
Returns a const iterator to the first entry in the face array.
If the face array is empty, a null pointer iterator is returned.
Definition at line 225 of file FaceArray.h.
|
inline |
Returns a const iterator to the first entry in the face array.
If the face array is empty, a null pointer iterator is returned.
Definition at line 231 of file FaceArray.h.
|
inline |
Returns a const iterator to one-past-last entry in the face array.
This is always a null pointer iterator.
Definition at line 249 of file FaceArray.h.
|
inline |
Returns a pointer to the associated combinatorial embedding.
Definition at line 178 of file FaceArray.h.
|
inline |
Returns an iterator to one-past-last entry in the face array.
This is always a null pointer iterator.
Definition at line 237 of file FaceArray.h.
|
inline |
Returns a const iterator to one-past-last entry in the face array.
This is always a null pointer iterator.
Definition at line 243 of file FaceArray.h.
|
inlineprivatevirtual |
Virtual function called when table size has to be enlarged.
Implements ogdf::FaceArrayBase.
Definition at line 321 of file FaceArray.h.
|
inline |
Sets all array elements to x
.
Definition at line 281 of file FaceArray.h.
|
inlinestatic |
Definition at line 316 of file FaceArray.h.
|
inlinestatic |
Definition at line 314 of file FaceArray.h.
|
inline |
Reinitializes the array. Associates the array with no combinatorial embedding.
Definition at line 259 of file FaceArray.h.
|
inline |
Reinitializes the array. Associates the array with E
.
Definition at line 265 of file FaceArray.h.
|
inline |
Reinitializes the array. Associates the array with E
.
E | is the associated combinatorial embedding. |
x | is the default value. |
Definition at line 275 of file FaceArray.h.
|
inline |
Returns a reference to the element with index f
.
Definition at line 202 of file FaceArray.h.
|
inline |
Returns a reference to the element with index f
.
Definition at line 195 of file FaceArray.h.
|
inline |
Assignment operator.
Definition at line 289 of file FaceArray.h.
|
inline |
Assignment operator (move semantics).
Face array a
is empty afterwards and not associated with any combinatorial embedding.
Definition at line 300 of file FaceArray.h.
|
inline |
Returns a reference to the element with index f
.
Definition at line 188 of file FaceArray.h.
|
inline |
Returns a reference to the element with index f
.
Definition at line 181 of file FaceArray.h.
|
inlineprivatevirtual |
Virtual function called when table has to be reinitialized.
Implements ogdf::FaceArrayBase.
Definition at line 323 of file FaceArray.h.
|
inline |
Returns true iff the array is associated with a combinatorial embedding.
Definition at line 175 of file FaceArray.h.
|
private |
The default value for array elements.
Definition at line 127 of file FaceArray.h.