Ocean
|
This class implements subset functions. More...
Data Structures | |
class | InternalSubset |
This helper class implements a subset functions. More... | |
Static Public Member Functions | |
template<typename TIndex , typename T > | |
static std::vector< T > | subset (const std::vector< T > &objects, const std::vector< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of an index vector holding the indices of all objects to be used. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | subset (const std::vector< T > &objects, const std::set< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | invertedSubset (const std::vector< T > &objects, const std::unordered_set< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | invertedSubset (const std::vector< T > &objects, const std::set< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | subset (const T *objects, const size_t numberObjects, const TIndex *indices, const size_t numberIndices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | subset (const T *objects, const size_t numberObjects, const std::vector< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | subset (const T *objects, const size_t numberObjects, const std::set< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used. More... | |
template<typename TIndex > | |
static std::vector< TIndex > | invertedIndices (const std::vector< TIndex > &indices, const size_t numberElements) |
Extracts the indices that are not given within a set indices. More... | |
template<typename TIndex > | |
static std::unordered_set< TIndex > | invertedIndices (const std::unordered_set< TIndex > &indices, const size_t numberElements) |
Extracts the indices that are not given within a set indices. More... | |
template<typename TIndex > | |
static std::set< TIndex > | invertedIndices (const std::set< TIndex > &indices, const size_t numberElements) |
Extracts the indices that are not given within a set indices. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | invertedSubset (const T *objects, const size_t numberObjects, const std::unordered_set< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used. More... | |
template<typename TIndex , typename T > | |
static std::vector< T > | invertedSubset (const T *objects, const size_t numberObjects, const std::set< TIndex > &indices) |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used. More... | |
template<typename TIndex , uint8_t tValue> | |
static std::vector< uint8_t > | indices2statements (const std::vector< TIndex > &indices, const size_t numberObjects) |
Converts object indices to an uint8_t vector holding statements for each object. More... | |
template<typename TIndex , uint8_t tValue> | |
static std::vector< uint8_t > | indices2statements (const std::set< TIndex > &indices, const size_t numberObjects) |
Converts object indices to an uint8_t vector holding statements for each object. More... | |
template<typename TIndex , uint8_t tValue> | |
static std::vector< uint8_t > | indices2statements (const std::unordered_set< TIndex > &indices, const size_t numberObjects) |
Converts object indices to an uint8_t vector holding statements for each object. More... | |
template<typename TIndex , uint8_t tValue> | |
static std::vector< uint8_t > | indices2statements (const TIndex *indices, const size_t numberIndices, const size_t numberObjects) |
Converts object indices to an uint8_t vector holding statements for each object. More... | |
template<typename TIndex , uint8_t tValue> | |
static std::vector< TIndex > | statements2indices (const std::vector< uint8_t > &statements) |
Converts an uint8_t vector holding statements for each object into object indices. More... | |
template<typename TIndex , uint8_t tValue> | |
static std::vector< TIndex > | statements2indices (const uint8_t *statements, const size_t numberStatements) |
Converts an uint8_t vector holding statements for each object into object indices. More... | |
template<typename TKey , typename TElement > | |
static void | correspondingElements (const std::map< TKey, TElement > &elementMapA, const std::map< TKey, TElement > &elementMapB, std::vector< TElement > &elementsA, std::vector< TElement > &elementsB) |
Determines corresponding element pairs from two sets of element maps. More... | |
template<typename TIterator > | |
static bool | hasIntersectingElement (const TIterator &firstA, const TIterator &endA, const TIterator &firstB, const TIterator &endB) |
Determines whether two (ordered) sets have at least one intersecting element. More... | |
template<typename T > | |
static bool | hasIntersectingElement (const std::set< T > &setA, const std::set< T > &setB) |
Determines whether two (ordered) sets have at least one intersecting element. More... | |
template<typename T > | |
static bool | hasIntersectingElement (const std::vector< T > &sortedA, const std::vector< T > &sortedB) |
Determines whether two ordered vectors have at least one intersecting element. More... | |
This class implements subset functions.
|
static |
Determines corresponding element pairs from two sets of element maps.
Two elements correspond with each other if they have the same key.
elementMapA | The first map of elements |
elementMapB | The second map of elements |
elementsA | The resulting elements from the first map which have a corresponding element in the second map |
elementsB | The resulting elements from the second map which have a corresponding element in the first map |
TKey | The data type of each key |
TElement | The data type of each element |
|
inlinestatic |
Determines whether two (ordered) sets have at least one intersecting element.
setA | The first set to check, can be empty |
setB | The second set to check, can be empty |
|
inlinestatic |
Determines whether two ordered vectors have at least one intersecting element.
sortedA | The first vector to check, can be empty |
sortedB | The second vector to check, can be empty |
|
static |
Determines whether two (ordered) sets have at least one intersecting element.
Both input sets must be in ascending order.
firstA | The iterator to the first element in the first set |
endA | The iterator to the (exclusive) element after the last element in the first set |
firstB | The iterator to the first element in the second set |
endB | The iterator to the (exclusive) element after the last element in the second set |
|
inlinestatic |
Converts object indices to an uint8_t vector holding statements for each object.
indices | Indices defining the subset of the objects, with range [0, numberObjects) |
numberObjects | Number of objects that can be addressed by the indices |
TIndex | Data type of the index elements |
tValue | Value for objects that are defined in the indices, the inverse value is applied otherwise |
|
inlinestatic |
Converts object indices to an uint8_t vector holding statements for each object.
indices | Indices defining the subset of the objects, with range [0, numberObjects) |
numberObjects | Number of objects that can be addressed by the indices |
TIndex | Data type of the index elements |
tValue | Value for objects that are defined in the indices, the inverse value is applied otherwise |
|
inlinestatic |
Converts object indices to an uint8_t vector holding statements for each object.
indices | Indices defining the subset of the objects, with range [0, numberObjects) |
numberObjects | Number of objects that can be addressed by the indices |
TIndex | Data type of the index elements |
tValue | Value for objects that are defined in the indices, the inverse value is applied otherwise |
|
inlinestatic |
Converts object indices to an uint8_t vector holding statements for each object.
indices | Indices defining the subset of the objects, with range [0, numberObjects) |
numberIndices | Number of provided indices |
numberObjects | Number of objects that can be addressed by the indices |
TIndex | Data type of the index elements |
tValue | Value for objects that are defined in the indices, the inverse value is applied otherwise |
|
static |
Extracts the indices that are not given within a set indices.
indices | The set of given indices, the resulting indices will not contain any of these indices, can contain indices with range [0, maximalIndex] |
numberElements | The number of possible elements defining the entire range of possible indices: [0, numberElements) |
TIndex | Data type of the index elements |
|
static |
Extracts the indices that are not given within a set indices.
indices | The set of given indices, the resulting indices will not contain any of these indices, can contain indices with range [0, maximalIndex] |
numberElements | The number of possible elements defining the entire range of possible indices: [0, numberElements) |
TIndex | Data type of the index elements |
|
static |
Extracts the indices that are not given within a set indices.
indices | The set of given indices, the resulting indices will not contain any of these indices, can contain indices with range [0, maximalIndex] |
numberElements | The number of possible elements defining the entire range of possible indices: [0, numberElements) |
TIndex | Data type of the index elements |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
indices | Indices defining the inverted subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
indices | Indices defining the inverted subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
numberObjects | Number of given objects |
indices | Indices defining the inverted subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be not used.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
numberObjects | Number of given objects |
indices | Indices defining the inverted subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Converts an uint8_t vector holding statements for each object into object indices.
statements | Boolean statement for each object |
TIndex | Data type of the index elements |
tValue | Value for objects that will be defined in the indices |
|
inlinestatic |
Converts an uint8_t vector holding statements for each object into object indices.
statements | Boolean statement for each object |
numberStatements | Number of statements |
TIndex | Data type of the index elements |
tValue | Value for objects that will be defined in the indices |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
indices | Indices defining the subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of an index vector holding the indices of all objects to be used.
If the index data type is an uint8_t, than the (boolean != 0u) statement is used to use the corresponding object or not.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
indices | Indices defining the subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
numberObjects | Number of given objects |
indices | Indices defining the subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used.
If the index data type is an uint8_t, than the (boolean != 0u) statement is used to use the corresponding object or not.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
numberObjects | Number of given objects |
indices | Indices defining the subset to be extracted |
TIndex | Data type of the index elements |
T | Data type of the objects |
|
inlinestatic |
Extracts a subset of a given set of objects by usage of a set of indices of all objects to be used.
If the index data type is an uint8_t, than the (boolean != 0u) statement is used to use the corresponding object or not.
Beware: No range check is done! Thus, each index must not exceed the number of given objects.
objects | Entire set of objects from that a subset will be extracted |
numberObjects | Number of given objects |
indices | Indices defining the subset to be extracted |
numberIndices | Number of given indices |
TIndex | Data type of the index elements |
T | Data type of the objects |