Files
cppdraft_translate/cppdraft/linalg/algs/blas3.md
2025-10-25 03:02:53 +03:00

63 KiB
Raw Blame History

[linalg.algs.blas3]

29 Numerics library [numerics]

29.9 Basic linear algebra algorithms [linalg]

29.9.15 BLAS 3 algorithms [linalg.algs.blas3]

29.9.15.1 General matrix-matrix product [linalg.algs.blas3.gemm]

1

#

[Note 1:

These functions correspond to the BLAS function xGEMM[bib].

— end note]

2

#

The following elements apply to all functions in [linalg.algs.blas3.gemm] in addition to function-specific elements.

3

#

Mandates: possibly-multipliable<decltype(A), decltype(B), decltype(C)>() is true.

4

#

Preconditions: multipliable(A, B, C) is true.

5

#

Complexity: O(A.extent(0)×A.extent(1)×B.extent(1)).

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void matrix_product(InMat1 A, InMat2 B, OutMat C); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, OutMat C);

6

#

Effects: Computes C=AB.

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat3, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void matrix_product(InMat1 A, InMat2 B, InMat3 E, OutMat C); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat3, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, InMat3 E, OutMat C);

7

#

Mandates: possibly-addable<InMat3, InMat3, OutMat>() is true.

8

#

Preconditions: addable(E, E, C) is true.

9

#

Effects: Computes C=E+AB.

10

#

Remarks: C may alias E.

29.9.15.2 Symmetric, Hermitian, and triangular matrix-matrix product [linalg.algs.blas3.xxmm]

1

#

[Note 1:

These functions correspond to the BLAS functionsxSYMM, xHEMM, and xTRMM[bib].

— end note]

2

#

The following elements apply to all functions in [linalg.algs.blas3.xxmm] in addition to function-specific elements.

3

#

Mandates:

possibly-multipliable<decltype(A), decltype(B), decltype(C)>() is true, and

possibly-addable<decltype(E), decltype(E), decltype(C)>() is true for those overloads that take an E parameter.

4

#

Preconditions:

multipliable(A, B, C) is true, and

addable(E, E, C) is true for those overloads that take an E parameter.

5

#

Complexity: O(A.extent(0)×A.extent(1)×B.extent(1)).

🔗

`template<in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat> void symmetric_matrix_product(InMat1 A, Triangle t, InMat2 B, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat> void symmetric_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, InMat2 B, OutMat C);

template<in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat> void hermitian_matrix_product(InMat1 A, Triangle t, InMat2 B, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, class Triangle, in-matrix InMat2, out-matrix OutMat> void hermitian_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, InMat2 B, OutMat C);

template<in-matrix InMat1, class Triangle, class DiagonalStorage, in-matrix InMat2, out-matrix OutMat> void triangular_matrix_product(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, class Triangle, class DiagonalStorage, in-matrix InMat2, out-matrix OutMat> void triangular_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat C); `

6

#

These functions perform a matrix-matrix multiply, taking into account the Triangle and DiagonalStorage (if applicable) parameters that apply to the symmetric, Hermitian, or triangular (respectively) matrix A ([linalg.general]).

7

#

Mandates:

If InMat1 has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument; and

compatible-static-extents<InMat1, InMat1>(0, 1) is true.

8

#

Preconditions: A.extent(0) == A.extent(1) is true.

9

#

Effects: Computes C=AB.

🔗

` template<in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat> void symmetric_matrix_product(InMat1 A, InMat2 B, Triangle t, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat> void symmetric_matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, Triangle t, OutMat C);

template<in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat> void hermitian_matrix_product(InMat1 A, InMat2 B, Triangle t, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2, class Triangle, out-matrix OutMat> void hermitian_matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, Triangle t, OutMat C);

template<in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage, out-matrix OutMat> void triangular_matrix_product(InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage, out-matrix OutMat> void triangular_matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, OutMat C); `

10

#

These functions perform a matrix-matrix multiply, taking into account the Triangle and DiagonalStorage (if applicable) parameters that apply to the symmetric, Hermitian, or triangular (respectively) matrix B ([linalg.general]).

