1HPL_dscal(3) HPL Library Functions HPL_dscal(3)
2
3
4
6 HPL_dscal - x = alpha * x.
7
9 #include "hpl.h"
10
11 void HPL_dscal( const int N, const double ALPHA, double * X, const int
12 INCX );
13
15 HPL_dscal scales the vector x by alpha.
16
18 N (local input) const int
19 On entry, N specifies the length of the vector x. N must be
20 at least zero.
21
22 ALPHA (local input) const double
23 On entry, ALPHA specifies the scalar alpha. When ALPHA is
24 supplied as zero, then the entries of the incremented array X
25 need not be set on input.
26
27 X (local input/output) double *
28 On entry, X is an incremented array of dimension at least (
29 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x. On
30 exit, the entries of the incremented array X are scaled by
31 the scalar alpha.
32
33 INCX (local input) const int
34 On entry, INCX specifies the increment for the elements of X.
35 INCX must not be zero.
36
38 #include "hpl.h"
39
40 int main(int argc, char *argv[])
41 {
42 double x[3];
43 x[0] = 1.0; x[1] = 2.0; x[2] = 3.0;
44 HPL_dscal( 3, 2.0, x, 1 );
45 printf("x=[%f,%f,%f]\n", x[0], x[1], x[2]);
46 exit(0); return(0);
47 }
48
50 HPL_daxpy (3), HPL_dcopy (3), HPL_dswap (3).
51
52
53
54HPL 2.1 October 26, 2012 HPL_dscal(3)