From Jason Turner

[mdspan.layout.reqmts]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpvcill52_/{from.md → to.md} +165 -0
tmp/tmpvcill52_/{from.md → to.md} RENAMED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##### Requirements <a id="mdspan.layout.reqmts">[[mdspan.layout.reqmts]]</a>
2
+
3
+ A type `M` meets the *layout mapping* requirements if
4
+
5
+ - `M` models `copyable` and `equality_comparable`,
6
+ - `is_nothrow_move_constructible_v<M>` is `true`,
7
+ - `is_nothrow_move_assignable_v<M>` is `true`,
8
+ - `is_nothrow_swappable_v<M>` is `true`, and
9
+ - the following types and expressions are well-formed and have the
10
+ specified semantics.
11
+
12
+ ``` cpp
13
+ typename M::extents_type
14
+ ```
15
+
16
+ *Result:* A type that is a specialization of `extents`.
17
+
18
+ ``` cpp
19
+ typename M::index_type
20
+ ```
21
+
22
+ *Result:* `typename M::extents_type::index_type`.
23
+
24
+ ``` cpp
25
+ typename M::rank_type
26
+ ```
27
+
28
+ *Result:* `typename M::extents_type::rank_type`.
29
+
30
+ ``` cpp
31
+ typename M::layout_type
32
+ ```
33
+
34
+ *Result:* A type `MP` that meets the layout mapping policy
35
+ requirements [[mdspan.layout.policy.reqmts]] and for which
36
+ *`is-mapping-of`*`<MP, M>` is `true`.
37
+
38
+ ``` cpp
39
+ m.extents()
40
+ ```
41
+
42
+ *Result:* `const typename M::extents_type&`
43
+
44
+ ``` cpp
45
+ m(i...)
46
+ ```
47
+
48
+ *Result:* `typename M::index_type`
49
+
50
+ *Returns:* A nonnegative integer less than
51
+ `numeric_limits<typename M::index_type>::max()` and less than or equal
52
+ to `numeric_limits<size_t>::max()`.
53
+
54
+ ``` cpp
55
+ m(i...) == m(static_cast<typename M::index_type>(i)...)
56
+ ```
57
+
58
+ *Result:* `bool`
59
+
60
+ *Returns:* `true`
61
+
62
+ ``` cpp
63
+ m.required_span_size()
64
+ ```
65
+
66
+ *Result:* `typename M::index_type`
67
+
68
+ *Returns:* If the size of the multidimensional index space `m.extents()`
69
+ is 0, then `0`, else `1` plus the maximum value of `m(i...)` for all
70
+ `i`.
71
+
72
+ ``` cpp
73
+ m.is_unique()
74
+ ```
75
+
76
+ *Result:* `bool`
77
+
78
+ *Returns:* `true` only if for every `i` and `j` where `(i != j || ...)`
79
+ is `true`, `m(i...) != m(j...)` is `true`.
80
+
81
+ [*Note 1*: A mapping can return `false` even if the condition is met.
82
+ For certain layouts, it is possibly not feasible to determine
83
+ efficiently whether the layout is unique. — *end note*]
84
+
85
+ ``` cpp
86
+ m.is_exhaustive()
87
+ ```
88
+
89
+ *Result:* `bool`
90
+
91
+ *Returns:* `true` only if for all k in the range
92
+ [0, `m.required_span_size()`) there exists an `i` such that `m(i...)`
93
+ equals k.
94
+
95
+ [*Note 2*: A mapping can return `false` even if the condition is met.
96
+ For certain layouts, it is possibly not feasible to determine
97
+ efficiently whether the layout is exhaustive. — *end note*]
98
+
99
+ ``` cpp
100
+ m.is_strided()
101
+ ```
102
+
103
+ *Result:* `bool`
104
+
105
+ *Returns:* `true` only if for every rank index r of `m.extents()` there
106
+ exists an integer sᵣ such that, for all `i` where (`i`+dᵣ) is a
107
+ multidimensional index in `m.extents()` [[mdspan.overview]],
108
+ `m((i + `dᵣ`)...) - m(i...)` equals sᵣ.
109
+
110
+ [*Note 3*: This implies that for a strided layout
111
+ m(i₀, …, iₖ) = m(0, …, 0) + i₀ × s₀ + … + iₖ × sₖ. — *end note*]
112
+
113
+ [*Note 4*: A mapping can return `false` even if the condition is met.
114
+ For certain layouts, it is possibly not feasible to determine
115
+ efficiently whether the layout is strided. — *end note*]
116
+
117
+ ``` cpp
118
+ m.stride(r)
119
+ ```
120
+
121
+ *Preconditions:* `m.is_strided()` is `true`.
122
+
123
+ *Result:* `typename M::index_type`
124
+
125
+ *Returns:* sᵣ as defined in `m.is_strided()` above.
126
+
127
+ ``` cpp
128
+ M::is_always_unique()
129
+ ```
130
+
131
+ *Result:* A constant expression [[expr.const]] of type `bool`.
132
+
133
+ *Returns:* `true` only if `m.is_unique()` is `true` for all possible
134
+ objects `m` of type `M`.
135
+
136
+ [*Note 5*: A mapping can return `false` even if the above condition is
137
+ met. For certain layout mappings, it is possibly not feasible to
138
+ determine whether every instance is unique. — *end note*]
139
+
140
+ ``` cpp
141
+ M::is_always_exhaustive()
142
+ ```
143
+
144
+ *Result:* A constant expression [[expr.const]] of type `bool`.
145
+
146
+ *Returns:* `true` only if `m.is_exhaustive()` is `true` for all possible
147
+ objects `m` of type `M`.
148
+
149
+ [*Note 6*: A mapping can return `false` even if the above condition is
150
+ met. For certain layout mappings, it is possibly not feasible to
151
+ determine whether every instance is exhaustive. — *end note*]
152
+
153
+ ``` cpp
154
+ M::is_always_strided()
155
+ ```
156
+
157
+ *Result:* A constant expression [[expr.const]] of type `bool`.
158
+
159
+ *Returns:* `true` only if `m.is_strided()` is `true` for all possible
160
+ objects `m` of type `M`.
161
+
162
+ [*Note 7*: A mapping can return `false` even if the above condition is
163
+ met. For certain layout mappings, it is possibly not feasible to
164
+ determine whether every instance is strided. — *end note*]
165
+