Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
al-domain.H File Reference

Integer domain classes for sparse data structures. More...

#include <concepts>
#include <limits>
#include <ostream>
#include <tpl_hash.H>
#include <ahSort.H>
#include <ah-errors.H>
Include dependency graph for al-domain.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Aleph::AlDomain< T >
 Generic domain class based on hash set. More...
 
struct  Aleph::IntRange
 Integer range domain [start, end] with optional step. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Concepts

concept  Aleph::AlDomainKey
 A key of a domain: of an AlDomain, and so an index of a Vector or of a Matrix.
 
concept  Aleph::AlOrderedDomainKey
 A key of a domain that < orders: what AlDomain::keys(), and the members that take the keys in their order, need.
 
concept  Aleph::AlStreamable
 A value that << writes to a stream: what the members that print keys or numbers need.
 

Functions

template<typename T >
requires AlOrderedDomainKey<T>
and AlStreamable< T > std::ostream & Aleph::operator<< (std::ostream &s, const AlDomain< T > &dom)
 Output stream operator for AlDomain.
 

Detailed Description

Integer domain classes for sparse data structures.

This file provides domain classes representing sets of values, primarily used as index domains for sparse matrices and vectors.

Features

  • Hash-based set for O(1) membership testing
  • Sorted key iteration
  • Range-based domain construction

Usage Example

// Create domain [0, 9]
IntRange domain(0, 9);
// Create domain {0, 1, ..., n-1}
IntRange indices(100);
// Create domain with step: {0, 2, 4, 6, 8, 10}
IntRange even(0, 10, 2);
See also
tpl_dynMat.H Sparse matrix using domains
Author
Leandro Rabindranath León

Definition in file al-domain.H.