tmp/tmpgjph9l65/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Observers <a id="linalg.layout.packed.obs">[[linalg.layout.packed.obs]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
constexpr index_type required_span_size() const noexcept;
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Returns:* *`extents_`*`.extent(0) * (`*`extents_`*`.extent(0) + 1)/2`.
|
| 8 |
+
|
| 9 |
+
[*Note 1*: For example, a 5 x 5 packed matrix only stores 15 matrix
|
| 10 |
+
elements. — *end note*]
|
| 11 |
+
|
| 12 |
+
``` cpp
|
| 13 |
+
template<class Index0, class Index1>
|
| 14 |
+
constexpr index_type operator() (Index0 ind0, Index1 ind1) const noexcept;
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
*Constraints:*
|
| 18 |
+
|
| 19 |
+
- `is_convertible_v<Index0, index_type>` is `true`,
|
| 20 |
+
- `is_convertible_v<Index1, index_type>` is `true`,
|
| 21 |
+
- `is_nothrow_constructible_v<index_type, Index0>` is `true`, and
|
| 22 |
+
- `is_nothrow_constructible_v<index_type, Index1>` is `true`.
|
| 23 |
+
|
| 24 |
+
Let `i` be `extents_type::`*`index-cast`*`(ind0)`, and let `j` be
|
| 25 |
+
`extents_type::`*`index-cast`*`(ind1)`.
|
| 26 |
+
|
| 27 |
+
*Preconditions:* `i, j` is a multidimensional index in
|
| 28 |
+
*extents\_*[[mdspan.overview]].
|
| 29 |
+
|
| 30 |
+
*Returns:* Let `N` be *`extents_`*`.extent(0)`. Then
|
| 31 |
+
|
| 32 |
+
- `(*this)(j, i)` if `i > j` is `true`; otherwise
|
| 33 |
+
- `i + j * (j + 1)/2` if
|
| 34 |
+
``` cpp
|
| 35 |
+
is_same_v<StorageOrder, column_major_t> && is_same_v<Triangle, upper_triangle_t>
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
is `true` or
|
| 39 |
+
``` cpp
|
| 40 |
+
is_same_v<StorageOrder, row_major_t> && is_same_v<Triangle, lower_triangle_t>
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
is `true`; otherwise
|
| 44 |
+
- `j + N * i - i * (i + 1)/2`.
|
| 45 |
+
|
| 46 |
+
``` cpp
|
| 47 |
+
constexpr index_type stride(rank_type r) const noexcept;
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
*Preconditions:*
|
| 51 |
+
|
| 52 |
+
- `is_strided()` is `true`, and
|
| 53 |
+
- `r < extents_type::rank()` is `true`.
|
| 54 |
+
|
| 55 |
+
*Returns:* `1`.
|
| 56 |
+
|
| 57 |
+
``` cpp
|
| 58 |
+
template<class OtherExtents>
|
| 59 |
+
friend constexpr bool operator==(const mapping& x, const mapping<OtherExtents>& y) noexcept;
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
*Effects:* Equivalent to: `return x.extents() == y.extents();`
|
| 63 |
+
|