11

#

Mandates:

If InMat2 has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument; and

compatible-static-extents<InMat2, InMat2>(0, 1) is true.

12

#

Preconditions: B.extent(0) == B.extent(1) is true.

13

#

Effects: Computes C=AB.

🔗

`template<in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat> void symmetric_matrix_product(InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat> void symmetric_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C);

template<in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat> void hermitian_matrix_product(InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, class Triangle, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat> void hermitian_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, InMat2 B, InMat3 E, OutMat C);

template<in-matrix InMat1, class Triangle, class DiagonalStorage, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat> void triangular_matrix_product(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, InMat3 E, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, class Triangle, class DiagonalStorage, in-matrix InMat2, in-matrix InMat3, out-matrix OutMat> void triangular_matrix_product(ExecutionPolicy&& exec, InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, InMat3 E, OutMat C); `

14

#

These functions perform a potentially overwriting matrix-matrix multiply-add, taking into account the Triangle and DiagonalStorage (if applicable) parameters that apply to the symmetric, Hermitian, or triangular (respectively) matrix A ([linalg.general]).

15

#

Mandates:

If InMat1 has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument; and

compatible-static-extents<InMat1, InMat1>(0, 1) is true.

16

#

Preconditions: A.extent(0) == A.extent(1) is true.

17

#

Effects: Computes C=E+AB.

18

#

Remarks: C may alias E.

🔗

`template<in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3, out-matrix OutMat> void symmetric_matrix_product(InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3, out-matrix OutMat> void symmetric_matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C);

template<in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3, out-matrix OutMat> void hermitian_matrix_product(InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2, class Triangle, in-matrix InMat3, out-matrix OutMat> void hermitian_matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, Triangle t, InMat3 E, OutMat C);

template<in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage, in-matrix InMat3, out-matrix OutMat> void triangular_matrix_product(InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, InMat3 E, OutMat C); template<class ExecutionPolicy, in-matrix InMat1, in-matrix InMat2, class Triangle, class DiagonalStorage, in-matrix InMat3, out-matrix OutMat> void triangular_matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, Triangle t, DiagonalStorage d, InMat3 E, OutMat C); `

19

#

These functions perform a potentially overwriting matrix-matrix multiply-add, taking into account the Triangle and DiagonalStorage (if applicable) parameters that apply to the symmetric, Hermitian, or triangular (respectively) matrix B ([linalg.general]).

20

#

Mandates:

If InMat2 has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument; and

compatible-static-extents<InMat2, InMat2>(0, 1) is true.

21

#

Preconditions: B.extent(0) == B.extent(1) is true.

22

#

Effects: Computes C=E+AB.

23

#

Remarks: C may alias E.

29.9.15.3 In-place triangular matrix-matrix product [linalg.algs.blas3.trmm]

1

#

These functions perform an in-place matrix-matrix multiply, taking into account the Triangle and DiagonalStorage parameters that apply to the triangular matrix A ([linalg.general]).

[Note 1:

These functions correspond to the BLAS function xTRMM[bib].

— end note]

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_left_product(InMat A, Triangle t, DiagonalStorage d, InOutMat C); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_left_product(ExecutionPolicy&& exec, InMat A, Triangle t, DiagonalStorage d, InOutMat C);

2

#

Mandates:

If InMat has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

possibly-multipliable<InMat, InOutMat, InOutMat>() is true; and

compatible-static-extents<InMat, InMat>(0, 1) is true.

3

#

Preconditions:

multipliable(A, C, C) is true, and

A.extent(0) == A.extent(1) is true.

4

#

Effects: Computes a matrix C′ such that C′=AC and assigns each element of C′ to the corresponding element of C.

5

#

Complexity: O(A.extent(0)×A.extent(1)×C.extent(0)).

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_right_product(InMat A, Triangle t, DiagonalStorage d, InOutMat C); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_right_product(ExecutionPolicy&& exec, InMat A, Triangle t, DiagonalStorage d, InOutMat C);

