LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ zscal()

subroutine zscal ( integer  N,
complex*16  ZA,
complex*16, dimension(*)  ZX,
integer  INCX 
)

ZSCAL

Purpose:
    ZSCAL scales a vector by a constant.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in]ZA
          ZA is COMPLEX*16
           On entry, ZA specifies the scalar alpha.
[in,out]ZX
          ZX is COMPLEX*16 array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of ZX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
     jack dongarra, 3/11/78.
     modified 3/93 to return if incx .le. 0.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 77 of file zscal.f.

78 *
79 * -- Reference BLAS level1 routine --
80 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
81 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
82 *
83 * .. Scalar Arguments ..
84  COMPLEX*16 ZA
85  INTEGER INCX,N
86 * ..
87 * .. Array Arguments ..
88  COMPLEX*16 ZX(*)
89 * ..
90 *
91 * =====================================================================
92 *
93 * .. Local Scalars ..
94  INTEGER I,NINCX
95 * ..
96  IF (n.LE.0 .OR. incx.LE.0) RETURN
97  IF (incx.EQ.1) THEN
98 *
99 * code for increment equal to 1
100 *
101  DO i = 1,n
102  zx(i) = za*zx(i)
103  END DO
104  ELSE
105 *
106 * code for increment not equal to 1
107 *
108  nincx = n*incx
109  DO i = 1,nincx,incx
110  zx(i) = za*zx(i)
111  END DO
112  END IF
113  RETURN
114 *
115 * End of ZSCAL
116 *