root / www / HPL_dtrsm.html
Historique | Voir | Annoter | Télécharger (5,79 ko)
1 |
<HTML>
|
---|---|
2 |
<HEAD>
|
3 |
<TITLE>HPL_dtrsm HPL 2.0 Library Functions September 10, 2008</TITLE> |
4 |
</HEAD>
|
5 |
|
6 |
<BODY BGCOLOR="WHITE" TEXT = "#000000" LINK = "#0000ff" VLINK = "#000099" |
7 |
ALINK = "#ffff00"> |
8 |
|
9 |
<H1>Name</H1> |
10 |
<B>HPL_dtrsm</B> B := A^{-1} * B or B := B * A^{-1}. |
11 |
|
12 |
<H1>Synopsis</H1> |
13 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
14 |
<CODE>void</CODE> |
15 |
<CODE>HPL_dtrsm(</CODE> |
16 |
<CODE>const enum HPL_ORDER</CODE> |
17 |
<CODE>ORDER</CODE>, |
18 |
<CODE>const enum HPL_SIDE</CODE> |
19 |
<CODE>SIDE</CODE>, |
20 |
<CODE>const enum HPL_UPLO</CODE> |
21 |
<CODE>UPLO</CODE>, |
22 |
<CODE>const enum HPL_TRANS</CODE> |
23 |
<CODE>TRANS</CODE>, |
24 |
<CODE>const enum HPL_DIAG</CODE> |
25 |
<CODE>DIAG</CODE>, |
26 |
<CODE>const int</CODE> |
27 |
<CODE>M</CODE>, |
28 |
<CODE>const int</CODE> |
29 |
<CODE>N</CODE>, |
30 |
<CODE>const double</CODE> |
31 |
<CODE>ALPHA</CODE>, |
32 |
<CODE>const double *</CODE> |
33 |
<CODE>A</CODE>, |
34 |
<CODE>const int</CODE> |
35 |
<CODE>LDA</CODE>, |
36 |
<CODE>double *</CODE> |
37 |
<CODE>B</CODE>, |
38 |
<CODE>const int</CODE> |
39 |
<CODE>LDB</CODE> |
40 |
<CODE>);</CODE> |
41 |
|
42 |
<H1>Description</H1> |
43 |
<B>HPL_dtrsm</B> |
44 |
solves one of the matrix equations |
45 |
|
46 |
op( A ) * X = alpha * B, or X * op( A ) = alpha * B, |
47 |
|
48 |
where alpha is a scalar, X and B are m by n matrices, A is a unit, or |
49 |
non-unit, upper or lower triangular matrix and op(A) is one of |
50 |
|
51 |
op( A ) = A or op( A ) = A^T. |
52 |
|
53 |
The matrix X is overwritten on B. |
54 |
|
55 |
No test for singularity or near-singularity is included in this |
56 |
routine. Such tests must be performed before calling this routine. |
57 |
|
58 |
<H1>Arguments</H1> |
59 |
<PRE>
|
60 |
ORDER (local input) const enum HPL_ORDER |
61 |
On entry, ORDER specifies the storage format of the operands |
62 |
as follows: |
63 |
ORDER = HplRowMajor, |
64 |
ORDER = HplColumnMajor. |
65 |
</PRE>
|
66 |
<PRE>
|
67 |
SIDE (local input) const enum HPL_SIDE |
68 |
On entry, SIDE specifies whether op(A) appears on the left |
69 |
or right of X as follows: |
70 |
SIDE==HplLeft op( A ) * X = alpha * B, |
71 |
SIDE==HplRight X * op( A ) = alpha * B. |
72 |
</PRE>
|
73 |
<PRE>
|
74 |
UPLO (local input) const enum HPL_UPLO |
75 |
On entry, UPLO specifies whether the upper or lower |
76 |
triangular part of the array A is to be referenced. When |
77 |
UPLO==HplUpper, only the upper triangular part of A is to be |
78 |
referenced, otherwise only the lower triangular part of A is |
79 |
to be referenced. |
80 |
</PRE>
|
81 |
<PRE>
|
82 |
TRANS (local input) const enum HPL_TRANS |
83 |
On entry, TRANSA specifies the form of op(A) to be used in |
84 |
the matrix-matrix operation follows: |
85 |
TRANSA==HplNoTrans : op( A ) = A, |
86 |
TRANSA==HplTrans : op( A ) = A^T, |
87 |
TRANSA==HplConjTrans : op( A ) = A^T. |
88 |
</PRE>
|
89 |
<PRE>
|
90 |
DIAG (local input) const enum HPL_DIAG |
91 |
On entry, DIAG specifies whether A is unit triangular or |
92 |
not. When DIAG==HplUnit, A is assumed to be unit triangular, |
93 |
and otherwise, A is not assumed to be unit triangular. |
94 |
</PRE>
|
95 |
<PRE>
|
96 |
M (local input) const int |
97 |
On entry, M specifies the number of rows of the matrix B. |
98 |
M must be at least zero. |
99 |
</PRE>
|
100 |
<PRE>
|
101 |
N (local input) const int |
102 |
On entry, N specifies the number of columns of the matrix B. |
103 |
N must be at least zero. |
104 |
</PRE>
|
105 |
<PRE>
|
106 |
ALPHA (local input) const double |
107 |
On entry, ALPHA specifies the scalar alpha. When ALPHA is |
108 |
supplied as zero then the elements of the matrix B need not |
109 |
be set on input. |
110 |
</PRE>
|
111 |
<PRE>
|
112 |
A (local input) const double * |
113 |
On entry, A points to an array of size equal to or greater |
114 |
than LDA * k, where k is m when SIDE==HplLeft and is n |
115 |
otherwise. Before entry with UPLO==HplUpper, the leading |
116 |
k by k upper triangular part of the array A must contain the |
117 |
upper triangular matrix and the strictly lower triangular |
118 |
part of A is not referenced. When UPLO==HplLower on entry, |
119 |
the leading k by k lower triangular part of the array A must |
120 |
contain the lower triangular matrix and the strictly upper |
121 |
triangular part of A is not referenced. |
122 |
|
123 |
Note that when DIAG==HplUnit, the diagonal elements of A |
124 |
not referenced either, but are assumed to be unity. |
125 |
</PRE>
|
126 |
<PRE>
|
127 |
LDA (local input) const int |
128 |
On entry, LDA specifies the leading dimension of A as |
129 |
declared in the calling (sub) program. LDA must be at |
130 |
least MAX(1,m) when SIDE==HplLeft, and MAX(1,n) otherwise. |
131 |
</PRE>
|
132 |
<PRE>
|
133 |
B (local input/output) double * |
134 |
On entry, B points to an array of size equal to or greater |
135 |
than LDB * n. Before entry, the leading m by n part of the |
136 |
array B must contain the matrix B, except when beta is zero, |
137 |
in which case B need not be set on entry. On exit, the array |
138 |
B is overwritten by the m by n solution matrix. |
139 |
</PRE>
|
140 |
<PRE>
|
141 |
LDB (local input) const int |
142 |
On entry, LDB specifies the leading dimension of B as |
143 |
declared in the calling (sub) program. LDB must be at |
144 |
least MAX(1,m). |
145 |
</PRE>
|
146 |
|
147 |
<H1>Example</H1> |
148 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
149 |
<PRE>
|
150 |
int main(int argc, char *argv[]) |
151 |
{ |
152 |
double a[2*2], b[2*2]; |
153 |
a[0] = 4.0; a[1] = 1.0; a[2] = 2.0; a[3] = 5.0; |
154 |
b[0] = 2.0; b[1] = 1.0; b[2] = 1.0; b[3] = 2.0; |
155 |
HPL_dtrsm( HplColumnMajor, HplLeft, HplUpper, |
156 |
HplNoTrans, HplNonUnit, 2, 2, 2.0, |
157 |
a, 2, b, 2 ); |
158 |
printf(" [%f,%f]\n", b[0], b[2]); |
159 |
printf("b=[%f,%f]\n", b[1], b[3]); |
160 |
exit(0); return(0); |
161 |
} |
162 |
</PRE>
|
163 |
|
164 |
<H1>See Also</H1> |
165 |
<A HREF="HPL_dgemm.html">HPL_dgemm</A>. |
166 |
|
167 |
</BODY>
|
168 |
</HTML>
|