6

#

Mandates:

If InMat has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

possibly-multipliable<InOutMat, InMat, InOutMat>() is true; and

compatible-static-extents<InMat, InMat>(0, 1) is true.

7

#

Preconditions:

multipliable(C, A, C) is true, and

A.extent(0) == A.extent(1) is true.

8

#

Effects: Computes a matrix C′ such that C′=CA and assigns each element of C′ to the corresponding element of C.

9

#

Complexity: O(A.extent(0)×A.extent(1)×C.extent(0)).

29.9.15.4 Rank-k update of a symmetric or Hermitian matrix [linalg.algs.blas3.rankk]

1

#

[Note 1:

These functions correspond to the BLAS functionsxSYRK and xHERK[bib].

— end note]

2

#

The following elements apply to all functions in [linalg.algs.blas3.rankk].

3

#

Mandates:

If InOutMat has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

compatible-static-extents<decltype(A), decltype(A)>(0, 1) is true;

compatible-static-extents<decltype(C), decltype(C)>(0, 1) is true; and

compatible-static-extents<decltype(A), decltype(C)>(0, 0) is true.

4

#

Preconditions:

A.extent(0) equals A.extent(1),

C.extent(0) equals C.extent(1), and

A.extent(0) equals C.extent(0).

5

#

Complexity: O(A.extent(0)×A.extent(1)×C.extent(0)).

🔗

template<class Scalar, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void symmetric_matrix_rank_k_update(Scalar alpha, InMat A, InOutMat C, Triangle t); template<class ExecutionPolicy, class Scalar, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void symmetric_matrix_rank_k_update(ExecutionPolicy&& exec, Scalar alpha, InMat A, InOutMat C, Triangle t);

6

#

Effects: Computes a matrix C′ such that C′=C+αAAT, where the scalar α is alpha, and assigns each element of C′ to the corresponding element of C.

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void symmetric_matrix_rank_k_update(InMat A, InOutMat C, Triangle t); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void symmetric_matrix_rank_k_update(ExecutionPolicy&& exec, InMat A, InOutMat C, Triangle t);

7

#

Effects: Computes a matrix C′ such that C′=C+AAT, and assigns each element of C′ to the corresponding element of C.

🔗

template<class Scalar, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void hermitian_matrix_rank_k_update(Scalar alpha, InMat A, InOutMat C, Triangle t); template<class ExecutionPolicy, class Scalar, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void hermitian_matrix_rank_k_update(ExecutionPolicy&& exec, Scalar alpha, InMat A, InOutMat C, Triangle t);

8

#

Effects: Computes a matrix C′ such that C′=C+αAAH, where the scalar α is alpha, and assigns each element of C′ to the corresponding element of C.

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void hermitian_matrix_rank_k_update(InMat A, InOutMat C, Triangle t); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void hermitian_matrix_rank_k_update(ExecutionPolicy&& exec, InMat A, InOutMat C, Triangle t);

9

#

Effects: Computes a matrix C′ such that C′=C+AAH, and assigns each element of C′ to the corresponding element of C.

29.9.15.5 Rank-2k update of a symmetric or Hermitian matrix [linalg.algs.blas3.rank2k]

1

#

[Note 1:

These functions correspond to the BLAS functionsxSYR2K and xHER2K[bib].

— end note]

2

#

The following elements apply to all functions in [linalg.algs.blas3.rank2k].

3

#

Mandates:

If InOutMat has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

possibly-addable<decltype(A), decltype(B), decltype(C)>() is true; and

compatible-static-extents<decltype(A), decltype(A)>(0, 1) is true.

4

#

Preconditions:

addable(A, B, C) is true, and

A.extent(0) equals A.extent(1).

5

#

Complexity: O(A.extent(0)×A.extent(1)×C.extent(0)).

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void symmetric_matrix_rank_2k_update(InMat1 A, InMat2 B, InOutMat C, Triangle t); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void symmetric_matrix_rank_2k_update(ExecutionPolicy&& exec, InMat1 A, InMat2 B, InOutMat C, Triangle t);

