From Jason Turner

[linalg.algs.blas3.inplacetrsm]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2_l35536/{from.md → to.md} +140 -0
tmp/tmp2_l35536/{from.md → to.md} RENAMED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Solve multiple triangular linear systems in-place <a id="linalg.algs.blas3.inplacetrsm">[[linalg.algs.blas3.inplacetrsm]]</a>
2
+
3
+ [*Note 1*: These functions correspond to the BLAS function
4
+ `xTRSM`. — *end note*]
5
+
6
+ ``` cpp
7
+ template<in-matrix InMat, class Triangle, class DiagonalStorage,
8
+ inout-matrix InOutMat, class BinaryDivideOp>
9
+ void triangular_matrix_matrix_left_solve(InMat A, Triangle t, DiagonalStorage d,
10
+ InOutMat B, BinaryDivideOp divide);
11
+ template<class ExecutionPolicy, in-matrix InMat, class Triangle, class DiagonalStorage,
12
+ inout-matrix InOutMat, class BinaryDivideOp>
13
+ void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec,
14
+ InMat A, Triangle t, DiagonalStorage d,
15
+ InOutMat B, BinaryDivideOp divide);
16
+ ```
17
+
18
+ These functions perform multiple in-place matrix solves, taking into
19
+ account the `Triangle` and `DiagonalStorage` parameters that apply to
20
+ the triangular matrix `A` [[linalg.general]].
21
+
22
+ [*Note 1*: This algorithm makes it possible to compute factorizations
23
+ like Cholesky and LU in place. Performing triangular solve in place
24
+ hinders parallelization. However, other `ExecutionPolicy` specific
25
+ optimizations, such as vectorization, are still possible. — *end note*]
26
+
27
+ *Mandates:*
28
+
29
+ - If `InMat` has `layout_blas_packed` layout, then the layout’s
30
+ `Triangle` template argument has the same type as the function’s
31
+ `Triangle` template argument;
32
+ - *`possibly-multipliable`*`<InMat, InOutMat, InOutMat>()` is `true`;
33
+ and
34
+ - *`compatible-static-extents`*`<InMat, InMat>(0, 1)` is `true`.
35
+
36
+ *Preconditions:*
37
+
38
+ - *`multipliable`*`(A, B, B)` is `true`, and
39
+ - `A.extent(0) == A.extent(1)` is `true`.
40
+
41
+ *Effects:* Computes X' such that AX' = B, and assigns each element of X'
42
+ to the corresponding element of B. If so such X' exists, then the
43
+ elements of `B` are valid but unspecified.
44
+
45
+ *Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `B.extent(1)`).
46
+
47
+ ``` cpp
48
+ template<in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
49
+ void triangular_matrix_matrix_left_solve(InMat A, Triangle t, DiagonalStorage d,
50
+ InOutMat B);
51
+ ```
52
+
53
+ *Effects:* Equivalent to:
54
+
55
+ ``` cpp
56
+ triangular_matrix_matrix_left_solve(A, t, d, B, divides<void>{});
57
+ ```
58
+
59
+ ``` cpp
60
+ template<class ExecutionPolicy,
61
+ in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
62
+ void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec,
63
+ InMat A, Triangle t, DiagonalStorage d,
64
+ InOutMat B);
65
+ ```
66
+
67
+ *Effects:* Equivalent to:
68
+
69
+ ``` cpp
70
+ triangular_matrix_matrix_left_solve(std::forward<ExecutionPolicy>(exec),
71
+ A, t, d, B, divides<void>{});
72
+ ```
73
+
74
+ ``` cpp
75
+ template<in-matrix InMat, class Triangle, class DiagonalStorage,
76
+ inout-matrix InOutMat, class BinaryDivideOp>
77
+ void triangular_matrix_matrix_right_solve(InMat A, Triangle t, DiagonalStorage d,
78
+ InOutMat B, BinaryDivideOp divide);
79
+ template<class ExecutionPolicy, in-matrix InMat, class Triangle, class DiagonalStorage,
80
+ inout-matrix InOutMat, class BinaryDivideOp>
81
+ void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec,
82
+ InMat A, Triangle t, DiagonalStorage d,
83
+ InOutMat B, BinaryDivideOp divide);
84
+ ```
85
+
86
+ These functions perform multiple in-place matrix solves, taking into
87
+ account the `Triangle` and `DiagonalStorage` parameters that apply to
88
+ the triangular matrix `A` [[linalg.general]].
89
+
90
+ [*Note 2*: This algorithm makes it possible to compute factorizations
91
+ like Cholesky and LU in place. Performing triangular solve in place
92
+ hinders parallelization. However, other `ExecutionPolicy` specific
93
+ optimizations, such as vectorization, are still possible. — *end note*]
94
+
95
+ *Mandates:*
96
+
97
+ - If `InMat` has `layout_blas_packed` layout, then the layout’s
98
+ `Triangle` template argument has the same type as the function’s
99
+ `Triangle` template argument;
100
+ - *`possibly-multipliable`*`<InOutMat, InMat, InOutMat>()` is `true`;
101
+ and
102
+ - *`compatible-static-extents`*`<InMat, InMat>(0, 1)` is `true`.
103
+
104
+ *Preconditions:*
105
+
106
+ - *`multipliable`*`(B, A, B)` is `true`, and
107
+ - `A.extent(0) == A.extent(1)` is `true`.
108
+
109
+ *Effects:* Computes X' such that X'A = B, and assigns each element of X'
110
+ to the corresponding element of B. If so such X' exists, then the
111
+ elements of `B` are valid but unspecified.
112
+
113
+ *Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `B.extent(1)`).
114
+
115
+ ``` cpp
116
+ template<in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
117
+ void triangular_matrix_matrix_right_solve(InMat A, Triangle t, DiagonalStorage d, InOutMat B);
118
+ ```
119
+
120
+ *Effects:* Equivalent to:
121
+
122
+ ``` cpp
123
+ triangular_matrix_matrix_right_solve(A, t, d, B, divides<void>{});
124
+ ```
125
+
126
+ ``` cpp
127
+ template<class ExecutionPolicy,
128
+ in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
129
+ void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec,
130
+ InMat A, Triangle t, DiagonalStorage d,
131
+ InOutMat B);
132
+ ```
133
+
134
+ *Effects:* Equivalent to:
135
+
136
+ ``` cpp
137
+ triangular_matrix_matrix_right_solve(std::forward<ExecutionPolicy>(exec),
138
+ A, t, d, B, divides<void>{});
139
+ ```
140
+