LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cscal.f
Go to the documentation of this file.
1*> \brief \b CSCAL
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8* Definition:
9* ===========
10*
11* SUBROUTINE CSCAL(N,CA,CX,INCX)
12*
13* .. Scalar Arguments ..
14* COMPLEX CA
15* INTEGER INCX,N
16* ..
17* .. Array Arguments ..
18* COMPLEX CX(*)
19* ..
20*
21*
22*> \par Purpose:
23* =============
24*>
25*> \verbatim
26*>
27*> CSCAL scales a vector by a constant.
28*> \endverbatim
29*
30* Arguments:
31* ==========
32*
33*> \param[in] N
34*> \verbatim
35*> N is INTEGER
36*> number of elements in input vector(s)
37*> \endverbatim
38*>
39*> \param[in] CA
40*> \verbatim
41*> CA is COMPLEX
42*> On entry, CA specifies the scalar alpha.
43*> \endverbatim
44*>
45*> \param[in,out] CX
46*> \verbatim
47*> CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
48*> \endverbatim
49*>
50*> \param[in] INCX
51*> \verbatim
52*> INCX is INTEGER
53*> storage spacing between elements of CX
54*> \endverbatim
55*
56* Authors:
57* ========
58*
59*> \author Univ. of Tennessee
60*> \author Univ. of California Berkeley
61*> \author Univ. of Colorado Denver
62*> \author NAG Ltd.
63*
64*> \ingroup scal
65*
66*> \par Further Details:
67* =====================
68*>
69*> \verbatim
70*>
71*> jack dongarra, linpack, 3/11/78.
72*> modified 3/93 to return if incx .le. 0.
73*> modified 12/3/93, array(1) declarations changed to array(*)
74*> \endverbatim
75*>
76* =====================================================================
77 SUBROUTINE cscal(N,CA,CX,INCX)
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 CA
85 INTEGER INCX,N
86* ..
87* .. Array Arguments ..
88 COMPLEX CX(*)
89* ..
90*
91* =====================================================================
92*
93* .. Local Scalars ..
94 INTEGER I,NINCX
95* ..
96* .. Parameters ..
97 COMPLEX ONE
98 parameter(one= (1.0e+0,0.0e+0))
99* ..
100 IF (n.LE.0 .OR. incx.LE.0 .OR. ca.EQ.one) RETURN
101 IF (incx.EQ.1) THEN
102*
103* code for increment equal to 1
104*
105 DO i = 1,n
106 cx(i) = ca*cx(i)
107 END DO
108 ELSE
109*
110* code for increment not equal to 1
111*
112 nincx = n*incx
113 DO i = 1,nincx,incx
114 cx(i) = ca*cx(i)
115 END DO
116 END IF
117 RETURN
118*
119* End of CSCAL
120*
121 END
subroutine cscal(n, ca, cx, incx)
CSCAL
Definition cscal.f:78