Statistiques
| Révision :

root / www / HPL_dgemv.html

Historique | Voir | Annoter | Télécharger (4,34 ko)

1
<HTML>
2
<HEAD>
3
<TITLE>HPL_dgemv 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_dgemv</B> y := beta * y + alpha * op(A) * x.
11

    
12
<H1>Synopsis</H1>
13
<CODE>#include "hpl.h"</CODE><BR><BR>
14
<CODE>void</CODE>
15
<CODE>HPL_dgemv(</CODE>
16
<CODE>const enum HPL_ORDER</CODE>
17
<CODE>ORDER</CODE>,
18
<CODE>const enum HPL_TRANS</CODE>
19
<CODE>TRANS</CODE>,
20
<CODE>const int</CODE>
21
<CODE>M</CODE>,
22
<CODE>const int</CODE>
23
<CODE>N</CODE>,
24
<CODE>const double</CODE>
25
<CODE>ALPHA</CODE>,
26
<CODE>const double *</CODE>
27
<CODE>A</CODE>,
28
<CODE>const int</CODE>
29
<CODE>LDA</CODE>,
30
<CODE>const double *</CODE>
31
<CODE>X</CODE>,
32
<CODE>const int</CODE>
33
<CODE>INCX</CODE>,
34
<CODE>const double</CODE>
35
<CODE>BETA</CODE>,
36
<CODE>double *</CODE>
37
<CODE>Y</CODE>,
38
<CODE>const int</CODE>
39
<CODE>INCY</CODE>
40
<CODE>);</CODE>
41

    
42
<H1>Description</H1>
43
<B>HPL_dgemv</B>
44
performs one of the matrix-vector operations
45
 
46
    y := alpha * op( A ) * x + beta * y,
47
 
48
 where op( X ) is one of
49
 
50
    op( X ) = X   or   op( X ) = X^T.
51
 
52
where alpha and beta are scalars, x and y are vectors and  A  is an m
53
by n matrix.
54

    
55
<H1>Arguments</H1>
56
<PRE>
57
ORDER   (local input)                 const enum HPL_ORDER
58
        On entry, ORDER  specifies the storage format of the operands
59
        as follows:                                                  
60
           ORDER = HplRowMajor,                                      
61
           ORDER = HplColumnMajor.                                   
62
</PRE>
63
<PRE>
64
TRANS   (local input)                 const enum HPL_TRANS
65
        On entry,  TRANS  specifies the  operation to be performed as
66
        follows:   
67
           TRANS = HplNoTrans y := alpha*A  *x + beta*y,
68
           TRANS = HplTrans   y := alpha*A^T*x + beta*y.
69
</PRE>
70
<PRE>
71
M       (local input)                 const int
72
        On entry,  M  specifies  the number of rows of  the matrix A.
73
        M must be at least zero.
74
</PRE>
75
<PRE>
76
N       (local input)                 const int
77
        On entry, N  specifies the number of columns of the matrix A.
78
        N must be at least zero.
79
</PRE>
80
<PRE>
81
ALPHA   (local input)                 const double
82
        On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
83
        supplied as zero then  A and X  need not be set on input.
84
</PRE>
85
<PRE>
86
A       (local input)                 const double *
87
        On entry,  A  points  to an array of size equal to or greater
88
        than LDA * n.  Before  entry, the leading m by n part  of the
89
        array  A  must contain the matrix coefficients.
90
</PRE>
91
<PRE>
92
LDA     (local input)                 const int
93
        On entry,  LDA  specifies  the  leading  dimension  of  A  as
94
        declared  in  the  calling  (sub) program.  LDA  must  be  at
95
        least MAX(1,m).
96
</PRE>
97
<PRE>
98
X       (local input)                 const double *
99
        On entry,  X  is an incremented array of dimension  at  least
100
        ( 1 + ( n - 1 ) * abs( INCX ) )  that  contains the vector x.
101
</PRE>
102
<PRE>
103
INCX    (local input)                 const int
104
        On entry, INCX specifies the increment for the elements of X.
105
        INCX must not be zero.
106
</PRE>
107
<PRE>
108
BETA    (local input)                 const double
109
        On entry, BETA  specifies the scalar beta.    When  ALPHA  is
110
        supplied as zero then  Y  need not be set on input.
111
</PRE>
112
<PRE>
113
Y       (local input/output)          double *
114
        On entry,  Y  is an incremented array of dimension  at  least
115
        ( 1 + ( n - 1 ) * abs( INCY ) )  that  contains the vector y.
116
        Before entry with BETA non-zero, the incremented array Y must
117
        contain the vector  y.  On exit,  Y  is  overwritten  by  the
118
        updated vector y.
119
</PRE>
120
<PRE>
121
INCY    (local input)                 const int
122
        On entry, INCY specifies the increment for the elements of Y.
123
        INCY must not be zero.
124
</PRE>
125

    
126
<H1>Example</H1>
127
<CODE>#include "hpl.h"</CODE><BR><BR>
128
<PRE>
129
int main(int argc, char *argv[])
130
{
131
   double a[2*2], x[2], y[2];
132
   a[0] = 1.0; a[1] = 2.0; a[2] = 3.0; a[3] = 3.0;
133
   x[0] = 2.0; x[1] = 1.0; y[2] = 1.0; y[3] = 2.0;
134
   HPL_dgemv( HplColumnMajor, HplNoTrans, 2, 2, 2.0,
135
              a, 2, x, 1, -1.0, y, 1 );
136
   printf("y=[%f,%f]\n", y[0], y[1]);
137
   exit(0); return(0);
138
}
139
</PRE>
140

    
141
<H1>See Also</H1>
142
<A HREF="HPL_dger.html">HPL_dger</A>,
143
<A HREF="HPL_dtrsv.html">HPL_dtrsv</A>.
144

    
145
</BODY>
146
</HTML>