|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Set of numerical_type-s. More...
#include <rexlib/core/numerical/numerical_type_domain.hpp>
Public Types | |
| using | mask_type = std::uint32_t |
| Underlying bit mask representation. | |
Public Member Functions | |
| REXLIB_CONSTEXPR | numerical_type_domain () noexcept |
| Construct an empty domain. | |
| REXLIB_CONSTEXPR | numerical_type_domain (mask_type mask) noexcept |
| Construct a domain from its bit mask representation. | |
| REXLIB_CONSTEXPR_CPP14 | numerical_type_domain (std::initializer_list< numerical_type > types) noexcept |
| Construct a domain from an explicit list of types. | |
| numerical_type_domain (const numerical_type_domain &other)=default | |
| numerical_type_domain (numerical_type_domain &&other) noexcept=default | |
| numerical_type_domain & | operator= (const numerical_type_domain &other)=default |
| numerical_type_domain & | operator= (numerical_type_domain &&other) noexcept=default |
| REXLIB_CONSTEXPR bool | contains (numerical_type type) const noexcept |
| Check whether a type belongs to this domain. | |
| REXLIB_CONSTEXPR bool | empty () const noexcept |
| Check whether the domain admits no type at all. | |
| REXLIB_CONSTEXPR mask_type | get_mask () const noexcept |
| Get the bit mask representation of the domain. | |
Static Public Member Functions | |
| static REXLIB_CONSTEXPR numerical_type_domain | all () noexcept |
| Create the domain containing every representable type. | |
| static REXLIB_CONSTEXPR numerical_type_domain | none () noexcept |
| Create the domain containing no type. | |
Friends | |
| REXLIB_CONSTEXPR bool | operator== (const numerical_type_domain &lhs, const numerical_type_domain &rhs) noexcept |
| REXLIB_CONSTEXPR bool | operator!= (const numerical_type_domain &lhs, const numerical_type_domain &rhs) noexcept |
| REXLIB_CONSTEXPR numerical_type_domain | operator& (const numerical_type_domain &lhs, const numerical_type_domain &rhs) noexcept |
| Compute the intersection of two domains. | |
| REXLIB_CONSTEXPR numerical_type_domain | operator| (const numerical_type_domain &lhs, const numerical_type_domain &rhs) noexcept |
| Compute the union of two domains. | |
| std::ostream & | operator<< (std::ostream &os, const numerical_type_domain &domain) |
| Write a human readable representation of a domain. | |
Set of numerical_type-s.
Represents which numerical types are admissible in a given context, such as the operand types an operation accepts or the subset of those a backend is able to execute. Domains compose with the usual set operations, which lets a backend narrow an operation's domain without restating it.
The set is stored as a bit mask indexed by the numerical_type enumerator, so it is a trivially copyable value type.
|
explicitnoexcept |
Construct a domain from its bit mask representation.
| mask | The bit mask, indexed by numerical_type enumerator. |
|
noexcept |
Construct a domain from an explicit list of types.
Types with no bit representation, such as numerical_type::unknown, are ignored.
| types | The types belonging to the domain. |
|
staticnoexcept |
Create the domain containing every representable type.
|
noexcept |
Check whether a type belongs to this domain.
| type | The type to be tested. |
|
noexcept |
Check whether the domain admits no type at all.
|
noexcept |
Get the bit mask representation of the domain.
|
staticnoexcept |
Create the domain containing no type.
|
friend |
Write a human readable representation of a domain.
The types are listed in enumerator order, separated by commas.
| os | The stream where the domain is written. |
| domain | The domain to be written. |