root / www / HPL_dger.html
Historique | Voir | Annoter | Télécharger (3,56 ko)
1 |
<HTML>
|
---|---|
2 |
<HEAD>
|
3 |
<TITLE>HPL_dger 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_dger</B> A := alpha * x * y^T + A. |
11 |
|
12 |
<H1>Synopsis</H1> |
13 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
14 |
<CODE>void</CODE> |
15 |
<CODE>HPL_dger(</CODE> |
16 |
<CODE>const enum HPL_ORDER</CODE> |
17 |
<CODE>ORDER</CODE>, |
18 |
<CODE>const int</CODE> |
19 |
<CODE>M</CODE>, |
20 |
<CODE>const int</CODE> |
21 |
<CODE>N</CODE>, |
22 |
<CODE>const double</CODE> |
23 |
<CODE>ALPHA</CODE>, |
24 |
<CODE>const double *</CODE> |
25 |
<CODE>X</CODE>, |
26 |
<CODE>const int</CODE> |
27 |
<CODE>INCX</CODE>, |
28 |
<CODE>double *</CODE> |
29 |
<CODE>Y</CODE>, |
30 |
<CODE>const int</CODE> |
31 |
<CODE>INCY</CODE>, |
32 |
<CODE>double *</CODE> |
33 |
<CODE>A</CODE>, |
34 |
<CODE>const int</CODE> |
35 |
<CODE>LDA</CODE> |
36 |
<CODE>);</CODE> |
37 |
|
38 |
<H1>Description</H1> |
39 |
<B>HPL_dger</B> |
40 |
performs the rank 1 operation |
41 |
|
42 |
A := alpha * x * y^T + A, |
43 |
|
44 |
where alpha is a scalar, x is an m-element vector, y is an n-element |
45 |
vector and A is an m by n matrix. |
46 |
|
47 |
<H1>Arguments</H1> |
48 |
<PRE>
|
49 |
ORDER (local input) const enum HPL_ORDER |
50 |
On entry, ORDER specifies the storage format of the operands |
51 |
as follows: |
52 |
ORDER = HplRowMajor, |
53 |
ORDER = HplColumnMajor. |
54 |
</PRE>
|
55 |
<PRE>
|
56 |
M (local input) const int |
57 |
On entry, M specifies the number of rows of the matrix A. |
58 |
M must be at least zero. |
59 |
</PRE>
|
60 |
<PRE>
|
61 |
N (local input) const int |
62 |
On entry, N specifies the number of columns of the matrix A. |
63 |
N must be at least zero. |
64 |
</PRE>
|
65 |
<PRE>
|
66 |
ALPHA (local input) const double |
67 |
On entry, ALPHA specifies the scalar alpha. When ALPHA is |
68 |
supplied as zero then X and Y need not be set on input. |
69 |
</PRE>
|
70 |
<PRE>
|
71 |
X (local input) const double * |
72 |
On entry, X is an incremented array of dimension at least |
73 |
( 1 + ( m - 1 ) * abs( INCX ) ) that contains the vector x. |
74 |
</PRE>
|
75 |
<PRE>
|
76 |
INCX (local input) const int |
77 |
On entry, INCX specifies the increment for the elements of X. |
78 |
INCX must not be zero. |
79 |
</PRE>
|
80 |
<PRE>
|
81 |
Y (local input) double * |
82 |
On entry, Y is an incremented array of dimension at least |
83 |
( 1 + ( n - 1 ) * abs( INCY ) ) that contains the vector y. |
84 |
</PRE>
|
85 |
<PRE>
|
86 |
INCY (local input) const int |
87 |
On entry, INCY specifies the increment for the elements of Y. |
88 |
INCY must not be zero. |
89 |
</PRE>
|
90 |
<PRE>
|
91 |
A (local input/output) double * |
92 |
On entry, A points to an array of size equal to or greater |
93 |
than LDA * n. Before entry, the leading m by n part of the |
94 |
array A must contain the matrix coefficients. On exit, A is |
95 |
overwritten by the updated matrix. |
96 |
</PRE>
|
97 |
<PRE>
|
98 |
LDA (local input) const int |
99 |
On entry, LDA specifies the leading dimension of A as |
100 |
declared in the calling (sub) program. LDA must be at |
101 |
least MAX(1,m). |
102 |
</PRE>
|
103 |
|
104 |
<H1>Example</H1> |
105 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
106 |
<PRE>
|
107 |
int main(int argc, char *argv[]) |
108 |
{ |
109 |
double a[2*2], x[2], y[2]; |
110 |
a[0] = 1.0; a[1] = 2.0; a[2] = 3.0; a[3] = 3.0; |
111 |
x[0] = 2.0; x[1] = 1.0; y[2] = 1.0; y[3] = 2.0; |
112 |
HPL_dger( HplColumnMajor, 2, 2, 2.0, x, 1, y, 1, |
113 |
a, 2 ); |
114 |
printf("y=[%f,%f]\n", y[0], y[1]); |
115 |
exit(0); return(0); |
116 |
} |
117 |
</PRE>
|
118 |
|
119 |
<H1>See Also</H1> |
120 |
<A HREF="HPL_dgemv.html">HPL_dgemv</A>, |
121 |
<A HREF="HPL_dtrsv.html">HPL_dtrsv</A>. |
122 |
|
123 |
</BODY>
|
124 |
</HTML>
|