6

#

Effects: Computes a matrix C′ such that C′=C+ABT+BAT, and assigns each element of C′ to the corresponding element of C.

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void hermitian_matrix_rank_2k_update(InMat1 A, InMat2 B, InOutMat C, Triangle t); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [possibly-packed-inout-matrix](linalg.helpers.concepts#concept:possibly-packed-inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class Triangle> void hermitian_matrix_rank_2k_update(ExecutionPolicy&& exec, InMat1 A, InMat2 B, InOutMat C, Triangle t);

7

#

Effects: Computes a matrix C′ such that C′=C+ABH+BAH, and assigns each element of C′ to the corresponding element of C.

29.9.15.6 Solve multiple triangular linear systems [linalg.algs.blas3.trsm]

1

#

[Note 1:

These functions correspond to the BLAS function xTRSM[bib].

— end note]

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat, class BinaryDivideOp> void triangular_matrix_matrix_left_solve(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X, BinaryDivideOp divide); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat, class BinaryDivideOp> void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec, InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X, BinaryDivideOp divide);

2

#

These functions perform multiple matrix solves, taking into account the Triangle and DiagonalStorage parameters that apply to the triangular matrix A ([linalg.general]).

3

#

Mandates:

If InMat1 has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

possibly-multipliable<InMat1, OutMat, InMat2>() is true; and

compatible-static-extents<InMat1, InMat1>(0, 1) is true.

4

#

Preconditions:

multipliable(A, X, B) is true, and

A.extent(0) == A.extent(1) is true.

5

#

Effects: Computes X′ such that AX′=B, and assigns each element of X′ to the corresponding element of X.

If no such X′ exists, then the elements of X are valid but unspecified.

6

#

Complexity: O(A.extent(0)×X.extent(1)×X.extent(1)).

7

#

[Note 2:

Since the triangular matrix is on the left, the desired divide implementation in the case of noncommutative multiplication is mathematically equivalent to y−1x, where x is the first argument and y is the second argument, and y−1 denotes the multiplicative inverse of y.

— end note]

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void triangular_matrix_matrix_left_solve(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X);

8

#

Effects: Equivalent to:triangular_matrix_matrix_left_solve(A, t, d, B, X, divides{});

🔗

template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec, InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X);

9

#

Effects: Equivalent to:triangular_matrix_matrix_left_solve(std::forward(exec), A, t, d, B, X, divides{});

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat, class BinaryDivideOp> void triangular_matrix_matrix_right_solve(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X, BinaryDivideOp divide); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat, class BinaryDivideOp> void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec, InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X, BinaryDivideOp divide);

10

#

These functions perform multiple matrix solves, taking into account the Triangle and DiagonalStorage parameters that apply to the triangular matrix A ([linalg.general]).

11

#

Mandates:

If InMat1 has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

possibly-multipliable<OutMat, InMat1, InMat2>() is true; and

compatible-static-extents<InMat1, InMat1>(0,1) is true.

12

#

Preconditions:

multipliable(X, A, B) is true, and

A.extent(0) == A.extent(1) is true.

13

#

Effects: Computes X′ such that X′A=B, and assigns each element of X′ to the corresponding element of X.

If no such X′ exists, then the elements of X are valid but unspecified.

14

#

Complexity: O( B.extent(0) ⋠B.extent(1) ⋠A.extent(1) )

[Note 3:

Since the triangular matrix is on the right, the desired divide implementation in the case of noncommutative multiplication is mathematically equivalent to xy−1, where x is the first argument and y is the second argument, and y−1 denotes the multiplicative inverse of y.

— end note]

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void triangular_matrix_matrix_right_solve(InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X);

15

#

Effects: Equivalent to:triangular_matrix_matrix_right_solve(A, t, d, B, X, divides{});

🔗

