1HPL_dtrsv(3) HPL Library Functions HPL_dtrsv(3)
2
3
4
6 HPL_dtrsv - x := A^{-1} x.
7
9 #include "hpl.h"
10
11 void HPL_dtrsv( const enum HPL_ORDER ORDER, const enum HPL_UPLO UPLO,
12 const enum HPL_TRANS TRANS, const enum HPL_DIAG DIAG, const int N,
13 const double * A, const int LDA, double * X, const int INCX );
14
16 HPL_dtrsv solves one of the systems of equations
17
18 A * x = b, or A^T * x = b,
19
20 where b and x are n-element vectors and A is an n by n non-unit, or
21 unit, upper or lower triangular matrix.
22
23 No test for singularity or near-singularity is included in this
24 routine. Such tests must be performed before calling this routine.
25
27 ORDER (local input) const enum HPL_ORDER
28 On entry, ORDER specifies the storage format of the operands
29 as follows:
30 ORDER = HplRowMajor,
31 ORDER = HplColumnMajor.
32
33 UPLO (local input) const enum HPL_UPLO
34 On entry, UPLO specifies whether the upper or lower
35 triangular part of the array A is to be referenced. When
36 UPLO==HplUpper, only the upper triangular part of A is to be
37 referenced, otherwise only the lower triangular part of A is to
38 be referenced.
39
40 TRANS (local input) const enum HPL_TRANS
41 On entry, TRANS specifies the equations to be solved as
42 follows:
43 TRANS==HplNoTrans A * x = b,
44 TRANS==HplTrans A^T * x = b.
45
46 DIAG (local input) const enum HPL_DIAG
47 On entry, DIAG specifies whether A is unit triangular or
48 not. When DIAG==HplUnit, A is assumed to be unit triangular,
49 and otherwise, A is not assumed to be unit triangular.
50
51 N (local input) const int
52 On entry, N specifies the order of the matrix A. N must be at
53 least zero.
54
55 A (local input) const double *
56 On entry, A points to an array of size equal to or greater
57 than LDA * n. Before entry with UPLO==HplUpper, the leading n
58 by n upper triangular part of the array A must contain the
59 upper triangular matrix and the strictly lower triangular
60 part of A is not referenced. When UPLO==HplLower on entry,
61 the leading n by n lower triangular part of the array A must
62 contain the lower triangular matrix and the strictly upper
63 triangular part of A is not referenced.
64
65 Note that when DIAG==HplUnit, the diagonal elements of A
66 not referenced either, but are assumed to be unity.
67
68 LDA (local input) const int
69 On entry, LDA specifies the leading dimension of A as
70 declared in the calling (sub) program. LDA must be at
71 least MAX(1,n).
72
73 X (local input/output) double *
74 On entry, X is an incremented array of dimension at least (
75 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x.
76 Before entry, the incremented array X must contain the n
77 element right-hand side vector b. On exit, X is overwritten
78 with the solution vector x.
79
80 INCX (local input) const int
81 On entry, INCX specifies the increment for the elements of X.
82 INCX must not be zero.
83
85 #include "hpl.h"
86
87 int main(int argc, char *argv[])
88 {
89 double a[2*2], x[2];
90 a[0] = 4.0; a[1] = 1.0; a[2] = 2.0; a[3] = 5.0;
91 x[0] = 2.0; x[1] = 1.0;
92 HPL_dtrsv( HplColumnMajor, HplLower, HplNoTrans,
93 HplNoUnit, a, 2, x, 1 );
94 printf("x=[%f,%f]\n", x[0], x[1]);
95 exit(0); return(0);
96 }
97
99 HPL_dger (3), HPL_dgemv (3).
100
101
102
103HPL 2.1 October 26, 2012 HPL_dtrsv(3)