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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### BLAS 3 algorithms <a id="linalg.algs.blas3">[[linalg.algs.blas3]]</a>
|
| 2 |
+
|
| 3 |
+
#### General matrix-matrix product <a id="linalg.algs.blas3.gemm">[[linalg.algs.blas3.gemm]]</a>
|
| 4 |
+
|
| 5 |
+
[*Note 1*: These functions correspond to the BLAS function
|
| 6 |
+
`xGEMM`. — *end note*]
|
| 7 |
+
|
| 8 |
+
The following elements apply to all functions in
|
| 9 |
+
[[linalg.algs.blas3.gemm]] in addition to function-specific elements.
|
| 10 |
+
|
| 11 |
+
*Mandates:*
|
| 12 |
+
`possibly-multipliable<decltype(A), decltype(B), decltype(C)>()` is
|
| 13 |
+
`true`.
|
| 14 |
+
|
| 15 |
+
*Preconditions:* `multipliable(A, B, C)` is `true`.
|
| 16 |
+
|
| 17 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `B.extent(1)`).
|
| 18 |
+
|
| 19 |
+
``` cpp
|
| 20 |
+
template<in-matrix InMat1, in-matrix InMat2, out-matrix OutMat>
|
| 21 |
+
void matrix_product(InMat1 A, InMat2 B, OutMat C);
|
| 22 |
+
template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2, out-matrix OutMat>
|
| 23 |
+
void matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, OutMat C);
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
*Effects:* Computes C = A B.
|
| 27 |
+
|
| 28 |
+
``` cpp
|
| 29 |
+
template<in-matrix InMat1, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat>
|
| 30 |
+
void matrix_product(InMat1 A, InMat2 B, InMat3 E, OutMat C);
|
| 31 |
+
template<class ExecutionPolicy,
|
| 32 |
+
in-matrix InMat1, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat>
|
| 33 |
+
void matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, InMat3 E, OutMat C);
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
*Mandates:* *`possibly-addable`*`<InMat3, InMat3, OutMat>()` is `true`.
|
| 37 |
+
|
| 38 |
+
*Preconditions:* *`addable`*`(E, E, C)` is `true`.
|
| 39 |
+
|
| 40 |
+
*Effects:* Computes C = E + A B.
|
| 41 |
+
|
| 42 |
+
*Remarks:* `C` may alias `E`.
|
| 43 |
+
|
| 44 |
+
#### Symmetric, Hermitian, and triangular matrix-matrix product <a id="linalg.algs.blas3.xxmm">[[linalg.algs.blas3.xxmm]]</a>
|
| 45 |
+
|
| 46 |
+
[*Note 1*: These functions correspond to the BLAS functions `xSYMM`,
|
| 47 |
+
`xHEMM`, and `xTRMM`. — *end note*]
|
| 48 |
+
|
| 49 |
+
The following elements apply to all functions in
|
| 50 |
+
[[linalg.algs.blas3.xxmm]] in addition to function-specific elements.
|
| 51 |
+
|
| 52 |
+
*Mandates:*
|
| 53 |
+
|
| 54 |
+
- `possibly-multipliable<decltype(A), decltype(B), decltype(C)>()` is
|
| 55 |
+
`true`, and
|
| 56 |
+
- `possibly-addable<decltype(E), decltype(E), decltype(C)>()` is `true`
|
| 57 |
+
for those overloads that take an `E` parameter.
|
| 58 |
+
|
| 59 |
+
*Preconditions:*
|
| 60 |
+
|
| 61 |
+
- `multipliable(A, B, C)` is `true`, and
|
| 62 |
+
- `addable(E, E, C)` is `true` for those overloads that take an `E`
|
| 63 |
+
parameter.
|
| 64 |
+
|
| 65 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `B.extent(1)`).
|
| 66 |
+
|
| 67 |
+
``` cpp
|
| 68 |
+
template<in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat>
|
| 69 |
+
void symmetric_matrix_product(InMat1 A, Triangle t, InMat2 B, OutMat C);
|
| 70 |
+
template<class ExecutionPolicy,
|
| 71 |
+
in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat>
|
| 72 |
+
void symmetric_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, InMat2 B, OutMat C);
|
| 73 |
+
|
| 74 |
+
template<in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat>
|
| 75 |
+
void hermitian_matrix_product(InMat1 A, Triangle t, InMat2 B, OutMat C);
|
| 76 |
+
template<class ExecutionPolicy,
|
| 77 |
+
in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat>
|
| 78 |
+
void hermitian_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, InMat2 B, OutMat C);
|
| 79 |
+
|
| 80 |
+
template<in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 81 |
+
in-matrix InMat2, out-matrix OutMat>
|
| 82 |
+
void triangular_matrix_product(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat C);
|
| 83 |
+
template<class ExecutionPolicy, in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 84 |
+
in-matrix InMat2, out-matrix OutMat>
|
| 85 |
+
void triangular_matrix_product(ExecutionPolicy&& exec,
|
| 86 |
+
InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat C);
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
These functions perform a matrix-matrix multiply, taking into account
|
| 90 |
+
the `Triangle` and `DiagonalStorage` (if applicable) parameters that
|
| 91 |
+
apply to the symmetric, Hermitian, or triangular (respectively) matrix
|
| 92 |
+
`A` [[linalg.general]].
|
| 93 |
+
|
| 94 |
+
*Mandates:*
|
| 95 |
+
|
| 96 |
+
- If `InMat1` has `layout_blas_packed` layout, then the layout’s
|
| 97 |
+
`Triangle` template argument has the same type as the function’s
|
| 98 |
+
`Triangle` template argument; and
|
| 99 |
+
- *`compatible-static-extents`*`<InMat1, InMat1>(0, 1)` is `true`.
|
| 100 |
+
|
| 101 |
+
*Preconditions:* `A.extent(0) == A.extent(1)` is `true`.
|
| 102 |
+
|
| 103 |
+
*Effects:* Computes C = A B.
|
| 104 |
+
|
| 105 |
+
``` cpp
|
| 106 |
+
template<in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat>
|
| 107 |
+
void symmetric_matrix_product(InMat1 A, InMat2 B, Triangle t, OutMat C);
|
| 108 |
+
template<class ExecutionPolicy,
|
| 109 |
+
in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat>
|
| 110 |
+
void symmetric_matrix_product(ExecutionPolicy&& exec,
|
| 111 |
+
InMat1 A, InMat2 B, Triangle t, OutMat C);
|
| 112 |
+
|
| 113 |
+
template<in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat>
|
| 114 |
+
void hermitian_matrix_product(InMat1 A, InMat2 B, Triangle t, OutMat C);
|
| 115 |
+
template<class ExecutionPolicy,
|
| 116 |
+
in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat>
|
| 117 |
+
void hermitian_matrix_product(ExecutionPolicy&& exec,
|
| 118 |
+
InMat1 A, InMat2 B, Triangle t, OutMat C);
|
| 119 |
+
|
| 120 |
+
template<in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage,
|
| 121 |
+
out-matrix OutMat>
|
| 122 |
+
void triangular_matrix_product(InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, OutMat C);
|
| 123 |
+
template<class ExecutionPolicy,
|
| 124 |
+
in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage,
|
| 125 |
+
out-matrix OutMat>
|
| 126 |
+
void triangular_matrix_product(ExecutionPolicy&& exec,
|
| 127 |
+
InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, OutMat C);
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
These functions perform a matrix-matrix multiply, taking into account
|
| 131 |
+
the `Triangle` and `DiagonalStorage` (if applicable) parameters that
|
| 132 |
+
apply to the symmetric, Hermitian, or triangular (respectively) matrix
|
| 133 |
+
`B` [[linalg.general]].
|
| 134 |
+
|
| 135 |
+
*Mandates:*
|
| 136 |
+
|
| 137 |
+
- If `InMat2` has `layout_blas_packed` layout, then the layout’s
|
| 138 |
+
`Triangle` template argument has the same type as the function’s
|
| 139 |
+
`Triangle` template argument; and
|
| 140 |
+
- *`compatible-static-extents`*`<InMat2, InMat2>(0, 1)` is `true`.
|
| 141 |
+
|
| 142 |
+
*Preconditions:* `B.extent(0) == B.extent(1)` is `true`.
|
| 143 |
+
|
| 144 |
+
*Effects:* Computes C = A B.
|
| 145 |
+
|
| 146 |
+
``` cpp
|
| 147 |
+
template<in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3,
|
| 148 |
+
out-matrix OutMat>
|
| 149 |
+
void symmetric_matrix_product(InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C);
|
| 150 |
+
template<class ExecutionPolicy,
|
| 151 |
+
in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3,
|
| 152 |
+
out-matrix OutMat>
|
| 153 |
+
void symmetric_matrix_product(ExecutionPolicy&& exec,
|
| 154 |
+
InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C);
|
| 155 |
+
|
| 156 |
+
template<in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3,
|
| 157 |
+
out-matrix OutMat>
|
| 158 |
+
void hermitian_matrix_product(InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C);
|
| 159 |
+
template<class ExecutionPolicy,
|
| 160 |
+
in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3,
|
| 161 |
+
out-matrix OutMat>
|
| 162 |
+
void hermitian_matrix_product(ExecutionPolicy&& exec,
|
| 163 |
+
InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C);
|
| 164 |
+
|
| 165 |
+
template<in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 166 |
+
in-matrix InMat2, in-matrix InMat3, out-matrix OutMat>
|
| 167 |
+
void triangular_matrix_product(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, InMat3 E,
|
| 168 |
+
OutMat C);
|
| 169 |
+
template<class ExecutionPolicy,
|
| 170 |
+
in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 171 |
+
in-matrix InMat2, in-matrix InMat3, out-matrix OutMat>
|
| 172 |
+
void triangular_matrix_product(ExecutionPolicy&& exec,
|
| 173 |
+
InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, InMat3 E,
|
| 174 |
+
OutMat C);
|
| 175 |
+
```
|
| 176 |
+
|
| 177 |
+
These functions perform a potentially overwriting matrix-matrix
|
| 178 |
+
multiply-add, taking into account the `Triangle` and `DiagonalStorage`
|
| 179 |
+
(if applicable) parameters that apply to the symmetric, Hermitian, or
|
| 180 |
+
triangular (respectively) matrix `A` [[linalg.general]].
|
| 181 |
+
|
| 182 |
+
*Mandates:*
|
| 183 |
+
|
| 184 |
+
- If `InMat1` has `layout_blas_packed` layout, then the layout’s
|
| 185 |
+
`Triangle` template argument has the same type as the function’s
|
| 186 |
+
`Triangle` template argument; and
|
| 187 |
+
- *`compatible-static-extents`*`<InMat1, InMat1>(0, 1)` is `true`.
|
| 188 |
+
|
| 189 |
+
*Preconditions:* `A.extent(0) == A.extent(1)` is `true`.
|
| 190 |
+
|
| 191 |
+
*Effects:* Computes C = E + A B.
|
| 192 |
+
|
| 193 |
+
*Remarks:* `C` may alias `E`.
|
| 194 |
+
|
| 195 |
+
``` cpp
|
| 196 |
+
template<in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3,
|
| 197 |
+
out-matrix OutMat>
|
| 198 |
+
void symmetric_matrix_product(InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C);
|
| 199 |
+
template<class ExecutionPolicy,
|
| 200 |
+
in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3,
|
| 201 |
+
out-matrix OutMat>
|
| 202 |
+
void symmetric_matrix_product(ExecutionPolicy&& exec,
|
| 203 |
+
InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C);
|
| 204 |
+
|
| 205 |
+
template<in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3,
|
| 206 |
+
out-matrix OutMat>
|
| 207 |
+
void hermitian_matrix_product(InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C);
|
| 208 |
+
template<class ExecutionPolicy,
|
| 209 |
+
in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3,
|
| 210 |
+
out-matrix OutMat>
|
| 211 |
+
void hermitian_matrix_product(ExecutionPolicy&& exec,
|
| 212 |
+
InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C);
|
| 213 |
+
|
| 214 |
+
template<in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage,
|
| 215 |
+
in-matrix InMat3, out-matrix OutMat>
|
| 216 |
+
void triangular_matrix_product(InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, InMat3 E,
|
| 217 |
+
OutMat C);
|
| 218 |
+
template<class ExecutionPolicy,
|
| 219 |
+
in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage,
|
| 220 |
+
in-matrix InMat3, out-matrix OutMat>
|
| 221 |
+
void triangular_matrix_product(ExecutionPolicy&& exec,
|
| 222 |
+
InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, InMat3 E,
|
| 223 |
+
OutMat C);
|
| 224 |
+
```
|
| 225 |
+
|
| 226 |
+
These functions perform a potentially overwriting matrix-matrix
|
| 227 |
+
multiply-add, taking into account the `Triangle` and `DiagonalStorage`
|
| 228 |
+
(if applicable) parameters that apply to the symmetric, Hermitian, or
|
| 229 |
+
triangular (respectively) matrix `B` [[linalg.general]].
|
| 230 |
+
|
| 231 |
+
*Mandates:*
|
| 232 |
+
|
| 233 |
+
- If `InMat2` has `layout_blas_packed` layout, then the layout’s
|
| 234 |
+
`Triangle` template argument has the same type as the function’s
|
| 235 |
+
`Triangle` template argument; and
|
| 236 |
+
- *`compatible-static-extents`*`<InMat2, InMat2>(0, 1)` is `true`.
|
| 237 |
+
|
| 238 |
+
*Preconditions:* `B.extent(0) == B.extent(1)` is `true`.
|
| 239 |
+
|
| 240 |
+
*Effects:* Computes C = E + A B.
|
| 241 |
+
|
| 242 |
+
*Remarks:* `C` may alias `E`.
|
| 243 |
+
|
| 244 |
+
#### In-place triangular matrix-matrix product <a id="linalg.algs.blas3.trmm">[[linalg.algs.blas3.trmm]]</a>
|
| 245 |
+
|
| 246 |
+
These functions perform an in-place matrix-matrix multiply, taking into
|
| 247 |
+
account the `Triangle` and `DiagonalStorage` parameters that apply to
|
| 248 |
+
the triangular matrix `A` [[linalg.general]].
|
| 249 |
+
|
| 250 |
+
[*Note 1*: These functions correspond to the BLAS function
|
| 251 |
+
`xTRMM`. — *end note*]
|
| 252 |
+
|
| 253 |
+
``` cpp
|
| 254 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 255 |
+
void triangular_matrix_left_product(InMat A, Triangle t, DiagonalStorage d, InOutMat C);
|
| 256 |
+
template<class ExecutionPolicy,
|
| 257 |
+
in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 258 |
+
void triangular_matrix_left_product(ExecutionPolicy&& exec,
|
| 259 |
+
InMat A, Triangle t, DiagonalStorage d, InOutMat C);
|
| 260 |
+
```
|
| 261 |
+
|
| 262 |
+
*Mandates:*
|
| 263 |
+
|
| 264 |
+
- If `InMat` has `layout_blas_packed` layout, then the layout’s
|
| 265 |
+
`Triangle` template argument has the same type as the function’s
|
| 266 |
+
`Triangle` template argument;
|
| 267 |
+
- *`possibly-multipliable`*`<InMat, InOutMat, InOutMat>()` is `true`;
|
| 268 |
+
and
|
| 269 |
+
- *`compatible-static-extents`*`<InMat, InMat>(0, 1)` is `true`.
|
| 270 |
+
|
| 271 |
+
*Preconditions:*
|
| 272 |
+
|
| 273 |
+
- *`multipliable`*`(A, C, C)` is `true`, and
|
| 274 |
+
- `A.extent(0) == A.extent(1)` is `true`.
|
| 275 |
+
|
| 276 |
+
*Effects:* Computes a matrix C' such that C' = A C and assigns each
|
| 277 |
+
element of C' to the corresponding element of C.
|
| 278 |
+
|
| 279 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `C.extent(0)`).
|
| 280 |
+
|
| 281 |
+
``` cpp
|
| 282 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 283 |
+
void triangular_matrix_right_product(InMat A, Triangle t, DiagonalStorage d, InOutMat C);
|
| 284 |
+
template<class ExecutionPolicy,
|
| 285 |
+
in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 286 |
+
void triangular_matrix_right_product(ExecutionPolicy&& exec,
|
| 287 |
+
InMat A, Triangle t, DiagonalStorage d, InOutMat C);
|
| 288 |
+
```
|
| 289 |
+
|
| 290 |
+
*Mandates:*
|
| 291 |
+
|
| 292 |
+
- If `InMat` has `layout_blas_packed` layout, then the layout’s
|
| 293 |
+
`Triangle` template argument has the same type as the function’s
|
| 294 |
+
`Triangle` template argument;
|
| 295 |
+
- *`possibly-multipliable`*`<InOutMat, InMat, InOutMat>()` is `true`;
|
| 296 |
+
and
|
| 297 |
+
- *`compatible-static-extents`*`<InMat, InMat>(0, 1)` is `true`.
|
| 298 |
+
|
| 299 |
+
*Preconditions:*
|
| 300 |
+
|
| 301 |
+
- *`multipliable`*`(C, A, C)` is `true`, and
|
| 302 |
+
- `A.extent(0) == A.extent(1)` is `true`.
|
| 303 |
+
|
| 304 |
+
*Effects:* Computes a matrix C' such that C' = C A and assigns each
|
| 305 |
+
element of C' to the corresponding element of C.
|
| 306 |
+
|
| 307 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `C.extent(0)`).
|
| 308 |
+
|
| 309 |
+
#### Rank-k update of a symmetric or Hermitian matrix <a id="linalg.algs.blas3.rankk">[[linalg.algs.blas3.rankk]]</a>
|
| 310 |
+
|
| 311 |
+
[*Note 1*: These functions correspond to the BLAS functions `xSYRK` and
|
| 312 |
+
`xHERK`. — *end note*]
|
| 313 |
+
|
| 314 |
+
The following elements apply to all functions in
|
| 315 |
+
[[linalg.algs.blas3.rankk]].
|
| 316 |
+
|
| 317 |
+
*Mandates:*
|
| 318 |
+
|
| 319 |
+
- If `InOutMat` has `layout_blas_packed` layout, then the layout’s
|
| 320 |
+
`Triangle` template argument has the same type as the function’s
|
| 321 |
+
`Triangle` template argument;
|
| 322 |
+
- `compatible-static-extents<decltype(A), decltype(A)>(0, 1)` is `true`;
|
| 323 |
+
- `compatible-static-extents<decltype(C), decltype(C)>(0, 1)` is `true`;
|
| 324 |
+
and
|
| 325 |
+
- `compatible-static-extents<decltype(A), decltype(C)>(0, 0)` is `true`.
|
| 326 |
+
|
| 327 |
+
*Preconditions:*
|
| 328 |
+
|
| 329 |
+
- `A.extent(0)` equals `A.extent(1)`,
|
| 330 |
+
- `C.extent(0)` equals `C.extent(1)`, and
|
| 331 |
+
- `A.extent(0)` equals `C.extent(0)`.
|
| 332 |
+
|
| 333 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `C.extent(0)`).
|
| 334 |
+
|
| 335 |
+
``` cpp
|
| 336 |
+
template<class Scalar, in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 337 |
+
void symmetric_matrix_rank_k_update(Scalar alpha, InMat A, InOutMat C, Triangle t);
|
| 338 |
+
template<class ExecutionPolicy, class Scalar,
|
| 339 |
+
in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 340 |
+
void symmetric_matrix_rank_k_update(ExecutionPolicy&& exec,
|
| 341 |
+
Scalar alpha, InMat A, InOutMat C, Triangle t);
|
| 342 |
+
```
|
| 343 |
+
|
| 344 |
+
*Effects:* Computes a matrix C' such that $C' = C + \alpha A A^T$, where
|
| 345 |
+
the scalar α is `alpha`, and assigns each element of C' to the
|
| 346 |
+
corresponding element of C.
|
| 347 |
+
|
| 348 |
+
``` cpp
|
| 349 |
+
template<in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 350 |
+
void symmetric_matrix_rank_k_update(InMat A, InOutMat C, Triangle t);
|
| 351 |
+
template<class ExecutionPolicy,
|
| 352 |
+
in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 353 |
+
void symmetric_matrix_rank_k_update(ExecutionPolicy&& exec,
|
| 354 |
+
InMat A, InOutMat C, Triangle t);
|
| 355 |
+
```
|
| 356 |
+
|
| 357 |
+
*Effects:* Computes a matrix C' such that $C' = C + A A^T$, and assigns
|
| 358 |
+
each element of C' to the corresponding element of C.
|
| 359 |
+
|
| 360 |
+
``` cpp
|
| 361 |
+
template<class Scalar, in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 362 |
+
void hermitian_matrix_rank_k_update(Scalar alpha, InMat A, InOutMat C, Triangle t);
|
| 363 |
+
template<class ExecutionPolicy,
|
| 364 |
+
class Scalar, in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 365 |
+
void hermitian_matrix_rank_k_update(ExecutionPolicy&& exec,
|
| 366 |
+
Scalar alpha, InMat A, InOutMat C, Triangle t);
|
| 367 |
+
```
|
| 368 |
+
|
| 369 |
+
*Effects:* Computes a matrix C' such that $C' = C + \alpha A A^H$, where
|
| 370 |
+
the scalar α is `alpha`, and assigns each element of C' to the
|
| 371 |
+
corresponding element of C.
|
| 372 |
+
|
| 373 |
+
``` cpp
|
| 374 |
+
template<in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 375 |
+
void hermitian_matrix_rank_k_update(InMat A, InOutMat C, Triangle t);
|
| 376 |
+
template<class ExecutionPolicy,
|
| 377 |
+
in-matrix InMat, possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 378 |
+
void hermitian_matrix_rank_k_update(ExecutionPolicy&& exec,
|
| 379 |
+
InMat A, InOutMat C, Triangle t);
|
| 380 |
+
```
|
| 381 |
+
|
| 382 |
+
*Effects:* Computes a matrix C' such that $C' = C + A A^H$, and assigns
|
| 383 |
+
each element of C' to the corresponding element of C.
|
| 384 |
+
|
| 385 |
+
#### Rank-2k update of a symmetric or Hermitian matrix <a id="linalg.algs.blas3.rank2k">[[linalg.algs.blas3.rank2k]]</a>
|
| 386 |
+
|
| 387 |
+
[*Note 1*: These functions correspond to the BLAS functions `xSYR2K`
|
| 388 |
+
and `xHER2K`. — *end note*]
|
| 389 |
+
|
| 390 |
+
The following elements apply to all functions in
|
| 391 |
+
[[linalg.algs.blas3.rank2k]].
|
| 392 |
+
|
| 393 |
+
*Mandates:*
|
| 394 |
+
|
| 395 |
+
- If `InOutMat` has `layout_blas_packed` layout, then the layout’s
|
| 396 |
+
`Triangle` template argument has the same type as the function’s
|
| 397 |
+
`Triangle` template argument;
|
| 398 |
+
- `possibly-addable<decltype(A), decltype(B), decltype(C)>()` is `true`;
|
| 399 |
+
and
|
| 400 |
+
- `compatible-static-extents<decltype(A), decltype(A)>(0, 1)` is `true`.
|
| 401 |
+
|
| 402 |
+
*Preconditions:*
|
| 403 |
+
|
| 404 |
+
- `addable(A, B, C)` is `true`, and
|
| 405 |
+
- `A.extent(0)` equals `A.extent(1)`.
|
| 406 |
+
|
| 407 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `C.extent(0)`).
|
| 408 |
+
|
| 409 |
+
``` cpp
|
| 410 |
+
template<in-matrix InMat1, in-matrix InMat2,
|
| 411 |
+
possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 412 |
+
void symmetric_matrix_rank_2k_update(InMat1 A, InMat2 B, InOutMat C, Triangle t);
|
| 413 |
+
template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2,
|
| 414 |
+
possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 415 |
+
void symmetric_matrix_rank_2k_update(ExecutionPolicy&& exec,
|
| 416 |
+
InMat1 A, InMat2 B, InOutMat C, Triangle t);
|
| 417 |
+
```
|
| 418 |
+
|
| 419 |
+
*Effects:* Computes a matrix C' such that $C' = C + A B^T + B A^T$, and
|
| 420 |
+
assigns each element of C' to the corresponding element of C.
|
| 421 |
+
|
| 422 |
+
``` cpp
|
| 423 |
+
template<in-matrix InMat1, in-matrix InMat2,
|
| 424 |
+
possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 425 |
+
void hermitian_matrix_rank_2k_update(InMat1 A, InMat2 B, InOutMat C, Triangle t);
|
| 426 |
+
template<class ExecutionPolicy,
|
| 427 |
+
in-matrix InMat1, in-matrix InMat2,
|
| 428 |
+
possibly-packed-inout-matrix InOutMat, class Triangle>
|
| 429 |
+
void hermitian_matrix_rank_2k_update(ExecutionPolicy&& exec,
|
| 430 |
+
InMat1 A, InMat2 B, InOutMat C, Triangle t);
|
| 431 |
+
```
|
| 432 |
+
|
| 433 |
+
*Effects:* Computes a matrix C' such that $C' = C + A B^H + B A^H$, and
|
| 434 |
+
assigns each element of C' to the corresponding element of C.
|
| 435 |
+
|
| 436 |
+
#### Solve multiple triangular linear systems <a id="linalg.algs.blas3.trsm">[[linalg.algs.blas3.trsm]]</a>
|
| 437 |
+
|
| 438 |
+
[*Note 1*: These functions correspond to the BLAS function
|
| 439 |
+
`xTRSM`. — *end note*]
|
| 440 |
+
|
| 441 |
+
``` cpp
|
| 442 |
+
template<in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 443 |
+
in-matrix InMat2, out-matrix OutMat, class BinaryDivideOp>
|
| 444 |
+
void triangular_matrix_matrix_left_solve(InMat1 A, Triangle t, DiagonalStorage d,
|
| 445 |
+
InMat2 B, OutMat X, BinaryDivideOp divide);
|
| 446 |
+
template<class ExecutionPolicy,
|
| 447 |
+
in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 448 |
+
in-matrix InMat2, out-matrix OutMat, class BinaryDivideOp>
|
| 449 |
+
void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec,
|
| 450 |
+
InMat1 A, Triangle t, DiagonalStorage d,
|
| 451 |
+
InMat2 B, OutMat X, BinaryDivideOp divide);
|
| 452 |
+
```
|
| 453 |
+
|
| 454 |
+
These functions perform multiple matrix solves, taking into account the
|
| 455 |
+
`Triangle` and `DiagonalStorage` parameters that apply to the triangular
|
| 456 |
+
matrix `A` [[linalg.general]].
|
| 457 |
+
|
| 458 |
+
*Mandates:*
|
| 459 |
+
|
| 460 |
+
- If `InMat1` has `layout_blas_packed` layout, then the layout’s
|
| 461 |
+
`Triangle` template argument has the same type as the function’s
|
| 462 |
+
`Triangle` template argument;
|
| 463 |
+
- *`possibly-multipliable`*`<InMat1, OutMat, InMat2>()` is `true`; and
|
| 464 |
+
- *`compatible-static-extents`*`<InMat1, InMat1>(0, 1)` is `true`.
|
| 465 |
+
|
| 466 |
+
*Preconditions:*
|
| 467 |
+
|
| 468 |
+
- *`multipliable`*`(A, X, B)` is `true`, and
|
| 469 |
+
- `A.extent(0) == A.extent(1)` is `true`.
|
| 470 |
+
|
| 471 |
+
*Effects:* Computes X' such that AX' = B, and assigns each element of X'
|
| 472 |
+
to the corresponding element of X. If no such X' exists, then the
|
| 473 |
+
elements of `X` are valid but unspecified.
|
| 474 |
+
|
| 475 |
+
*Complexity:* 𝑂(`A.extent(0)` × `X.extent(1)` × `X.extent(1)`).
|
| 476 |
+
|
| 477 |
+
[*Note 2*: Since the triangular matrix is on the left, the desired
|
| 478 |
+
`divide` implementation in the case of noncommutative multiplication is
|
| 479 |
+
mathematically equivalent to $y^{-1} x$, where x is the first argument
|
| 480 |
+
and y is the second argument, and $y^{-1}$ denotes the multiplicative
|
| 481 |
+
inverse of y. — *end note*]
|
| 482 |
+
|
| 483 |
+
``` cpp
|
| 484 |
+
template<in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 485 |
+
in-matrix InMat2, out-matrix OutMat>
|
| 486 |
+
void triangular_matrix_matrix_left_solve(InMat1 A, Triangle t, DiagonalStorage d,
|
| 487 |
+
InMat2 B, OutMat X);
|
| 488 |
+
```
|
| 489 |
+
|
| 490 |
+
*Effects:* Equivalent to:
|
| 491 |
+
|
| 492 |
+
``` cpp
|
| 493 |
+
triangular_matrix_matrix_left_solve(A, t, d, B, X, divides<void>{});
|
| 494 |
+
```
|
| 495 |
+
|
| 496 |
+
``` cpp
|
| 497 |
+
template<class ExecutionPolicy, in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 498 |
+
in-matrix InMat2, out-matrix OutMat>
|
| 499 |
+
void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec,
|
| 500 |
+
InMat1 A, Triangle t, DiagonalStorage d,
|
| 501 |
+
InMat2 B, OutMat X);
|
| 502 |
+
```
|
| 503 |
+
|
| 504 |
+
*Effects:* Equivalent to:
|
| 505 |
+
|
| 506 |
+
``` cpp
|
| 507 |
+
triangular_matrix_matrix_left_solve(std::forward<ExecutionPolicy>(exec),
|
| 508 |
+
A, t, d, B, X, divides<void>{});
|
| 509 |
+
```
|
| 510 |
+
|
| 511 |
+
``` cpp
|
| 512 |
+
template<in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 513 |
+
in-matrix InMat2, out-matrix OutMat, class BinaryDivideOp>
|
| 514 |
+
void triangular_matrix_matrix_right_solve(InMat1 A, Triangle t, DiagonalStorage d,
|
| 515 |
+
InMat2 B, OutMat X, BinaryDivideOp divide);
|
| 516 |
+
template<class ExecutionPolicy,
|
| 517 |
+
in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 518 |
+
in-matrix InMat2, out-matrix OutMat, class BinaryDivideOp>
|
| 519 |
+
void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec,
|
| 520 |
+
InMat1 A, Triangle t, DiagonalStorage d,
|
| 521 |
+
InMat2 B, OutMat X, BinaryDivideOp divide);
|
| 522 |
+
```
|
| 523 |
+
|
| 524 |
+
These functions perform multiple matrix solves, taking into account the
|
| 525 |
+
`Triangle` and `DiagonalStorage` parameters that apply to the triangular
|
| 526 |
+
matrix `A` [[linalg.general]].
|
| 527 |
+
|
| 528 |
+
*Mandates:*
|
| 529 |
+
|
| 530 |
+
- If `InMat1` has `layout_blas_packed` layout, then the layout’s
|
| 531 |
+
`Triangle` template argument has the same type as the function’s
|
| 532 |
+
`Triangle` template argument;
|
| 533 |
+
- *`possibly-multipliable`*`<OutMat, InMat1, InMat2>()` is `true`; and
|
| 534 |
+
- *`compatible-static-extents`*`<InMat1, InMat1>(0,1)` is `true`.
|
| 535 |
+
|
| 536 |
+
*Preconditions:*
|
| 537 |
+
|
| 538 |
+
- *`multipliable`*`(X, A, B)` is `true`, and
|
| 539 |
+
- `A.extent(0) == A.extent(1)` is `true`.
|
| 540 |
+
|
| 541 |
+
*Effects:* Computes X' such that X'A = B, and assigns each element of X'
|
| 542 |
+
to the corresponding element of X. If no such X' exists, then the
|
| 543 |
+
elements of `X` are valid but unspecified.
|
| 544 |
+
|
| 545 |
+
*Complexity:* O( `B.extent(0)` ⋅ `B.extent(1)` ⋅ `A.extent(1)` )
|
| 546 |
+
|
| 547 |
+
[*Note 1*: Since the triangular matrix is on the right, the desired
|
| 548 |
+
`divide` implementation in the case of noncommutative multiplication is
|
| 549 |
+
mathematically equivalent to $x y^{-1}$, where x is the first argument
|
| 550 |
+
and y is the second argument, and $y^{-1}$ denotes the multiplicative
|
| 551 |
+
inverse of y. — *end note*]
|
| 552 |
+
|
| 553 |
+
``` cpp
|
| 554 |
+
template<in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 555 |
+
in-matrix InMat2, out-matrix OutMat>
|
| 556 |
+
void triangular_matrix_matrix_right_solve(InMat1 A, Triangle t, DiagonalStorage d,
|
| 557 |
+
InMat2 B, OutMat X);
|
| 558 |
+
```
|
| 559 |
+
|
| 560 |
+
*Effects:* Equivalent to:
|
| 561 |
+
|
| 562 |
+
``` cpp
|
| 563 |
+
triangular_matrix_matrix_right_solve(A, t, d, B, X, divides<void>{});
|
| 564 |
+
```
|
| 565 |
+
|
| 566 |
+
``` cpp
|
| 567 |
+
template<class ExecutionPolicy, in-matrix InMat1, class Triangle, class DiagonalStorage,
|
| 568 |
+
in-matrix InMat2, out-matrix OutMat>
|
| 569 |
+
void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec,
|
| 570 |
+
InMat1 A, Triangle t, DiagonalStorage d,
|
| 571 |
+
InMat2 B, OutMat X);
|
| 572 |
+
```
|
| 573 |
+
|
| 574 |
+
*Effects:* Equivalent to:
|
| 575 |
+
|
| 576 |
+
``` cpp
|
| 577 |
+
triangular_matrix_matrix_right_solve(std::forward<ExecutionPolicy>(exec),
|
| 578 |
+
A, t, d, B, X, divides<void>{});
|
| 579 |
+
```
|
| 580 |
+
|
| 581 |
+
#### Solve multiple triangular linear systems in-place <a id="linalg.algs.blas3.inplacetrsm">[[linalg.algs.blas3.inplacetrsm]]</a>
|
| 582 |
+
|
| 583 |
+
[*Note 1*: These functions correspond to the BLAS function
|
| 584 |
+
`xTRSM`. — *end note*]
|
| 585 |
+
|
| 586 |
+
``` cpp
|
| 587 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 588 |
+
inout-matrix InOutMat, class BinaryDivideOp>
|
| 589 |
+
void triangular_matrix_matrix_left_solve(InMat A, Triangle t, DiagonalStorage d,
|
| 590 |
+
InOutMat B, BinaryDivideOp divide);
|
| 591 |
+
template<class ExecutionPolicy, in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 592 |
+
inout-matrix InOutMat, class BinaryDivideOp>
|
| 593 |
+
void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec,
|
| 594 |
+
InMat A, Triangle t, DiagonalStorage d,
|
| 595 |
+
InOutMat B, BinaryDivideOp divide);
|
| 596 |
+
```
|
| 597 |
+
|
| 598 |
+
These functions perform multiple in-place matrix solves, taking into
|
| 599 |
+
account the `Triangle` and `DiagonalStorage` parameters that apply to
|
| 600 |
+
the triangular matrix `A` [[linalg.general]].
|
| 601 |
+
|
| 602 |
+
[*Note 1*: This algorithm makes it possible to compute factorizations
|
| 603 |
+
like Cholesky and LU in place. Performing triangular solve in place
|
| 604 |
+
hinders parallelization. However, other `ExecutionPolicy` specific
|
| 605 |
+
optimizations, such as vectorization, are still possible. — *end note*]
|
| 606 |
+
|
| 607 |
+
*Mandates:*
|
| 608 |
+
|
| 609 |
+
- If `InMat` has `layout_blas_packed` layout, then the layout’s
|
| 610 |
+
`Triangle` template argument has the same type as the function’s
|
| 611 |
+
`Triangle` template argument;
|
| 612 |
+
- *`possibly-multipliable`*`<InMat, InOutMat, InOutMat>()` is `true`;
|
| 613 |
+
and
|
| 614 |
+
- *`compatible-static-extents`*`<InMat, InMat>(0, 1)` is `true`.
|
| 615 |
+
|
| 616 |
+
*Preconditions:*
|
| 617 |
+
|
| 618 |
+
- *`multipliable`*`(A, B, B)` is `true`, and
|
| 619 |
+
- `A.extent(0) == A.extent(1)` is `true`.
|
| 620 |
+
|
| 621 |
+
*Effects:* Computes X' such that AX' = B, and assigns each element of X'
|
| 622 |
+
to the corresponding element of B. If so such X' exists, then the
|
| 623 |
+
elements of `B` are valid but unspecified.
|
| 624 |
+
|
| 625 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `B.extent(1)`).
|
| 626 |
+
|
| 627 |
+
``` cpp
|
| 628 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 629 |
+
void triangular_matrix_matrix_left_solve(InMat A, Triangle t, DiagonalStorage d,
|
| 630 |
+
InOutMat B);
|
| 631 |
+
```
|
| 632 |
+
|
| 633 |
+
*Effects:* Equivalent to:
|
| 634 |
+
|
| 635 |
+
``` cpp
|
| 636 |
+
triangular_matrix_matrix_left_solve(A, t, d, B, divides<void>{});
|
| 637 |
+
```
|
| 638 |
+
|
| 639 |
+
``` cpp
|
| 640 |
+
template<class ExecutionPolicy,
|
| 641 |
+
in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 642 |
+
void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec,
|
| 643 |
+
InMat A, Triangle t, DiagonalStorage d,
|
| 644 |
+
InOutMat B);
|
| 645 |
+
```
|
| 646 |
+
|
| 647 |
+
*Effects:* Equivalent to:
|
| 648 |
+
|
| 649 |
+
``` cpp
|
| 650 |
+
triangular_matrix_matrix_left_solve(std::forward<ExecutionPolicy>(exec),
|
| 651 |
+
A, t, d, B, divides<void>{});
|
| 652 |
+
```
|
| 653 |
+
|
| 654 |
+
``` cpp
|
| 655 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 656 |
+
inout-matrix InOutMat, class BinaryDivideOp>
|
| 657 |
+
void triangular_matrix_matrix_right_solve(InMat A, Triangle t, DiagonalStorage d,
|
| 658 |
+
InOutMat B, BinaryDivideOp divide);
|
| 659 |
+
template<class ExecutionPolicy, in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 660 |
+
inout-matrix InOutMat, class BinaryDivideOp>
|
| 661 |
+
void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec,
|
| 662 |
+
InMat A, Triangle t, DiagonalStorage d,
|
| 663 |
+
InOutMat B, BinaryDivideOp divide);
|
| 664 |
+
```
|
| 665 |
+
|
| 666 |
+
These functions perform multiple in-place matrix solves, taking into
|
| 667 |
+
account the `Triangle` and `DiagonalStorage` parameters that apply to
|
| 668 |
+
the triangular matrix `A` [[linalg.general]].
|
| 669 |
+
|
| 670 |
+
[*Note 2*: This algorithm makes it possible to compute factorizations
|
| 671 |
+
like Cholesky and LU in place. Performing triangular solve in place
|
| 672 |
+
hinders parallelization. However, other `ExecutionPolicy` specific
|
| 673 |
+
optimizations, such as vectorization, are still possible. — *end note*]
|
| 674 |
+
|
| 675 |
+
*Mandates:*
|
| 676 |
+
|
| 677 |
+
- If `InMat` has `layout_blas_packed` layout, then the layout’s
|
| 678 |
+
`Triangle` template argument has the same type as the function’s
|
| 679 |
+
`Triangle` template argument;
|
| 680 |
+
- *`possibly-multipliable`*`<InOutMat, InMat, InOutMat>()` is `true`;
|
| 681 |
+
and
|
| 682 |
+
- *`compatible-static-extents`*`<InMat, InMat>(0, 1)` is `true`.
|
| 683 |
+
|
| 684 |
+
*Preconditions:*
|
| 685 |
+
|
| 686 |
+
- *`multipliable`*`(B, A, B)` is `true`, and
|
| 687 |
+
- `A.extent(0) == A.extent(1)` is `true`.
|
| 688 |
+
|
| 689 |
+
*Effects:* Computes X' such that X'A = B, and assigns each element of X'
|
| 690 |
+
to the corresponding element of B. If so such X' exists, then the
|
| 691 |
+
elements of `B` are valid but unspecified.
|
| 692 |
+
|
| 693 |
+
*Complexity:* 𝑂(`A.extent(0)` × `A.extent(1)` × `B.extent(1)`).
|
| 694 |
+
|
| 695 |
+
``` cpp
|
| 696 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 697 |
+
void triangular_matrix_matrix_right_solve(InMat A, Triangle t, DiagonalStorage d, InOutMat B);
|
| 698 |
+
```
|
| 699 |
+
|
| 700 |
+
*Effects:* Equivalent to:
|
| 701 |
+
|
| 702 |
+
``` cpp
|
| 703 |
+
triangular_matrix_matrix_right_solve(A, t, d, B, divides<void>{});
|
| 704 |
+
```
|
| 705 |
+
|
| 706 |
+
``` cpp
|
| 707 |
+
template<class ExecutionPolicy,
|
| 708 |
+
in-matrix InMat, class Triangle, class DiagonalStorage, inout-matrix InOutMat>
|
| 709 |
+
void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec,
|
| 710 |
+
InMat A, Triangle t, DiagonalStorage d,
|
| 711 |
+
InOutMat B);
|
| 712 |
+
```
|
| 713 |
+
|
| 714 |
+
*Effects:* Equivalent to:
|
| 715 |
+
|
| 716 |
+
``` cpp
|
| 717 |
+
triangular_matrix_matrix_right_solve(std::forward<ExecutionPolicy>(exec),
|
| 718 |
+
A, t, d, B, divides<void>{});
|
| 719 |
+
```
|
| 720 |
+
|