LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ scsum1()

real function scsum1 ( integer  N,
complex, dimension( * )  CX,
integer  INCX 
)

SCSUM1 forms the 1-norm of the complex vector using the true absolute value.

Download SCSUM1 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 SCSUM1 takes the sum of the absolute values of a complex
 vector and returns a single precision result.

 Based on SCASUM from the Level 1 BLAS.
 The change is to use the 'genuine' absolute value.
Parameters
[in]N
          N is INTEGER
          The number of elements in the vector CX.
[in]CX
          CX is COMPLEX array, dimension (N)
          The vector whose elements will be summed.
[in]INCX
          INCX is INTEGER
          The spacing between successive values of CX.  INCX > 0.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Nick Higham for use with CLACON.

Definition at line 80 of file scsum1.f.

81 *
82 * -- LAPACK auxiliary routine --
83 * -- LAPACK is a software package provided by Univ. of Tennessee, --
84 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
85 *
86 * .. Scalar Arguments ..
87  INTEGER INCX, N
88 * ..
89 * .. Array Arguments ..
90  COMPLEX CX( * )
91 * ..
92 *
93 * =====================================================================
94 *
95 * .. Local Scalars ..
96  INTEGER I, NINCX
97  REAL STEMP
98 * ..
99 * .. Intrinsic Functions ..
100  INTRINSIC abs
101 * ..
102 * .. Executable Statements ..
103 *
104  scsum1 = 0.0e0
105  stemp = 0.0e0
106  IF( n.LE.0 )
107  $ RETURN
108  IF( incx.EQ.1 )
109  $ GO TO 20
110 *
111 * CODE FOR INCREMENT NOT EQUAL TO 1
112 *
113  nincx = n*incx
114  DO 10 i = 1, nincx, incx
115 *
116 * NEXT LINE MODIFIED.
117 *
118  stemp = stemp + abs( cx( i ) )
119  10 CONTINUE
120  scsum1 = stemp
121  RETURN
122 *
123 * CODE FOR INCREMENT EQUAL TO 1
124 *
125  20 CONTINUE
126  DO 30 i = 1, n
127 *
128 * NEXT LINE MODIFIED.
129 *
130  stemp = stemp + abs( cx( i ) )
131  30 CONTINUE
132  scsum1 = stemp
133  RETURN
134 *
135 * End of SCSUM1
136 *
real function scsum1(N, CX, INCX)
SCSUM1 forms the 1-norm of the complex vector using the true absolute value.
Definition: scsum1.f:81