1HPL_dgemv(3) HPL Library Functions HPL_dgemv(3)
2
3
4
6 HPL_dgemv - y := beta * y + alpha * op(A) * x.
7
9 #include "hpl.h"
10
11 void HPL_dgemv( const enum HPL_ORDER ORDER, const enum HPL_TRANS TRANS,
12 const int M, const int N, const double ALPHA, const double * A, const
13 int LDA, const double * X, const int INCX, const double BETA, double *
14 Y, const int INCY );
15
17 HPL_dgemv performs one of the matrix-vector operations
18
19 y := alpha * op( A ) * x + beta * y,
20
21 where op( X ) is one of
22
23 op( X ) = X or op( X ) = X^T.
24
25 where alpha and beta are scalars, x and y are vectors and A is an m
26 by n matrix.
27
29 ORDER (local input) const enum HPL_ORDER
30 On entry, ORDER specifies the storage format of the operands
31 as follows:
32 ORDER = HplRowMajor,
33 ORDER = HplColumnMajor.
34
35 TRANS (local input) const enum HPL_TRANS
36 On entry, TRANS specifies the operation to be performed as
37 follows:
38 TRANS = HplNoTrans y := alpha*A *x + beta*y,
39 TRANS = HplTrans y := alpha*A^T*x + beta*y.
40
41 M (local input) const int
42 On entry, M specifies the number of rows of the matrix A.
43 M must be at least zero.
44
45 N (local input) const int
46 On entry, N specifies the number of columns of the matrix A.
47 N must be at least zero.
48
49 ALPHA (local input) const double
50 On entry, ALPHA specifies the scalar alpha. When ALPHA is
51 supplied as zero then A and X need not be set on input.
52
53 A (local input) const double *
54 On entry, A points to an array of size equal to or greater
55 than LDA * n. Before entry, the leading m by n part of the
56 array A must contain the matrix coefficients.
57
58 LDA (local input) const int
59 On entry, LDA specifies the leading dimension of A as
60 declared in the calling (sub) program. LDA must be at
61 least MAX(1,m).
62
63 X (local input) const double *
64 On entry, X is an incremented array of dimension at least (
65 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x.
66
67 INCX (local input) const int
68 On entry, INCX specifies the increment for the elements of X.
69 INCX must not be zero.
70
71 BETA (local input) const double
72 On entry, BETA specifies the scalar beta. When ALPHA is
73 supplied as zero then Y need not be set on input.
74
75 Y (local input/output) double *
76 On entry, Y is an incremented array of dimension at least (
77 1 + ( n - 1 ) * abs( INCY ) ) that contains the vector y.
78 Before entry with BETA non-zero, the incremented array Y must
79 contain the vector y. On exit, Y is overwritten by the
80 updated vector y.
81
82 INCY (local input) const int
83 On entry, INCY specifies the increment for the elements of Y.
84 INCY must not be zero.
85
87 #include "hpl.h"
88
89 int main(int argc, char *argv[])
90 {
91 double a[2*2], x[2], y[2];
92 a[0] = 1.0; a[1] = 2.0; a[2] = 3.0; a[3] = 3.0;
93 x[0] = 2.0; x[1] = 1.0; y[2] = 1.0; y[3] = 2.0;
94 HPL_dgemv( HplColumnMajor, HplNoTrans, 2, 2, 2.0,
95 a, 2, x, 1, -1.0, y, 1 );
96 printf("y=[%f,%f]\n", y[0], y[1]);
97 exit(0); return(0);
98 }
99
101 HPL_dger (3), HPL_dtrsv (3).
102
103
104
105HPL 2.2 February 24, 2016 HPL_dgemv(3)