tmp/tmpu4bvd1wc/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Solve a triangular linear system <a id="linalg.algs.blas2.trsv">[[linalg.algs.blas2.trsv]]</a>
|
| 2 |
+
|
| 3 |
+
[*Note 1*: These functions correspond to the BLAS functions `xTRSV` and
|
| 4 |
+
`xTPSV`. — *end note*]
|
| 5 |
+
|
| 6 |
+
The following elements apply to all functions in
|
| 7 |
+
[[linalg.algs.blas2.trsv]].
|
| 8 |
+
|
| 9 |
+
*Mandates:*
|
| 10 |
+
|
| 11 |
+
- If `InMat` has `layout_blas_packed` layout, then the layout’s
|
| 12 |
+
`Triangle` template argument has the same type as the function’s
|
| 13 |
+
`Triangle` template argument;
|
| 14 |
+
- `compatible-static-extents<decltype(A), decltype(A)>(0, 1)` is `true`;
|
| 15 |
+
- `compatible-static-extents<decltype(A), decltype(b)>(0, 0)` is `true`;
|
| 16 |
+
and
|
| 17 |
+
- `compatible-static-extents<decltype(A), decltype(x)>(0, 0)` is `true`
|
| 18 |
+
for those overloads that take an `x` parameter.
|
| 19 |
+
|
| 20 |
+
*Preconditions:*
|
| 21 |
+
|
| 22 |
+
- `A.extent(0)` equals `A.extent(1)`,
|
| 23 |
+
- `A.extent(0)` equals `b.extent(0)`, and
|
| 24 |
+
- `A.extent(0)` equals `x.extent(0)` for those overloads that take an
|
| 25 |
+
`x` parameter.
|
| 26 |
+
|
| 27 |
+
``` cpp
|
| 28 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 29 |
+
in-vector InVec, out-vector OutVec, class BinaryDivideOp>
|
| 30 |
+
void triangular_matrix_vector_solve(InMat A, Triangle t, DiagonalStorage d,
|
| 31 |
+
InVec b, OutVec x, BinaryDivideOp divide);
|
| 32 |
+
template<class ExecutionPolicy, in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 33 |
+
in-vector InVec, out-vector OutVec, class BinaryDivideOp>
|
| 34 |
+
void triangular_matrix_vector_solve(ExecutionPolicy&& exec,
|
| 35 |
+
InMat A, Triangle t, DiagonalStorage d,
|
| 36 |
+
InVec b, OutVec x, BinaryDivideOp divide);
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
These functions perform a triangular solve, taking into account the
|
| 40 |
+
`Triangle` and `DiagonalStorage` parameters that apply to the triangular
|
| 41 |
+
matrix `A` [[linalg.general]].
|
| 42 |
+
|
| 43 |
+
*Effects:* Computes a vector x' such that b = A x', and assigns each
|
| 44 |
+
element of x' to the corresponding element of x. If no such x' exists,
|
| 45 |
+
then the elements of `x` are valid but unspecified.
|
| 46 |
+
|
| 47 |
+
*Complexity:* 𝑂(`A.extent(1)` × `b.extent(0)`).
|
| 48 |
+
|
| 49 |
+
``` cpp
|
| 50 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 51 |
+
in-vector InVec, out-vector OutVec>
|
| 52 |
+
void triangular_matrix_vector_solve(InMat A, Triangle t, DiagonalStorage d, InVec b, OutVec x);
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
*Effects:* Equivalent to:
|
| 56 |
+
|
| 57 |
+
``` cpp
|
| 58 |
+
triangular_matrix_vector_solve(A, t, d, b, x, divides<void>{});
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
``` cpp
|
| 62 |
+
template<class ExecutionPolicy, in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 63 |
+
in-vector InVec, out-vector OutVec>
|
| 64 |
+
void triangular_matrix_vector_solve(ExecutionPolicy&& exec,
|
| 65 |
+
InMat A, Triangle t, DiagonalStorage d, InVec b, OutVec x);
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
*Effects:* Equivalent to:
|
| 69 |
+
|
| 70 |
+
``` cpp
|
| 71 |
+
triangular_matrix_vector_solve(std::forward<ExecutionPolicy>(exec),
|
| 72 |
+
A, t, d, b, x, divides<void>{});
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
``` cpp
|
| 76 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 77 |
+
inout-vector InOutVec, class BinaryDivideOp>
|
| 78 |
+
void triangular_matrix_vector_solve(InMat A, Triangle t, DiagonalStorage d,
|
| 79 |
+
InOutVec b, BinaryDivideOp divide);
|
| 80 |
+
template<class ExecutionPolicy, in-matrix InMat, class Triangle, class DiagonalStorage,
|
| 81 |
+
inout-vector InOutVec, class BinaryDivideOp>
|
| 82 |
+
void triangular_matrix_vector_solve(ExecutionPolicy&& exec,
|
| 83 |
+
InMat A, Triangle t, DiagonalStorage d,
|
| 84 |
+
InOutVec b, BinaryDivideOp divide);
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
These functions perform an in-place triangular solve, taking into
|
| 88 |
+
account the `Triangle` and `DiagonalStorage` parameters that apply to
|
| 89 |
+
the triangular matrix `A` [[linalg.general]].
|
| 90 |
+
|
| 91 |
+
[*Note 1*: Performing triangular solve in place hinders
|
| 92 |
+
parallelization. However, other `ExecutionPolicy` specific
|
| 93 |
+
optimizations, such as vectorization, are still possible. — *end note*]
|
| 94 |
+
|
| 95 |
+
*Effects:* Computes a vector x' such that b = A x', and assigns each
|
| 96 |
+
element of x' to the corresponding element of b. If no such x' exists,
|
| 97 |
+
then the elements of `b` are valid but unspecified.
|
| 98 |
+
|
| 99 |
+
*Complexity:* 𝑂(`A.extent(1)` × `b.extent(0)`).
|
| 100 |
+
|
| 101 |
+
``` cpp
|
| 102 |
+
template<in-matrix InMat, class Triangle, class DiagonalStorage, inout-vector InOutVec>
|
| 103 |
+
void triangular_matrix_vector_solve(InMat A, Triangle t, DiagonalStorage d, InOutVec b);
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
*Effects:* Equivalent to:
|
| 107 |
+
|
| 108 |
+
``` cpp
|
| 109 |
+
triangular_matrix_vector_solve(A, t, d, b, divides<void>{});
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
``` cpp
|
| 113 |
+
template<class ExecutionPolicy,
|
| 114 |
+
in-matrix InMat, class Triangle, class DiagonalStorage, inout-vector InOutVec>
|
| 115 |
+
void triangular_matrix_vector_solve(ExecutionPolicy&& exec,
|
| 116 |
+
InMat A, Triangle t, DiagonalStorage d, InOutVec b);
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
*Effects:* Equivalent to:
|
| 120 |
+
|
| 121 |
+
``` cpp
|
| 122 |
+
triangular_matrix_vector_solve(std::forward<ExecutionPolicy>(exec),
|
| 123 |
+
A, t, d, b, divides<void>{});
|
| 124 |
+
```
|
| 125 |
+
|