From Jason Turner

[mdspan.layout.leftpad.cons]

Diff to HTML by rtfpessoa

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