LAPACK  3.10.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.
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 71 of file scasum.f.

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