tmp/tmpgmsjze3l/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
###### Constructors <a id="mdspan.layout.stride.cons">[[mdspan.layout.stride.cons]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
constexpr mapping() noexcept;
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Preconditions:*
|
| 8 |
+
`layout_right::mapping<extents_type>().required_span_size()` is
|
| 9 |
+
representable as a value of type `index_type` [[basic.fundamental]].
|
| 10 |
+
|
| 11 |
+
*Effects:* Direct-non-list-initializes *extents\_* with
|
| 12 |
+
`extents_type()`, and for all d in the range \[`0`, *`rank_`*),
|
| 13 |
+
direct-non-list-initializes *`strides_`*`[`d`]` with
|
| 14 |
+
`layout_right::mapping<extents_type>().stride(`d`)`.
|
| 15 |
+
|
| 16 |
+
``` cpp
|
| 17 |
+
template<class OtherIndexType>
|
| 18 |
+
constexpr mapping(const extents_type& e, span<OtherIndexType, rank_> s) noexcept;
|
| 19 |
+
template<class OtherIndexType>
|
| 20 |
+
constexpr mapping(const extents_type& e, const array<OtherIndexType, rank_>& s) noexcept;
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
*Constraints:*
|
| 24 |
+
|
| 25 |
+
- `is_convertible_v<const OtherIndexType&, index_type>` is `true`, and
|
| 26 |
+
- `is_nothrow_constructible_v<index_type, const OtherIndexType&>` is
|
| 27 |
+
`true`.
|
| 28 |
+
|
| 29 |
+
*Preconditions:*
|
| 30 |
+
|
| 31 |
+
- `s[`i`] > 0` is `true` for all i in the range [0, rank_).
|
| 32 |
+
- *`REQUIRED-SPAN-SIZE`*`(e, s)` is representable as a value of type
|
| 33 |
+
`index_type` [[basic.fundamental]].
|
| 34 |
+
- If *rank\_* is greater than 0, then there exists a permutation P of
|
| 35 |
+
the integers in the range [0, rank_), such that
|
| 36 |
+
`s[`pᵢ`] >= s[`pᵢ₋₁`] * e.extent(p`ᵢ₋₁`)` is `true` for all i in the
|
| 37 |
+
range [1, rank_), where pᵢ is the iᵗʰ element of P. \[*Note 3*: For
|
| 38 |
+
`layout_stride`, this condition is necessary and sufficient for
|
| 39 |
+
`is_unique()` to be `true`. — *end note*]
|
| 40 |
+
|
| 41 |
+
*Effects:* Direct-non-list-initializes *extents\_* with `e`, and for all
|
| 42 |
+
d in the range [0, rank_), direct-non-list-initializes `strides_[`d`]`
|
| 43 |
+
with `as_const(s[`d`])`.
|
| 44 |
+
|
| 45 |
+
``` cpp
|
| 46 |
+
template<class StridedLayoutMapping>
|
| 47 |
+
constexpr explicit(see below)
|
| 48 |
+
mapping(const StridedLayoutMapping& other) noexcept;
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
*Constraints:*
|
| 52 |
+
|
| 53 |
+
- `layout-mapping-alike<StridedLayoutMapping>` is satisfied.
|
| 54 |
+
- `is_constructible_v<extents_type, typename StridedLayoutMapping::extents_type>`
|
| 55 |
+
is
|
| 56 |
+
`true`.
|
| 57 |
+
- `StridedLayoutMapping::is_always_unique()` is `true`.
|
| 58 |
+
- `StridedLayoutMapping::is_always_strided()` is `true`.
|
| 59 |
+
|
| 60 |
+
*Preconditions:*
|
| 61 |
+
|
| 62 |
+
- `StridedLayoutMapping` meets the layout mapping
|
| 63 |
+
requirements [[mdspan.layout.policy.reqmts]],
|
| 64 |
+
- `other.stride(`r`) > 0` is `true` for every rank index r of
|
| 65 |
+
`extents()`,
|
| 66 |
+
- `other.required_span_size()` is representable as a value of type
|
| 67 |
+
`index_type` [[basic.fundamental]], and
|
| 68 |
+
- *`OFFSET`*`(other) == 0` is `true`.
|
| 69 |
+
|
| 70 |
+
*Effects:* Direct-non-list-initializes *extents\_* with
|
| 71 |
+
`other.extents()`, and for all d in the range [0, rank_),
|
| 72 |
+
direct-non-list-initializes *`strides_`*`[`d`]` with
|
| 73 |
+
`other.stride(`d`)`.
|
| 74 |
+
|
| 75 |
+
Remarks: The expression inside `explicit` is equivalent to:
|
| 76 |
+
|
| 77 |
+
``` cpp
|
| 78 |
+
!(is_convertible_v<typename StridedLayoutMapping::extents_type, extents_type> &&
|
| 79 |
+
(is-mapping-of<layout_left, LayoutStrideMapping> ||
|
| 80 |
+
is-mapping-of<layout_right, LayoutStrideMapping> ||
|
| 81 |
+
is-mapping-of<layout_stride, LayoutStrideMapping>))
|
| 82 |
+
```
|
| 83 |
+
|