Skip to content

Commit 735b35e

Browse files
committed
linlg: 入出力引数コンセプトの説明追加 (#1233)
1 parent 96adf0c commit 735b35e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+289
-181
lines changed

reference/linalg/add.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# add
2-
32
* [mathjax enable]
43
* linalg[meta header]
54
* function template[meta id-type]
65
* std::linalg[meta namespace]
76
* cpp26[meta cpp]
87

9-
108
```cpp
119
namespace std::linalg {
1210
template<in-object InObj1,
@@ -26,7 +24,8 @@ namespace std::linalg {
2624
OutObj z); // (2)
2725
}
2826
```
29-
27+
* in-object[link inout-object.md]
28+
* out-object[link inout-object.md]
3029
3130
## 概要
3231
同じサイズの行列またはベクトルの`x`と`y`、`z`に対して、$x + y$ を`z`に代入する:

reference/linalg/addable.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# addable
2-
32
* linalg[meta header]
43
* function template[meta id-type]
5-
* std::linalg[meta namespace]
64
* cpp26[meta cpp]
75

8-
96
```cpp
10-
namespace std::linalg {
117
constexpr bool addable(
128
const in-vector auto& in1,
139
const in-vector auto& in2,
@@ -27,9 +23,9 @@ constexpr bool addable(
2723
out.extent(0) == in2.extent(0) &&
2824
out.extent(1) == in2.extent(1);
2925
} // (2)
30-
}
3126
```
32-
27+
* in-vector[link inout-vector.md]
28+
* in-matrix[link inout-matrix.md]
3329
3430
## 概要
3531
テンプレートパラメータに指定されたベクトルまたは行列の次元が同じかどうかを判定する、説明専用の関数である。

reference/linalg/apply_givens_rotation.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
# apply_givens_rotation
2-
32
* [mathjax enable]
43
* linalg[meta header]
54
* function template[meta id-type]
65
* std::linalg[meta namespace]
76
* cpp26[meta cpp]
87

9-
108
```cpp
119
namespace std::linalg {
1210
template<inout-vector InOutVec1,
13-
inout-vector InOutVec2,
14-
class Real>
11+
inout-vector InOutVec2,
12+
class Real>
1513
void apply_givens_rotation(
1614
InOutVec1 x,
1715
InOutVec2 y,
1816
Real c,
1917
Real s); // (1)
2018

2119
template<class ExecutionPolicy,
22-
inout-vector InOutVec1,
23-
inout-vector InOutVec2,
24-
class Real>
20+
inout-vector InOutVec1,
21+
inout-vector InOutVec2,
22+
class Real>
2523
void apply_givens_rotation(
2624
ExecutionPolicy&& exec,
2725
InOutVec1 x,
@@ -30,18 +28,18 @@ namespace std::linalg {
3028
Real s); // (2)
3129

3230
template<inout-vector InOutVec1,
33-
inout-vector InOutVec2,
34-
class Real>
31+
inout-vector InOutVec2,
32+
class Real>
3533
void apply_givens_rotation(
3634
InOutVec1 x,
3735
InOutVec2 y,
3836
Real c,
3937
complex<Real> s); // (3)
4038

4139
template<class ExecutionPolicy,
42-
inout-vector InOutVec1,
43-
inout-vector InOutVec2,
44-
class Real>
40+
inout-vector InOutVec1,
41+
inout-vector InOutVec2,
42+
class Real>
4543
void apply_givens_rotation(
4644
ExecutionPolicy&& exec,
4745
InOutVec1 x,
@@ -51,7 +49,7 @@ namespace std::linalg {
5149
}
5250
```
5351
* complex[link /reference/complex/complex.md]
54-
52+
* inout-vector[link inout-vector.md]
5553
5654
## 概要
5755
`c`と`s`で指定された回転行列を2つの**行**ベクトル`x`と`y`に対して、次のように掛けて代入する。

reference/linalg/compatible-static-extents.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# compatible-static-extents
2-
32
* linalg[meta header]
43
* function template[meta id-type]
54
* std::linalg[meta namespace]
65
* cpp26[meta cpp]
76

8-
97
```cpp
108
namespace std::linalg {
119
template<class MDS1, class MDS2>
12-
requires(is-mdspan<MDS1> && is-mdspan<MDS2>)
10+
requires(is-mdspan<MDS1> && is-mdspan<MDS2>)
1311
constexpr bool compatible-static-extents(size_t r1, size_t r2)
1412
{
1513
return MDS1::static_extent(r1) == dynamic_extent ||
@@ -18,8 +16,9 @@ namespace std::linalg {
1816
}
1917
}
2018
```
21-
* is-mdspan[link /reference/linalg/is_mdspan.md]
22-
19+
* is-mdspan[link is-mdspan.md]
20+
* static_extent[link /reference/mdspan/mdspan/static_extent.md]
21+
* dynamic_extent[link /reference/span/dynamic_extent.md]
2322
2423
## 概要
2524
左の`mdspan`の`r1`番目の静的要素数と右の`mdspan`の`r2`番目の静的要素数に互換性があるかどうかを返す、説明専用の関数である。

reference/linalg/copy.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# copy
2-
32
* [mathjax enable]
43
* linalg[meta header]
54
* function template[meta id-type]
65
* std::linalg[meta namespace]
76
* cpp26[meta cpp]
87

9-
108
```cpp
119
namespace std::linalg {
1210
template<in-object InObj,
13-
out-object OutObj>
11+
out-object OutObj>
1412
void copy(InObj x,
15-
OutObj y); // (1)
13+
OutObj y); // (1)
1614

1715
template<class ExecutionPolicy,
1816
in-object InObj,
@@ -22,7 +20,8 @@ namespace std::linalg {
2220
OutObj y); // (2)
2321
}
2422
```
25-
23+
* in-object[link inout-object.md]
24+
* out-object[link inout-object.md]
2625
2726
## 概要
2827
同じサイズの行列またはベクトルの`x`と`y`に対して、`x`を`y`にコピーする。

reference/linalg/dot.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# dot
2-
32
* [mathjax enable]
43
* linalg[meta header]
54
* function template[meta id-type]
65
* std::linalg[meta namespace]
76
* cpp26[meta cpp]
87

9-
108
```cpp
119
namespace std::linalg {
1210
template<in-vector InVec1,
@@ -38,6 +36,7 @@ namespace std::linalg {
3836
InVec2 v2); // (4)
3937
}
4038
```
39+
* in-vector[link inout-vector.md]
4140
4241
## 概要
4342
2つのベクトル`v1`、`v2`の内積を計算する。

reference/linalg/dotc.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
# dotc
2-
32
* [mathjax enable]
43
* linalg[meta header]
54
* function template[meta id-type]
65
* std::linalg[meta namespace]
76
* cpp26[meta cpp]
87

9-
108
```cpp
119
namespace std::linalg {
1210
template<in-vector InVec1,
1311
in-vector InVec2,
1412
class Scalar>
1513
Scalar dotc(InVec1 v1,
16-
InVec2 v2,
17-
Scalar init); // (1)
14+
InVec2 v2,
15+
Scalar init); // (1)
1816

1917
template<class ExecutionPolicy,
2018
in-vector InVec1,
2119
in-vector InVec2,
2220
class Scalar>
2321
Scalar dotc(ExecutionPolicy&& exec,
24-
InVec1 v1,
25-
InVec2 v2,
26-
Scalar init); // (2)
22+
InVec1 v1,
23+
InVec2 v2,
24+
Scalar init); // (2)
2725

2826
template<in-vector InVec1,
2927
in-vector InVec2>
3028
auto dotc(InVec1 v1,
31-
InVec2 v2); // (3)
29+
InVec2 v2); // (3)
3230

3331
template<class ExecutionPolicy,
3432
in-vector InVec1,
3533
in-vector InVec2>
3634
auto dotc(ExecutionPolicy&& exec,
37-
InVec1 v1,
38-
InVec2 v2); // (4)
35+
InVec1 v1,
36+
InVec2 v2); // (4)
3937
}
4038
```
39+
* in-vector[link inout-vector.md]
4140
4241
## 概要
4342
2つのベクトル`v1`、`v2`のエルミート内積を計算する。

reference/linalg/hermitian_matrix_product.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# hermitian_matrix_product
2-
3-
42
* [mathjax enable]
53
* linalg[meta header]
64
* function template[meta id-type]
75
* std::linalg[meta namespace]
86
* cpp26[meta cpp]
97

10-
118
```cpp
129
namespace std::linalg {
1310
template<in-matrix InMat1,
@@ -107,7 +104,8 @@ namespace std::linalg {
107104
OutMat C); // (8)
108105
}
109106
```
110-
107+
* in-matrix[link inout-matrix.md]
108+
* out-matrix[link inout-matrix.md]
111109
112110
## 概要
113111
エルミート行列と行列の積を計算する。

reference/linalg/hermitian_matrix_rank_1_update.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ namespace std::linalg {
5151
Triangle t); // (4)
5252
}
5353
```
54-
54+
* in-vector[link inout-vector.md]
55+
* possibly-packed-inout-matrix[link possibly-packed-inout-matrix.md]
5556
5657
## 概要
5758
エルミートな(対称かつ共役を取る)rank-1 updateをエルミート行列に行う。

reference/linalg/hermitian_matrix_rank_2_update.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# hermitian_matrix_rank_2_update
2-
3-
42
* [mathjax enable]
53
* linalg[meta header]
64
* function template[meta id-type]
75
* std::linalg[meta namespace]
86
* cpp26[meta cpp]
97

10-
118
```cpp
129
namespace std::linalg {
1310
template<in-vector InVec1,
@@ -33,7 +30,8 @@ namespace std::linalg {
3330
Triangle t); // (2)
3431
}
3532
```
36-
33+
* in-vector[link inout-vector.md]
34+
* possibly-packed-inout-matrix[link possibly-packed-inout-matrix.md]
3735
3836
## 概要
3937
エルミートな(対称かつ共役を取る)rank-2 updateをエルミート行列に行う。

0 commit comments

Comments
 (0)