LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
dzasum.f
Go to the documentation of this file.
00001 *> \brief \b DZASUM
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *  Definition:
00009 *  ===========
00010 *
00011 *       DOUBLE PRECISION FUNCTION DZASUM(N,ZX,INCX)
00012 * 
00013 *       .. Scalar Arguments ..
00014 *       INTEGER INCX,N
00015 *       ..
00016 *       .. Array Arguments ..
00017 *       COMPLEX*16 ZX(*)
00018 *       ..
00019 *  
00020 *
00021 *> \par Purpose:
00022 *  =============
00023 *>
00024 *> \verbatim
00025 *>
00026 *>    DZASUM takes the sum of the absolute values.
00027 *> \endverbatim
00028 *
00029 *  Authors:
00030 *  ========
00031 *
00032 *> \author Univ. of Tennessee 
00033 *> \author Univ. of California Berkeley 
00034 *> \author Univ. of Colorado Denver 
00035 *> \author NAG Ltd. 
00036 *
00037 *> \date November 2011
00038 *
00039 *> \ingroup double_blas_level1
00040 *
00041 *> \par Further Details:
00042 *  =====================
00043 *>
00044 *> \verbatim
00045 *>
00046 *>     jack dongarra, 3/11/78.
00047 *>     modified 3/93 to return if incx .le. 0.
00048 *>     modified 12/3/93, array(1) declarations changed to array(*)
00049 *> \endverbatim
00050 *>
00051 *  =====================================================================
00052       DOUBLE PRECISION FUNCTION DZASUM(N,ZX,INCX)
00053 *
00054 *  -- Reference BLAS level1 routine (version 3.4.0) --
00055 *  -- Reference BLAS is a software package provided by Univ. of Tennessee,    --
00056 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00057 *     November 2011
00058 *
00059 *     .. Scalar Arguments ..
00060       INTEGER INCX,N
00061 *     ..
00062 *     .. Array Arguments ..
00063       COMPLEX*16 ZX(*)
00064 *     ..
00065 *
00066 *  =====================================================================
00067 *
00068 *     .. Local Scalars ..
00069       DOUBLE PRECISION STEMP
00070       INTEGER I,NINCX
00071 *     ..
00072 *     .. External Functions ..
00073       DOUBLE PRECISION DCABS1
00074       EXTERNAL DCABS1
00075 *     ..
00076       DZASUM = 0.0d0
00077       STEMP = 0.0d0
00078       IF (N.LE.0 .OR. INCX.LE.0) RETURN
00079       IF (INCX.EQ.1) THEN
00080 *
00081 *        code for increment equal to 1
00082 *
00083          DO I = 1,N
00084             STEMP = STEMP + DCABS1(ZX(I))
00085          END DO
00086       ELSE
00087 *
00088 *        code for increment not equal to 1
00089 *
00090          NINCX = N*INCX
00091          DO I = 1,NINCX,INCX
00092             STEMP = STEMP + DCABS1(ZX(I))
00093          END DO
00094       END IF
00095       DZASUM = STEMP
00096       RETURN
00097       END
 All Files Functions