From Jason Turner

[mdspan.layout.rightpad.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpq09ygjwx/{from.md → to.md} +206 -0
tmp/tmpq09ygjwx/{from.md → to.md} RENAMED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ###### Constructors <a id="mdspan.layout.rightpad.cons">[[mdspan.layout.rightpad.cons]]</a>
2
+
3
+ ``` cpp
4
+ constexpr mapping(const extents_type& ext);
5
+ ```
6
+
7
+ *Preconditions:*
8
+
9
+ - The size of the multidimensional index space `ext` is representable as
10
+ a value of type `index_type`.
11
+ - If *rank\_* is greater than one and `padding_value` does not equal
12
+ `dynamic_extent`, then
13
+ *`LEAST-MULTIPLE-AT-LEAST`*`(padding_value, ext.extent(`*`rank_`*` - 1))`
14
+ is representable as a value of type *index_type*.
15
+ - If *rank\_* is greater than one and `padding_value` does not equal
16
+ `dynamic_extent`, then the product of
17
+ *`LEAST-MULTIPLE-AT-LEAST`*`(padding_value, ext.extent(`*`rank_`*` - 1))`
18
+ and all values `ext.extent(`k`)` with k in the range of \[`0`,
19
+ *`rank_`*` - 1`) is representable as a value of type `index_type`.
20
+
21
+ *Effects:*
22
+
23
+ - Direct-non-list-initializes *extents\_* with `ext`; and
24
+ - if *rank\_* is greater than one, direct-non-list-initializes
25
+ *stride-rm2*
26
+ - with `ext.extent(`*`rank_`*` - 1)` if `padding_value` is
27
+ `dynamic_extent`,
28
+ - otherwise with
29
+ *`LEAST-MULTIPLE-AT-LEAST`*`(padding_value, ext.extent(`*`rank_`*` - 1))`.
30
+
31
+ ``` cpp
32
+ template<class OtherIndexType>
33
+ constexpr mapping(const extents_type& ext, OtherIndexType pad);
34
+ ```
35
+
36
+ *Constraints:*
37
+
38
+ - `is_convertible_v<OtherIndexType, index_type>` is `true`.
39
+ - `is_nothrow_constructible_v<index_type, OtherIndexType>` is `true`.
40
+
41
+ *Preconditions:*
42
+
43
+ - `pad` is representable as a value of type `index_type`.
44
+ - `extents_type::`*`index-cast`*`(pad)` is greater than zero.
45
+ - If *rank\_* is greater than one, then
46
+ *`LEAST-MULTIPLE-AT-LEAST`*`(pad, ext.extent(`*`rank_`*` - 1))` is
47
+ representable as a value of type `index_type`.
48
+ - If *rank\_* is greater than one, then the product of
49
+ *`LEAST-MULTIPLE-AT-LEAST`*`(pad, ext.extent(`*`rank_`*` - 1))` and
50
+ all values `ext.extent(`k`)` with k in the range of \[`0`,
51
+ *`rank_`*` - 1`) is representable as a value of type `index_type`.
52
+ - If `padding_value` is not equal to `dynamic_extent`, `padding_value`
53
+ equals `extents_type::`*`index-cast`*`(pad)`.
54
+
55
+ *Effects:* Direct-non-list-initializes *extents\_* with `ext`, and if
56
+ *rank\_* is greater than one, direct-non-list-initializes *stride-rm2*
57
+ with *`LEAST-MULTIPLE-AT-LEAST`*`(pad, ext.extent(`*`rank_`*` - 1))`.
58
+
59
+ ``` cpp
60
+ template<class OtherExtents>
61
+ constexpr explicit(!is_convertible_v<OtherExtents, extents_type>)
62
+ mapping(const layout_right::mapping<OtherExtents>& other);
63
+ ```
64
+
65
+ *Constraints:* `is_constructible_v<extents_type, OtherExtents>` is
66
+ `true`.
67
+
68
+ *Mandates:* If `OtherExtents::rank()` is greater than 1, then
69
+
70
+ ``` cpp
71
+ (static-padding-stride == dynamic_extent) ||
72
+ (OtherExtents::static_extent(rank_ - 1) == dynamic_extent) ||
73
+ (static-padding-stride == OtherExtents::static_extent(rank_ - 1))
74
+ ```
75
+
76
+ is `true`.
77
+
78
+ *Preconditions:*
79
+
80
+ - If *`rank_`*` > 1` is `true` and `padding_value == dynamic_extent` is
81
+ `false`, then `other.stride( `*`rank_`*` - 2)` equals
82
+ ``` cpp
83
+ LEAST-MULTIPLE-AT-LEAST(padding_value,
84
+ extents_type::index-cast(other.extents().extent(rank_ - 1)))
85
+ ```
86
+
87
+ and
88
+ - `other.required_span_size()` is representable as a value of type
89
+ `index_type`.
90
+
91
+ *Effects:* Equivalent to `mapping(other.extents())`.
92
+
93
+ ``` cpp
94
+ template<class OtherExtents>
95
+ constexpr explicit(rank_ > 0)
96
+ mapping(const layout_stride::mapping<OtherExtents>& other);
97
+ ```
98
+
99
+ *Constraints:* `is_constructible_v<extents_type, OtherExtents>` is
100
+ `true`.
101
+
102
+ *Preconditions:*
103
+
104
+ - If *rank\_* is greater than 1 and `padding_value` does not equal
105
+ `dynamic_extent`, then `other.stride(`*`rank_`*` - 2)` equals
106
+ ``` cpp
107
+ LEAST-MULTIPLE-AT-LEAST(padding_value,
108
+ extents_type::index-cast(other.extents().extent(rank_ - 1)))
109
+ ```
110
+ - If *rank\_* is greater than 0, then other.stride(*rank\_* - 1) equals
111
+ 1.
112
+ - If *rank\_* is greater than 2, then for all r in the range \[`0`,
113
+ *`rank_`*` - 2`), `other.stride(`r`)` equals
114
+ ``` cpp
115
+ (other.extents().rev-prod-of-extents(r) / other.extents().extent(rank_ - 1)) *
116
+ other.stride(rank_ - 2)
117
+ ```
118
+ - `other.required_span_size()` is representable as a value of type
119
+ `index_type`.
120
+
121
+ *Effects:*
122
+
123
+ - Direct-non-list-initializes *extents\_* with `other.extents()`; and
124
+ - if *rank\_* is greater than one, direct-non-list-initializes
125
+ *stride-rm2* with `other.stride(`*`rank_`*` - 2)`.
126
+
127
+ ``` cpp
128
+ template<class LayoutRightPaddedMapping>
129
+ constexpr explicit(see below)
130
+ mapping(const LayoutRightPaddedMapping& other);
131
+ ```
132
+
133
+ *Constraints:*
134
+
135
+ - *`is-layout-right-padded-mapping-of`*`<LayoutRightPaddedMapping>` is
136
+ `true`.
137
+ - `is_constructible_v<extents_type, typename LayoutRightPaddedMapping::extents_- type>`
138
+ is `true`.
139
+
140
+ *Mandates:* If *rank\_* is greater than 1, then
141
+
142
+ ``` cpp
143
+ padding_value == dynamic_extent ||
144
+ LayoutRightPaddedMapping::padding_value == dynamic_extent ||
145
+ padding_value == LayoutRightPaddedMapping::padding_value
146
+ ```
147
+
148
+ is `true`.
149
+
150
+ *Preconditions:*
151
+
152
+ - If *rank\_* is greater than 1 and `padding_value` does not equal
153
+ `dynamic_extent`, then `other.stride(`*`rank_`*` - 2)` equals
154
+ ``` cpp
155
+ LEAST-MULTIPLE-AT-LEAST(padding_value,
156
+ extents_type::index-cast(other.extent(rank_ - 1)))
157
+ ```
158
+ - `other.required_span_size()` is representable as a value of type
159
+ `index_type`.
160
+
161
+ *Effects:*
162
+
163
+ - Direct-non-list-initializes *extents\_* with `other.extents()`; and
164
+ - if *rank\_* is greater than one, direct-non-list-initializes
165
+ *stride-rm2* with `other.stride(rank_ - 2)`.
166
+
167
+ *Remarks:* The expression inside `explicit` is equivalent to:
168
+
169
+ ``` cpp
170
+ rank_ > 1 &&
171
+ (padding_value != dynamic_extent ||
172
+ LayoutRightPaddedMapping::padding_value == dynamic_extent)
173
+ ```
174
+
175
+ ``` cpp
176
+ template<class LayoutLeftPaddedMapping>
177
+ constexpr explicit(see below)
178
+ mapping(const LayoutLeftPaddedMapping& other) noexcept;
179
+ ```
180
+
181
+ *Constraints:*
182
+
183
+ - *`is-layout-left-padded-mapping-of`*`<LayoutLeftPaddedMapping>` is
184
+ `true` or *`is-mapping-of`*`<layout_left, LayoutLeftPaddedMapping>` is
185
+ `true`.
186
+ - *rank\_* equals zero or one.
187
+ - `is_constructible_v<extents_type, typename LayoutLeftPaddedMapping::extents_type>`
188
+ is `true`.
189
+
190
+ *Preconditions:* `other.required_span_size()` is representable as a
191
+ value of type `index_type`.
192
+
193
+ *Effects:* Direct-non-list-initializes *extents\_* with
194
+ `other.extents()`.
195
+
196
+ *Remarks:* The expression inside `explicit` is equivalent to:
197
+
198
+ ``` cpp
199
+ !is_convertible_v<typename LayoutLeftPaddedMapping::extents_type, extents_type>
200
+ ```
201
+
202
+ [*Note 12*: Neither the input mapping nor the mapping to be constructed
203
+ uses the padding stride in the rank-0 or rank-1 case, so the padding
204
+ stride affects neither the constraints nor the
205
+ preconditions. — *end note*]
206
+