LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ csscal()

subroutine csscal ( integer  N,
real  SA,
complex, dimension(*)  CX,
integer  INCX 
)

CSSCAL

Purpose:
    CSSCAL scales a complex vector by a real constant.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in]SA
          SA is REAL
           On entry, SA specifies the scalar alpha.
[in,out]CX
          CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of CX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017
Further Details:
     jack dongarra, linpack, 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 80 of file csscal.f.

80 *
81 * -- Reference BLAS level1 routine (version 3.8.0) --
82 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
83 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
84 * November 2017
85 *
86 * .. Scalar Arguments ..
87  REAL SA
88  INTEGER INCX,N
89 * ..
90 * .. Array Arguments ..
91  COMPLEX CX(*)
92 * ..
93 *
94 * =====================================================================
95 *
96 * .. Local Scalars ..
97  INTEGER I,NINCX
98 * ..
99 * .. Intrinsic Functions ..
100  INTRINSIC aimag,cmplx,real
101 * ..
102  IF (n.LE.0 .OR. incx.LE.0) RETURN
103  IF (incx.EQ.1) THEN
104 *
105 * code for increment equal to 1
106 *
107  DO i = 1,n
108  cx(i) = cmplx(sa*real(cx(i)),sa*aimag(cx(i)))
109  END DO
110  ELSE
111 *
112 * code for increment not equal to 1
113 *
114  nincx = n*incx
115  DO i = 1,nincx,incx
116  cx(i) = cmplx(sa*real(cx(i)),sa*aimag(cx(i)))
117  END DO
118  END IF
119  RETURN