90 and std::equality_comparable<T>;
100 { a < b } -> std::convertible_to<bool>;
129 template <
typename T =
int>
165 return Base::insert(key);
172 return Base::insert(std::move(key));
180 return Base::search_or_insert(key);
187 return Base::search_or_insert(std::move(key));
195 return Base::contains_or_insert(key);
202 return Base::contains_or_insert(std::move(key));
209 return Base::append(key);
216 return Base::append(std::move(key));
238 Base::remove_ptr(key);
272 (
"", [] (
const std::string & s,
const T & item)
287 template <
typename T>
288 requires AlOrderedDomainKey<T>
and AlStreamable<T>
329 IntRange(
const int start,
const int end,
const int step = 1)
335 for (
long long i = start; i <= end; i += step)
336 (
void)
insert(
static_cast<int>(i));
355 <<
"IntRange(n): n - 1 is above the maximum of int";
357 for (
size_t i = 0; i < n; ++i)
358 (
void)
insert(
static_cast<int>(i));
#define Derived_Build(Name)
Declare build() in a class derived from a container.
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
High-level sorting functions for Aleph containers.
Generic domain class based on hash set.
std::pair< T *, bool > contains_or_insert(T &&key)
This is an overloaded member function, provided for convenience. It differs from the above function o...
T * insert(const T &key)
Insert key, as HashSet::insert(), and forget the sorted keys.
void swap(AlDomain &other) noexcept
Swap the keys, and the sorted keys, with other.
T * search_or_insert(const T &key)
Search or insert key, as HashSet::search_or_insert(), and forget the sorted keys.
T * append(T &&key)
This is an overloaded member function, provided for convenience. It differs from the above function o...
DynList< T > domain
Cached sorted keys.
T * insert(T &&key)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void add(const DynList< T > &l)
Insert the keys of l, as HashSet::add(), and forget the sorted keys.
DynList< T > to_list() const
Convert domain to sorted list.
T * append(const T &key)
Insert key, as HashSet::append(), and forget the sorted keys.
std::string to_str() const and AlStreamable< T >
Convert domain to string representation.
bool keys_build
Lazy cache flag.
void clear()
Remove every key, as HashSet::clear(), and forget the sorted keys.
const DynList< T > & keys() const
Get sorted list of all elements in the domain.
void remove(const T &key)
Remove key, as HashSet::remove(), and forget the sorted keys.
void remove_ptr(T *key)
Remove the key that key points to, as HashSet::remove_ptr(), and forget the sorted keys.
T * search_or_insert(T &&key)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::pair< T *, bool > contains_or_insert(const T &key)
Search or insert key, as HashSet::contains_or_insert(), and forget the sorted keys.
void empty()
Remove every key, as HashSet::empty(), and forget the sorted keys.
Doubly-linked list (defined in tpl_dynList.H).
size_t size() const noexcept
Return the number of items of the list, in constant time.
DynList & swap(DynList &l) noexcept
A key of a domain: of an AlDomain, and so an index of a Vector or of a Matrix.
A key of a domain that < orders: what AlDomain::keys(), and the members that take the keys in their o...
A value that << writes to a stream: what the members that print keys or numbers need.
Main namespace for Aleph-w library functions.
std::decay_t< typename HeadC::Item_Type > T
DynArray< T > sort(const DynArray< T > &a, Cmp &&cmp=Cmp())
Returns a sorted copy of a DynArray.
and
Check uniqueness with explicit hash + equality functors.
std::string to_str(const double d)
Convert double to a std::string with maximum round-trip precision.
std::ostream & operator<<(std::ostream &osObject, const Field< T > &rightOp)
void add(const DynList< Key > &l)
HashSetTable< Key, Cmp > Base
Integer range domain [start, end] with optional step.
IntRange(const int start, const int end, const int step=1)
Construct range [start, end] with step.
IntRange()=delete
Deleted default constructor (range required)
IntRange(const size_t n)
Construct range [0, n-1].
Unified hash table interface.