2
SUBROUTINE CSSCAL (N, SA, CX, INCX)
3
C***BEGIN PROLOGUE CSSCAL
4
C***PURPOSE Scale a complex vector.
5
C***LIBRARY SLATEC (BLAS)
7
C***TYPE COMPLEX (CSSCAL-C)
8
C***KEYWORDS BLAS, LINEAR ALGEBRA, SCALE, VECTOR
9
C***AUTHOR Lawson, C. L., (JPL)
10
C Hanson, R. J., (SNLA)
11
C Kincaid, D. R., (U. of Texas)
16
C Description of Parameters
19
C N number of elements in input vector(s)
20
C SA single precision scale factor
21
C CX complex vector with N elements
22
C INCX storage spacing between elements of CX
25
C CX scaled result (unchanged if N .LE. 0)
27
C Replace complex CX by (single precision SA) * (complex CX)
28
C For I = 0 to N-1, replace CX(IX+I*INCX) with SA * CX(IX+I*INCX),
29
C where IX = 1 if INCX .GE. 0, else IX = 1+(1-N)*INCX.
31
C***REFERENCES C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T.
32
C Krogh, Basic linear algebra subprograms for Fortran
33
C usage, Algorithm No. 539, Transactions on Mathematical
34
C Software 5, 3 (September 1979), pp. 308-323.
35
C***ROUTINES CALLED (NONE)
36
C***REVISION HISTORY (YYMMDD)
38
C 890831 Modified array declarations. (WRB)
39
C 890831 REVISION DATE from Version 3.2
40
C 891214 Prologue converted to Version 4.0 format. (BAB)
41
C 900821 Modified to correct problem with a negative increment.
43
C 920501 Reformatted the REFERENCES section. (WRB)
44
C***END PROLOGUE CSSCAL
47
INTEGER I, INCX, IX, N
48
C***FIRST EXECUTABLE STATEMENT CSSCAL
51
IF (INCX .EQ. 1) GOTO 20
53
C Code for increment not equal to 1.
56
IF (INCX .LT. 0) IX = (-N+1)*INCX + 1
63
C Code for increment equal to 1.