|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Generic domain class based on hash set. More...
#include <al-domain.H>
Public Types | |
| using | Base = Aleph::HashSet< T, SetODhash > |
| typedef HashSetTable< Key, Cmp > | Base |
Public Types inherited from Aleph::HashSet< Key, HashSetTable, Cmp > | |
| typedef HashSetTable< Key, Cmp > | Base |
Public Member Functions | |
| const DynList< T > & | keys () const |
| Get sorted list of all elements in the domain. | |
| DynList< T > | to_list () const |
| Convert domain to sorted list. | |
| std::string | to_str () const |
| Convert domain to string representation. | |
Public Member Functions inherited from Aleph::HashSet< Key, HashSetTable, Cmp > | |
| void | add (const DynList< Key > &l) |
| template<template< typename > class List> | |
| HashSet (const List< Key > &l) | |
| template<class It > | |
| HashSet (It b, It e) | |
| HashSet (std::initializer_list< Key > l) | |
| HashSet () | |
| Key & | get_first () const |
| Key & | get_last () const |
Private Attributes | |
| bool | keys_build = false |
| Lazy cache flag. | |
| DynList< T > | domain |
| Cached sorted keys. | |
Generic domain class based on hash set.
Stores a set of unique elements with O(1) lookup. Provides sorted iteration via the keys() method.
| T | Element type (default: int) |
Definition at line 84 of file al-domain.H.
| using Aleph::AlDomain< T >::Base = Aleph::HashSet<T, SetODhash> |
Definition at line 91 of file al-domain.H.
| typedef HashSetTable<Key, Cmp> Aleph::HashSet< Key, HashSetTable, Cmp >::Base |
Definition at line 64 of file tpl_hash.H.
Get sorted list of all elements in the domain.
Lazily builds and caches the sorted key list.
Definition at line 101 of file al-domain.H.
References Aleph::AlDomain< T >::domain, Aleph::AlDomain< T >::keys_build, Aleph::maps(), and Aleph::sort().
Referenced by TEST(), TEST_F(), and Aleph::AlDomain< T >::to_list().
Convert domain to sorted list.
Definition at line 115 of file al-domain.H.
References Aleph::AlDomain< T >::keys().
Referenced by TEST_F(), and Aleph::AlDomain< T >::to_str().
|
inline |
Convert domain to string representation.
Definition at line 121 of file al-domain.H.
References Aleph::maps(), Aleph::sort(), Aleph::AlDomain< T >::to_list(), and Aleph::to_str().
Cached sorted keys.
Definition at line 87 of file al-domain.H.
Referenced by Aleph::AlDomain< T >::keys().
Lazy cache flag.
Definition at line 86 of file al-domain.H.
Referenced by Aleph::AlDomain< T >::keys().