LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ scasum()

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

SCASUM

Purpose:
    SCASUM takes the sum of the (|Re(.)| + |Im(.)|)'s of a complex vector and
    returns a single precision result.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in,out]CX
          CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of SX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 3/93 to return if incx .le. 0.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 74 of file scasum.f.

74 *
75 * -- Reference BLAS level1 routine (version 3.8.0) --
76 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
77 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
78 * November 2017
79 *
80 * .. Scalar Arguments ..
81  INTEGER incx,n
82 * ..
83 * .. Array Arguments ..
84  COMPLEX cx(*)
85 * ..
86 *
87 * =====================================================================
88 *
89 * .. Local Scalars ..
90  REAL stemp
91  INTEGER i,nincx
92 * ..
93 * .. Intrinsic Functions ..
94  INTRINSIC abs,aimag,real
95 * ..
96  scasum = 0.0e0
97  stemp = 0.0e0
98  IF (n.LE.0 .OR. incx.LE.0) RETURN
99  IF (incx.EQ.1) THEN
100 *
101 * code for increment equal to 1
102 *
103  DO i = 1,n
104  stemp = stemp + abs(REAL(cx(i))) + abs(aimag(cx(i)))
105  END DO
106  ELSE
107 *
108 * code for increment not equal to 1
109 *
110  nincx = n*incx
111  DO i = 1,nincx,incx
112  stemp = stemp + abs(REAL(cx(i))) + abs(aimag(cx(i)))
113  END DO
114  END IF
115  scasum = stemp
116  RETURN
real function scasum(N, CX, INCX)
SCASUM
Definition: scasum.f:74
Here is the caller graph for this function: