LAPACK 3.3.1
Linear Algebra PACKage

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) THEN
00029 *
00030 *        code for increment equal to 1
00031 *
00032          DO I = 1,N
00033             CX(I) = CA*CX(I)
00034          END DO
00035       ELSE
00036 *
00037 *        code for increment not equal to 1
00038 *
00039          NINCX = N*INCX
00040          DO I = 1,NINCX,INCX
00041             CX(I) = CA*CX(I)
00042          END DO
00043       END IF
00044       RETURN
00045       END
 All Files Functions