|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Integer range domain [start, end] with optional step. More...
#include <al-domain.H>
Public Member Functions | |
| IntRange ()=delete | |
| Deleted default constructor (range required) | |
| IntRange (const int start, const int end, const int step=1) | |
| Construct range [start, end] with step. | |
| IntRange (const size_t n) | |
| Construct range [0, n-1]. | |
Public Member Functions inherited from Aleph::AlDomain< int > | |
| const DynList< int > & | keys () const |
| Get sorted list of all elements in the domain. | |
| DynList< int > | 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 |
Additional Inherited Members | |
Public Types inherited from Aleph::AlDomain< int > | |
| using | Base = Aleph::HashSet< int, SetODhash > |
| typedef HashSetTable< Key, Cmp > | Base |
Public Types inherited from Aleph::HashSet< Key, HashSetTable, Cmp > | |
| typedef HashSetTable< Key, Cmp > | Base |
Integer range domain [start, end] with optional step.
Specialized domain for integer ranges, commonly used as indices for sparse matrices and vectors.
| Constructor | Result |
|---|---|
| IntRange(5) | {0, 1, 2, 3, 4} |
| IntRange(0, 4) | {0, 1, 2, 3, 4} |
| IntRange(0, 10, 2) | {0, 2, 4, 6, 8, 10} |
Definition at line 161 of file al-domain.H.
|
delete |
Deleted default constructor (range required)
Construct range [start, end] with step.
| start | First value in range |
| end | Last value in range (inclusive) |
| step | Increment between values (default 1) |
| std::domain_error | if step is negative |
Definition at line 180 of file al-domain.H.
References ah_domain_error_if, and Aleph::maps().
Construct range [0, n-1].
| n | Number of elements (0 to n-1) |
Definition at line 198 of file al-domain.H.