Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max > Class Template Reference

Data structure for two-dimensional mappings that are sparse in the second dimension. More...

#include <ogdf/cluster/sync_plan/basic/RegisteredMultiArray.h>

Public Types

using EntryType = UsuallySmallMap< Key2, Value, array_max >
 

Public Member Functions

 RegisteredMultiArray ()=default
 
 RegisteredMultiArray (const RegisteredMultiArray &copy)=default
 
 RegisteredMultiArray (RegisteredMultiArray &&move) noexcept=default
 
template<class... T>
 RegisteredMultiArray (T &&... t)
 
bool contains (const Key1 &k1, const Key2 &k2) const
 
size_t count (const Key1 &k1) const
 
EntryTypeget_all (const Key1 &k1)
 
const EntryTypeget_all (const Key1 &k1) const
 
Value & get_or_create (const Key1 &k1, const Key2 &k2)
 
Value & get_or_raise (const Key1 &k1, const Key2 &k2)
 
const Value & get_or_raise (const Key1 &k1, const Key2 &k2) const
 
bool has (const Key1 &k1) const
 
Value & operator() (const Key1 &k1, const Key2 &k2)
 
RegisteredMultiArrayoperator= (const RegisteredMultiArray &copy)=default
 
RegisteredMultiArrayoperator= (RegisteredMultiArray &&move) noexcept=default
 
void remove (const Key1 &k1, const Key2 &k2)
 

Private Attributes

BaseArray< EntryTypem_array
 

Detailed Description

template<typename Key1, typename Key2, typename Value, template< typename... > class BaseArray, int array_max = 64>
class ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >

Data structure for two-dimensional mappings that are sparse in the second dimension.

This is effectively a RegisteredArray that has two indexing dimensions, the first one uses a regular RegisteredArray, while the second uses UsuallySmallMap as compact representation. We assume that, for most values in the first dimension, there are only very few values in the second dimension. Thus, for most values we only keep the single value in the second dimension or a short std::array through which we can easily seek. If more than array_max values are stored for a first dimension value, we use a std::map to manage the second dimension for this value.

Definition at line 269 of file RegisteredMultiArray.h.

Member Typedef Documentation

◆ EntryType

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
using ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::EntryType = UsuallySmallMap<Key2, Value, array_max>

Definition at line 271 of file RegisteredMultiArray.h.

Constructor & Destructor Documentation

◆ RegisteredMultiArray() [1/4]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::RegisteredMultiArray ( )
default

◆ RegisteredMultiArray() [2/4]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::RegisteredMultiArray ( const RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max > &  copy)
default

◆ RegisteredMultiArray() [3/4]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::RegisteredMultiArray ( RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max > &&  move)
defaultnoexcept

◆ RegisteredMultiArray() [4/4]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
template<class... T>
ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::RegisteredMultiArray ( T &&...  t)
inlineexplicit

Definition at line 279 of file RegisteredMultiArray.h.

Member Function Documentation

◆ contains()

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
bool ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::contains ( const Key1 &  k1,
const Key2 &  k2 
) const
inline

Definition at line 297 of file RegisteredMultiArray.h.

◆ count()

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
size_t ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::count ( const Key1 &  k1) const
inline

Definition at line 299 of file RegisteredMultiArray.h.

◆ get_all() [1/2]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
EntryType& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::get_all ( const Key1 &  k1)
inline

Definition at line 291 of file RegisteredMultiArray.h.

◆ get_all() [2/2]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
const EntryType& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::get_all ( const Key1 &  k1) const
inline

Definition at line 293 of file RegisteredMultiArray.h.

◆ get_or_create()

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
Value& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::get_or_create ( const Key1 &  k1,
const Key2 &  k2 
)
inline

Definition at line 283 of file RegisteredMultiArray.h.

◆ get_or_raise() [1/2]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
Value& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::get_or_raise ( const Key1 &  k1,
const Key2 &  k2 
)
inline

Definition at line 285 of file RegisteredMultiArray.h.

◆ get_or_raise() [2/2]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
const Value& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::get_or_raise ( const Key1 &  k1,
const Key2 &  k2 
) const
inline

Definition at line 287 of file RegisteredMultiArray.h.

◆ has()

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
bool ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::has ( const Key1 &  k1) const
inline

Definition at line 301 of file RegisteredMultiArray.h.

◆ operator()()

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
Value& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::operator() ( const Key1 &  k1,
const Key2 &  k2 
)
inline

Definition at line 281 of file RegisteredMultiArray.h.

◆ operator=() [1/2]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
RegisteredMultiArray& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::operator= ( const RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max > &  copy)
default

◆ operator=() [2/2]

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
RegisteredMultiArray& ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::operator= ( RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max > &&  move)
defaultnoexcept

◆ remove()

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
void ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::remove ( const Key1 &  k1,
const Key2 &  k2 
)
inline

Definition at line 295 of file RegisteredMultiArray.h.

Member Data Documentation

◆ m_array

template<typename Key1 , typename Key2 , typename Value , template< typename... > class BaseArray, int array_max = 64>
BaseArray<EntryType> ogdf::RegisteredMultiArray< Key1, Key2, Value, BaseArray, array_max >::m_array
private

Definition at line 304 of file RegisteredMultiArray.h.


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