Skip to content

Commit 2ec4f19

Browse files
committed
linalg : copyを追加。(#1233)
Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com>
1 parent 3382e49 commit 2ec4f19

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

reference/linalg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に
6363
| [`apply_givens_rotation`](linalg/apply_givens_rotation.md) | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 |
6464
| [`swap_elements`](linalg/swap_elements.md) | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 |
6565
| [`scale`](linalg/scale.md) | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 |
66-
| `copy` | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 |
66+
| [`copy`](linalg/copy.md) | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 |
6767
| `add` | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 |
6868
| `dot` | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 |
6969
| `dotc` | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 |

reference/linalg/copy.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# copy
2+
3+
* [mathjax enable]
4+
* linalg[meta header]
5+
* function template[meta id-type]
6+
* std::linalg[meta namespace]
7+
* cpp26[meta cpp]
8+
9+
10+
```cpp
11+
namespace std::linalg {
12+
template<in-object InObj,
13+
out-object OutObj>
14+
void copy(InObj x,
15+
OutObj y); // (1)
16+
17+
template<class ExecutionPolicy,
18+
in-object InObj,
19+
out-object OutObj>
20+
void copy(ExecutionPolicy&& exec,
21+
InObj x,
22+
OutObj y); // (2)
23+
}
24+
```
25+
26+
27+
## 概要
28+
同じサイズの行列またはベクトルの`x`と`y`に対して、`x`を`y`にコピーする。
29+
30+
31+
## テンプレートパラメータ制約
32+
`x`と`y`の次元が等しくなければならない。
33+
- `x.rank() == y.rank()`
34+
35+
36+
## 適格要件
37+
- 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`<InVec, OutVec>(r,r)`が`true`
38+
39+
40+
## 事前条件
41+
`x`と`y`の各次元の要素数が等しくなければならない。
42+
- `x.extents() == y.extents()`
43+
44+
45+
46+
## 効果
47+
`x`の各成分を`y`にコピーする。
48+
49+
- (1): 逐次実行する。
50+
- (2): 指定された実行ポリシーに応じて実行する。
51+
52+
53+
## 戻り値
54+
なし
55+
56+
57+
## 例
58+
59+
60+
### 出力
61+
62+
63+
## バージョン
64+
### 言語
65+
- C++26
66+
67+
### 処理系
68+
- [Clang](/implementation.md#clang): ??
69+
- [GCC](/implementation.md#gcc): ??
70+
- [ICC](/implementation.md#icc): ??
71+
- [Visual C++](/implementation.md#visual_cpp): ??
72+
73+
74+
## 関連項目
75+
- [`execution`](/reference/execution.md)
76+
- [`mdspan`](/reference/mdspan.md)
77+
78+
79+
## 参照
80+
- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf)
81+
- [`LAPACK: ccopy`](https://netlib.org/lapack/explore-html/d5/d2b/group__copy_gab395a30db1137d3deabe520b8e73097d.html#gab395a30db1137d3deabe520b8e73097d)

0 commit comments

Comments
 (0)