LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
scsum1.f
Go to the documentation of this file.
1*> \brief \b SCSUM1 forms the 1-norm of the complex vector using the true absolute value.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SCSUM1 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/scsum1.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/scsum1.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/scsum1.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* REAL FUNCTION SCSUM1( N, CX, INCX )
20*
21* .. Scalar Arguments ..
22* INTEGER INCX, N
23* ..
24* .. Array Arguments ..
25* COMPLEX CX( * )
26* ..
27*
28*
29*> \par Purpose:
30* =============
31*>
32*> \verbatim
33*>
34*> SCSUM1 takes the sum of the absolute values of a complex
35*> vector and returns a single precision result.
36*>
37*> Based on SCASUM from the Level 1 BLAS.
38*> The change is to use the 'genuine' absolute value.
39*> \endverbatim
40*
41* Arguments:
42* ==========
43*
44*> \param[in] N
45*> \verbatim
46*> N is INTEGER
47*> The number of elements in the vector CX.
48*> \endverbatim
49*>
50*> \param[in] CX
51*> \verbatim
52*> CX is COMPLEX array, dimension (N)
53*> The vector whose elements will be summed.
54*> \endverbatim
55*>
56*> \param[in] INCX
57*> \verbatim
58*> INCX is INTEGER
59*> The spacing between successive values of CX. INCX > 0.
60*> \endverbatim
61*
62* Authors:
63* ========
64*
65*> \author Univ. of Tennessee
66*> \author Univ. of California Berkeley
67*> \author Univ. of Colorado Denver
68*> \author NAG Ltd.
69*
70*> \ingroup sum1
71*
72*> \par Contributors:
73* ==================
74*>
75*> Nick Higham for use with CLACON.
76*
77* =====================================================================
78 REAL function scsum1( n, cx, incx )
79*
80* -- LAPACK auxiliary routine --
81* -- LAPACK is a software package provided by Univ. of Tennessee, --
82* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
83*
84* .. Scalar Arguments ..
85 INTEGER incx, n
86* ..
87* .. Array Arguments ..
88 COMPLEX cx( * )
89* ..
90*
91* =====================================================================
92*
93* .. Local Scalars ..
94 INTEGER i, nincx
95 REAL stemp
96* ..
97* .. Intrinsic Functions ..
98 INTRINSIC abs
99* ..
100* .. Executable Statements ..
101*
102 scsum1 = 0.0e0
103 stemp = 0.0e0
104 IF( n.LE.0 )
105 $ RETURN
106 IF( incx.EQ.1 )
107 $ GO TO 20
108*
109* CODE FOR INCREMENT NOT EQUAL TO 1
110*
111 nincx = n*incx
112 DO 10 i = 1, nincx, incx
113*
114* NEXT LINE MODIFIED.
115*
116 stemp = stemp + abs( cx( i ) )
117 10 CONTINUE
118 scsum1 = stemp
119 RETURN
120*
121* CODE FOR INCREMENT EQUAL TO 1
122*
123 20 CONTINUE
124 DO 30 i = 1, n
125*
126* NEXT LINE MODIFIED.
127*
128 stemp = stemp + abs( cx( i ) )
129 30 CONTINUE
130 scsum1 = stemp
131 RETURN
132*
133* End of SCSUM1
134*
135 END
real function scsum1(n, cx, incx)
SCSUM1 forms the 1-norm of the complex vector using the true absolute value.
Definition scsum1.f:79