-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
layout_*_padded/mapping: メンバ関数(#1341)
- Loading branch information
Showing
20 changed files
with
618 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
reference/mdspan/layout_left_padded/mapping/is_always_exhaustive.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# is_always_exhaustive | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* layout_left_padded::mapping[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
static constexpr bool is_always_exhaustive() noexcept; | ||
``` | ||
|
||
## 概要 | ||
型の[Exhaustive特性](../../LayoutMapping.md)を取得する。 | ||
|
||
|
||
## 戻り値 | ||
- `rank_`が`0`または`1`のとき、`true`を返す。 | ||
- `static-padding-stride`または`first-static-extent`のいずれも[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しくないとき、`static-padding-stride == first-static-extent`を返す。 | ||
- そうではないとき、`false`を返す。 | ||
|
||
|
||
## 例外 | ||
投げない | ||
|
||
|
||
## バージョン | ||
### 言語 | ||
- C++26 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
||
|
||
## 参照 | ||
- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) |
36 changes: 36 additions & 0 deletions
36
reference/mdspan/layout_left_padded/mapping/is_exhaustive.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# is_exhaustive | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* layout_left_padded::mapping[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
constexpr bool is_exhaustive() const noexcept; | ||
``` | ||
|
||
## 概要 | ||
レイアウトマッピングの[Exhaustive特性](../../LayoutMapping.md)を取得する。 | ||
|
||
## 戻り値 | ||
- `rank_`が`0`または`1`のとき、`true`を返す。 | ||
- そうではないとき、`extents_.extent(0) == stride(1)`を返す。 | ||
|
||
|
||
## 例外 | ||
投げない | ||
|
||
|
||
## バージョン | ||
### 言語 | ||
- C++26 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
||
|
||
## 参照 | ||
- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# operator() | ||
* mdspan[meta header] | ||
* function template[meta id-type] | ||
* std[meta namespace] | ||
* layout_left_padded::mapping[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
template<class... Indices> | ||
constexpr size_t operator()(Indices... idxs) const noexcept; | ||
``` | ||
## 概要 | ||
多次元インデクス値`idxs...`に対応する要素位置を求める。 | ||
## テンプレートパラメータ制約 | ||
- `sizeof...(Indices) == rank_`が`true`、かつ | ||
- `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`<Indices, index_type> && ...)`が`true`、かつ | ||
- `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)`<index_type, Indices> && ...)`が`true`であること。 | ||
## 事前条件 | ||
多次元インデクス値[`extents_type::index-cast`](../../extents/index-cast.md)`(idxs)`は、多次元配列サイズ`extents_`における有効なインデクスであること。 | ||
## 戻り値 | ||
```cpp | ||
return ((static_cast<index_type>(idxs) * stride(P_rank)) + ... + 0); | ||
``` | ||
* stride[link stride.md] | ||
|
||
|
||
## 例外 | ||
投げない | ||
|
||
|
||
## バージョン | ||
### 言語 | ||
- C++26 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
||
|
||
## 参照 | ||
- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# operator== | ||
* mdspan[meta header] | ||
* function template[meta id-type] | ||
* std[meta namespace] | ||
* layout_left_padded::mapping[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
template<class LayoutLeftPaddedMapping> | ||
friend constexpr bool operator==( | ||
const mapping& x, const LayoutLeftPaddedMapping& y) noexcept; | ||
|
||
//operator==により、以下のオーバーロードが使用可能になる | ||
template<class LayoutLeftPaddedMapping> | ||
friend constexpr bool operator!=( | ||
const mapping& x, const LayoutLeftPaddedMapping& y) noexcept; | ||
``` | ||
|
||
## 概要 | ||
`mapping`の等値比較を行う。 | ||
|
||
|
||
## テンプレートパラメータ制約 | ||
- [`is-layout-left-padded-mapping-of`](../../is-layout-left-padded-mapping-of.md)`<LayoutLeftPaddedMapping>` | ||
- `LayoutLeftPaddedMapping::extents_type::`[`rank()`](../../extents/rank.md) `== rank_` | ||
|
||
|
||
## 戻り値 | ||
- [`x.extents() == y.extents()`](../../extents/op_equal.md)かつ`rank_ < 2 || x.`[`stride`](stride.md)`(1) == y.stride(1)`のとき、`true`を返す。 | ||
- そうでなければ、`false`を返す。 | ||
|
||
|
||
## 例外 | ||
投げない | ||
|
||
|
||
## バージョン | ||
### 言語 | ||
- C++26 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
||
|
||
## 参照 | ||
- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) |
37 changes: 37 additions & 0 deletions
37
reference/mdspan/layout_left_padded/mapping/required_span_size.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# required_span_size | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* layout_left_padded::mapping[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
constexpr index_type required_span_size() const noexcept; | ||
``` | ||
|
||
## 概要 | ||
メモリブロックに対する要素アクセス範囲を取得する。 | ||
|
||
|
||
## 戻り値 | ||
- 多次元インデクス空間`extents_`のサイズが0のとき、値`0`を返す。 | ||
- そうではないとき、`*this(((extents_(P_rank) - index_type(1))...)) + 1`を返す。 | ||
|
||
|
||
## 例外 | ||
投げない | ||
|
||
|
||
## バージョン | ||
### 言語 | ||
- C++26 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
||
|
||
## 参照 | ||
- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# stride | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* layout_left_padded::mapping[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
constexpr index_type stride(rank_type r) const noexcept; | ||
``` | ||
## 概要 | ||
`r`番目次元のストライド幅を取得する。 | ||
## 事前条件 | ||
`r < rank_` | ||
## 戻り値 | ||
- `r == 0`のとき、値`1`を返す。 | ||
- `r == 1`のとき、値`stride-1`を返す。 | ||
- そうでなければ、半開区間`[1, r)`の全ての値`k`に対して値`stride-1`と全ての`extents_.extent(k)`を乗算した値を返す。 | ||
## 例外 | ||
投げない | ||
## バージョン | ||
### 言語 | ||
- C++26 | ||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
## 関連項目 | ||
- [`strides`](strides.md) | ||
## 参照 | ||
- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# strides | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* layout_left_padded::mapping[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
constexpr array<index_type, rank_> strides() const noexcept; | ||
``` | ||
* array[link /reference/array/array.md] | ||
|
||
## 概要 | ||
ストライド幅配列を取得する。 | ||
|
||
|
||
## 戻り値 | ||
[`array`](/reference/array/array.md)`<index_type, rank_>({`[`stride`](stride.md)`(P_rank)...})` | ||
|
||
|
||
## 例外 | ||
投げない | ||
|
||
|
||
## バージョン | ||
### 言語 | ||
- C++26 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
||
|
||
## 関連項目 | ||
- [`stride`](stride.md) | ||
|
||
|
||
## 参照 | ||
- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.