LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ 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 78 of file scsum1.f.

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*
real function scsum1(n, cx, incx)
SCSUM1 forms the 1-norm of the complex vector using the true absolute value.
Definition scsum1.f:79
Here is the call graph for this function:
Here is the caller graph for this function: