PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
scsum1.f
Go to the documentation of this file.
1  REAL FUNCTION scsum1( N, CX, INCX )
2 *
3 * -- LAPACK auxiliary routine (version 3.2) --
4 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
5 * November 2006
6 *
7 * .. Scalar Arguments ..
8  INTEGER incx, n
9 * ..
10 * .. Array Arguments ..
11  COMPLEX cx( * )
12 * ..
13 *
14 * Purpose
15 * =======
16 *
17 * SCSUM1 takes the sum of the absolute values of a complex
18 * vector and returns a single precision result.
19 *
20 * Based on SCASUM from the Level 1 BLAS.
21 * The change is to use the 'genuine' absolute value.
22 *
23 * Contributed by Nick Higham for use with CLACON.
24 *
25 * Arguments
26 * =========
27 *
28 * N (input) INTEGER
29 * The number of elements in the vector CX.
30 *
31 * CX (input) COMPLEX array, dimension (N)
32 * The vector whose elements will be summed.
33 *
34 * INCX (input) INTEGER
35 * The spacing between successive values of CX. INCX > 0.
36 *
37 * =====================================================================
38 *
39 * .. Local Scalars ..
40  INTEGER i, nincx
41  REAL stemp
42 * ..
43 * .. Intrinsic Functions ..
44  INTRINSIC abs
45 * ..
46 * .. Executable Statements ..
47 *
48  scsum1 = 0.0e0
49  stemp = 0.0e0
50  IF( n.LE.0 )
51  $ return
52  IF( incx.EQ.1 )
53  $ go to 20
54 *
55 * CODE FOR INCREMENT NOT EQUAL TO 1
56 *
57  nincx = n*incx
58  DO 10 i = 1, nincx, incx
59 *
60 * NEXT LINE MODIFIED.
61 *
62  stemp = stemp + abs( cx( i ) )
63  10 continue
64  scsum1 = stemp
65  return
66 *
67 * CODE FOR INCREMENT EQUAL TO 1
68 *
69  20 continue
70  DO 30 i = 1, n
71 *
72 * NEXT LINE MODIFIED.
73 *
74  stemp = stemp + abs( cx( i ) )
75  30 continue
76  scsum1 = stemp
77  return
78 *
79 * End of SCSUM1
80 *
81  END