template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat1, class Triangle, class DiagonalStorage, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat2, [out-matrix](linalg.helpers.concepts#concept:out-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") OutMat> void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec, InMat1 A, Triangle t, DiagonalStorage d, InMat2 B, OutMat X);

16

#

Effects: Equivalent to:triangular_matrix_matrix_right_solve(std::forward(exec), A, t, d, B, X, divides{});

29.9.15.7 Solve multiple triangular linear systems in-place [linalg.algs.blas3.inplacetrsm]

1

#

[Note 1:

These functions correspond to the BLAS function xTRSM[bib].

— end note]

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class BinaryDivideOp> void triangular_matrix_matrix_left_solve(InMat A, Triangle t, DiagonalStorage d, InOutMat B, BinaryDivideOp divide); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class BinaryDivideOp> void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec, InMat A, Triangle t, DiagonalStorage d, InOutMat B, BinaryDivideOp divide);

2

#

These functions perform multiple in-place matrix solves, taking into account the Triangle and DiagonalStorage parameters that apply to the triangular matrix A ([linalg.general]).

[Note 2:

This algorithm makes it possible to compute factorizations like Cholesky and LU in place.

Performing triangular solve in place hinders parallelization.

However, other ExecutionPolicy specific optimizations, such as vectorization, are still possible.

— end note]

3

#

Mandates:

If InMat has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

possibly-multipliable<InMat, InOutMat, InOutMat>() is true; and

compatible-static-extents<InMat, InMat>(0, 1) is true.

4

#

Preconditions:

multipliable(A, B, B) is true, and

A.extent(0) == A.extent(1) is true.

5

#

Effects: Computes X′ such that AX′=B, and assigns each element of X′ to the corresponding element of B.

If so such X′ exists, then the elements of B are valid but unspecified.

6

#

Complexity: O(A.extent(0)×A.extent(1)×B.extent(1)).

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_matrix_left_solve(InMat A, Triangle t, DiagonalStorage d, InOutMat B);

7

#

Effects: Equivalent to:triangular_matrix_matrix_left_solve(A, t, d, B, divides{});

🔗

template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_matrix_left_solve(ExecutionPolicy&& exec, InMat A, Triangle t, DiagonalStorage d, InOutMat B);

8

#

Effects: Equivalent to:triangular_matrix_matrix_left_solve(std::forward(exec), A, t, d, B, divides{});

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class BinaryDivideOp> void triangular_matrix_matrix_right_solve(InMat A, Triangle t, DiagonalStorage d, InOutMat B, BinaryDivideOp divide); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat, class BinaryDivideOp> void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec, InMat A, Triangle t, DiagonalStorage d, InOutMat B, BinaryDivideOp divide);

9

#

These functions perform multiple in-place matrix solves, taking into account the Triangle and DiagonalStorage parameters that apply to the triangular matrix A ([linalg.general]).

[Note 3:

This algorithm makes it possible to compute factorizations like Cholesky and LU in place.

Performing triangular solve in place hinders parallelization.

However, other ExecutionPolicy specific optimizations, such as vectorization, are still possible.

— end note]

10

#

Mandates:

If InMat has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;

possibly-multipliable<InOutMat, InMat, InOutMat>() is true; and

compatible-static-extents<InMat, InMat>(0, 1) is true.

11

#

Preconditions:

multipliable(B, A, B) is true, and

A.extent(0) == A.extent(1) is true.

12

#

Effects: Computes X′ such that X′A=B, and assigns each element of X′ to the corresponding element of B.

If so such X′ exists, then the elements of B are valid but unspecified.

13

#

Complexity: O(A.extent(0)×A.extent(1)×B.extent(1)).

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_matrix_right_solve(InMat A, Triangle t, DiagonalStorage d, InOutMat B);

14

#

Effects: Equivalent to:triangular_matrix_matrix_right_solve(A, t, d, B, divides{});

🔗

template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Triangle, class DiagonalStorage, [inout-matrix](linalg.helpers.concepts#concept:inout-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InOutMat> void triangular_matrix_matrix_right_solve(ExecutionPolicy&& exec, InMat A, Triangle t, DiagonalStorage d, InOutMat B);

15

#

Effects: Equivalent to:triangular_matrix_matrix_right_solve(std::forward(exec), A, t, d, B, divides{});