Statistiques
| Révision :

root / www / HPL_dscal.html

Historique | Voir | Annoter | Télécharger (1,83 ko)

1
<HTML>
2
<HEAD>
3
<TITLE>HPL_dscal 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_dscal</B> x = alpha * x.
11

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

    
26
<H1>Description</H1>
27
<B>HPL_dscal</B>
28
scales the vector x by alpha.
29

    
30
<H1>Arguments</H1>
31
<PRE>
32
N       (local input)                 const int
33
        On entry, N specifies the length of the vector x. N  must  be
34
        at least zero.
35
</PRE>
36
<PRE>
37
ALPHA   (local input)                 const double
38
        On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
39
        supplied as zero, then the entries of the incremented array X
40
        need not be set on input.
41
</PRE>
42
<PRE>
43
X       (local input/output)          double *
44
        On entry,  X  is an incremented array of dimension  at  least
45
        ( 1 + ( n - 1 ) * abs( INCX ) )  that  contains the vector x.
46
        On exit, the entries of the incremented array  X  are  scaled
47
        by the scalar alpha.
48
</PRE>
49
<PRE>
50
INCX    (local input)                 const int
51
        On entry, INCX specifies the increment for the elements of X.
52
        INCX must not be zero.
53
</PRE>
54

    
55
<H1>Example</H1>
56
<CODE>#include "hpl.h"</CODE><BR><BR>
57
<PRE>
58
int main(int argc, char *argv[])
59
{
60
   double x[3];
61
   x[0] = 1.0; x[1] = 2.0; x[2] = 3.0;
62
   HPL_dscal( 3, 2.0, x, 1 );
63
   printf("x=[%f,%f,%f]\n", x[0], x[1], x[2]);
64
   exit(0); return(0);
65
}
66
</PRE>
67

    
68
<H1>See Also</H1>
69
<A HREF="HPL_daxpy.html">HPL_daxpy</A>,
70
<A HREF="HPL_dcopy.html">HPL_dcopy</A>,
71
<A HREF="HPL_dswap.html">HPL_dswap</A>.
72

    
73
</BODY>
74
</HTML>