LAPACK 3.3.0

cscal.f

Go to the documentation of this file.
00001       SUBROUTINE CSCAL(N,CA,CX,INCX)
00002 *     .. Scalar Arguments ..
00003       COMPLEX CA
00004       INTEGER INCX,N
00005 *     ..
00006 *     .. Array Arguments ..
00007       COMPLEX CX(*)
00008 *     ..
00009 *
00010 *  Purpose
00011 *  =======
00012 *
00013 *     CSCAL scales a vector by a constant.
00014 *
00015 *  Further Details
00016 *  ===============
00017 *
00018 *     jack dongarra, linpack,  3/11/78.
00019 *     modified 3/93 to return if incx .le. 0.
00020 *     modified 12/3/93, array(1) declarations changed to array(*)
00021 *
00022 *  =====================================================================
00023 *
00024 *     .. Local Scalars ..
00025       INTEGER I,NINCX
00026 *     ..
00027       IF (N.LE.0 .OR. INCX.LE.0) RETURN
00028       IF (INCX.EQ.1) GO TO 20
00029 *
00030 *        code for increment not equal to 1
00031 *
00032       NINCX = N*INCX
00033       DO 10 I = 1,NINCX,INCX
00034           CX(I) = CA*CX(I)
00035    10 CONTINUE
00036       RETURN
00037 *
00038 *        code for increment equal to 1
00039 *
00040    20 DO 30 I = 1,N
00041           CX(I) = CA*CX(I)
00042    30 CONTINUE
00043       RETURN
00044       END
 All Files Functions