Statistiques
| Révision :

root / www / HPL_daxpy.html

Historique | Voir | Annoter | Télécharger (2,39 ko)

1
<HTML>
2
<HEAD>
3
<TITLE>HPL_daxpy 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_daxpy</B> y := y + alpha * x.
11

    
12
<H1>Synopsis</H1>
13
<CODE>#include "hpl.h"</CODE><BR><BR>
14
<CODE>void</CODE>
15
<CODE>HPL_daxpy(</CODE>
16
<CODE>const int</CODE>
17
<CODE>N</CODE>,
18
<CODE>const double</CODE>
19
<CODE>ALPHA</CODE>,
20
<CODE>const double *</CODE>
21
<CODE>X</CODE>,
22
<CODE>const int</CODE>
23
<CODE>INCX</CODE>,
24
<CODE>double *</CODE>
25
<CODE>Y</CODE>,
26
<CODE>const int</CODE>
27
<CODE>INCY</CODE>
28
<CODE>);</CODE>
29

    
30
<H1>Description</H1>
31
<B>HPL_daxpy</B>
32
scales the vector x by alpha and adds it to y.
33

    
34
<H1>Arguments</H1>
35
<PRE>
36
N       (local input)                 const int
37
        On entry, N specifies the length of the vectors  x  and  y. N
38
        must be at least zero.
39
</PRE>
40
<PRE>
41
ALPHA   (local input)                 const double
42
        On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
43
        supplied as zero, then the entries of the incremented array X
44
        need not be set on input.
45
</PRE>
46
<PRE>
47
X       (local input)                 const double *
48
        On entry,  X  is an incremented array of dimension  at  least
49
        ( 1 + ( n - 1 ) * abs( INCX ) )  that  contains the vector x.
50
</PRE>
51
<PRE>
52
INCX    (local input)                 const int
53
        On entry, INCX specifies the increment for the elements of X.
54
        INCX must not be zero.
55
</PRE>
56
<PRE>
57
Y       (local input/output)          double *
58
        On entry,  Y  is an incremented array of dimension  at  least
59
        ( 1 + ( n - 1 ) * abs( INCY ) )  that  contains the vector y.
60
        On exit, the entries of the incremented array  Y  are updated
61
        with the scaled entries of the incremented array X.
62
</PRE>
63
<PRE>
64
INCY    (local input)                 const int
65
        On entry, INCY specifies the increment for the elements of Y.
66
        INCY must not be zero.
67
</PRE>
68

    
69
<H1>Example</H1>
70
<CODE>#include "hpl.h"</CODE><BR><BR>
71
<PRE>
72
int main(int argc, char *argv[])
73
{
74
   double x[3], y[3];
75
   x[0] = 1.0; x[1] = 2.0; x[2] = 3.0;
76
   y[0] = 4.0; y[1] = 5.0; y[2] = 6.0;
77
   HPL_daxpy( 3, 2.0, x, 1, y, 1 );
78
   printf("y=[%f,%f,%f]\n", y[0], y[1], y[2]);
79
   exit(0); return(0);
80
}
81
</PRE>
82

    
83
<H1>See Also</H1>
84
<A HREF="HPL_dcopy.html">HPL_dcopy</A>,
85
<A HREF="HPL_dscal.html">HPL_dscal</A>,
86
<A HREF="HPL_dswap.html">HPL_dswap</A>.
87

    
88
</BODY>
89
</HTML>