alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
interval.hpp
Go to the documentation of this file.
1/* Copyright 2025 Tim Hanel
2 * SPDX-License-Identifier: MPL-2.0
3 */
4#pragma once
5#include <type_traits>
6
8{
9 namespace detail
10 {
11 struct IntervalBase
12 {
13 };
14 } // namespace detail
15
16 namespace trait
17 {
18 template<typename T_Interval>
19 struct IsInterval : std::is_base_of<detail::IntervalBase, T_Interval>
20 {
21 };
22 } // namespace trait
23
24 /** @brief Interval-tag type (a, b]: open (exclusive) at the lower bound, closed (inclusive) at the upper bound. */
25 struct OC : detail::IntervalBase
26 {
27 };
28
29 /** @brief Interval-tag (a, b] object instance @see OC for details */
30 constexpr OC oc{};
31
32 /** @brief Interval-tag type [a, b): closed (inclusive) at the lower bound, open (exclusive) at the upper bound. */
33 struct CO : detail::IntervalBase
34 {
35 };
36
37 /** @brief Interval-tag [a, b) object instance @see CO for details */
38 constexpr CO co{};
39
40 /** @brief Interval-tag type [a, b]: closed (inclusive) at both the lower and upper bounds. */
41 struct CC : detail::IntervalBase
42 {
43 };
44
45 /** @brief Interval-tag [a, b] object instance @see CC for details */
46 constexpr CC cc{};
47
48 /** @brief Interval-tag type (a, b): open (exclusive) at both the lower and upper bounds. */
49 struct OO : detail::IntervalBase
50 {
51 };
52
53 /** @brief Interval-tag (a, b) object instance @see OO for details */
54 constexpr OO oo{};
55
56 template<typename T>
58} // namespace alpaka::rand::interval
constexpr OO oo
Interval-tag (a, b) object instance.
Definition interval.hpp:54
constexpr CO co
Interval-tag [a, b) object instance.
Definition interval.hpp:38
constexpr bool isInterval_v
Definition interval.hpp:57
constexpr CC cc
Interval-tag [a, b] object instance.
Definition interval.hpp:46
constexpr OC oc
Interval-tag (a, b] object instance.
Definition interval.hpp:30
Interval-tag type [a, b]: closed (inclusive) at both the lower and upper bounds.
Definition interval.hpp:42
Interval-tag type [a, b): closed (inclusive) at the lower bound, open (exclusive) at the upper bound.
Definition interval.hpp:34
Interval-tag type (a, b]: open (exclusive) at the lower bound, closed (inclusive) at the upper bound.
Definition interval.hpp:26
Interval-tag type (a, b): open (exclusive) at both the lower and upper bounds.
Definition interval.hpp:50