1HPL_dtrsm(3) HPL Library Functions HPL_dtrsm(3)
2
3
4
6 HPL_dtrsm - B := A^{-1} * B or B := B * A^{-1}.
7
9 #include "hpl.h"
10
11 void HPL_dtrsm( const enum HPL_ORDER ORDER, const enum HPL_SIDE SIDE,
12 const enum HPL_UPLO UPLO, const enum HPL_TRANS TRANS, const enum
13 HPL_DIAG DIAG, const int M, const int N, const double ALPHA, const dou‐
14 ble * A, const int LDA, double * B, const int LDB );
15
17 HPL_dtrsm solves one of the matrix equations
18
19 op( A ) * X = alpha * B, or X * op( A ) = alpha * B,
20
21 where alpha is a scalar, X and B are m by n matrices, A is a unit, or
22 non-unit, upper or lower triangular matrix and op(A) is one of
23
24 op( A ) = A or op( A ) = A^T.
25
26 The matrix X is overwritten on B.
27
28 No test for singularity or near-singularity is included in this
29 routine. Such tests must be performed before calling this routine.
30
32 ORDER (local input) const enum HPL_ORDER
33 On entry, ORDER specifies the storage format of the operands
34 as follows:
35 ORDER = HplRowMajor,
36 ORDER = HplColumnMajor.
37
38 SIDE (local input) const enum HPL_SIDE
39 On entry, SIDE specifies whether op(A) appears on the left
40 or right of X as follows:
41 SIDE==HplLeft op( A ) * X = alpha * B,
42 SIDE==HplRight X * op( A ) = alpha * B.
43
44 UPLO (local input) const enum HPL_UPLO
45 On entry, UPLO specifies whether the upper or lower
46 triangular part of the array A is to be referenced. When
47 UPLO==HplUpper, only the upper triangular part of A is to be
48 referenced, otherwise only the lower triangular part of A is to
49 be referenced.
50
51 TRANS (local input) const enum HPL_TRANS
52 On entry, TRANSA specifies the form of op(A) to be used in
53 the matrix-matrix operation follows:
54 TRANSA==HplNoTrans : op( A ) = A,
55 TRANSA==HplTrans : op( A ) = A^T,
56 TRANSA==HplConjTrans : op( A ) = A^T.
57
58 DIAG (local input) const enum HPL_DIAG
59 On entry, DIAG specifies whether A is unit triangular or
60 not. When DIAG==HplUnit, A is assumed to be unit triangular,
61 and otherwise, A is not assumed to be unit triangular.
62
63 M (local input) const int
64 On entry, M specifies the number of rows of the matrix B.
65 M must be at least zero.
66
67 N (local input) const int
68 On entry, N specifies the number of columns of the matrix B.
69 N must be at least zero.
70
71 ALPHA (local input) const double
72 On entry, ALPHA specifies the scalar alpha. When ALPHA is
73 supplied as zero then the elements of the matrix B need not
74 be set on input.
75
76 A (local input) const double *
77 On entry, A points to an array of size equal to or greater
78 than LDA * k, where k is m when SIDE==HplLeft and is n
79 otherwise. Before entry with UPLO==HplUpper, the leading k
80 by k upper triangular part of the array A must contain the
81 upper triangular matrix and the strictly lower triangular
82 part of A is not referenced. When UPLO==HplLower on entry,
83 the leading k by k lower triangular part of the array A must
84 contain the lower triangular matrix and the strictly upper
85 triangular part of A is not referenced.
86
87 Note that when DIAG==HplUnit, the diagonal elements of A
88 not referenced either, but are assumed to be unity.
89
90 LDA (local input) const int
91 On entry, LDA specifies the leading dimension of A as
92 declared in the calling (sub) program. LDA must be at
93 least MAX(1,m) when SIDE==HplLeft, and MAX(1,n) otherwise.
94
95 B (local input/output) double *
96 On entry, B points to an array of size equal to or greater
97 than LDB * n. Before entry, the leading m by n part of the
98 array B must contain the matrix B, except when beta is zero,
99 in which case B need not be set on entry. On exit, the array B
100 is overwritten by the m by n solution matrix.
101
102 LDB (local input) const int
103 On entry, LDB specifies the leading dimension of B as
104 declared in the calling (sub) program. LDB must be at
105 least MAX(1,m).
106
108 #include "hpl.h"
109
110 int main(int argc, char *argv[])
111 {
112 double a[2*2], b[2*2];
113 a[0] = 4.0; a[1] = 1.0; a[2] = 2.0; a[3] = 5.0;
114 b[0] = 2.0; b[1] = 1.0; b[2] = 1.0; b[3] = 2.0;
115 HPL_dtrsm( HplColumnMajor, HplLeft, HplUpper,
116 HplNoTrans, HplNonUnit, 2, 2, 2.0,
117 a, 2, b, 2 );
118 printf(" [%f,%f]\n", b[0], b[2]);
119 printf("b=[%f,%f]\n", b[1], b[3]);
120 exit(0); return(0);
121 }
122
124 HPL_dgemm (3).
125
126
127
128HPL 2.2 February 24, 2016 HPL_dtrsm(3)