summaryrefslogtreecommitdiff
path: root/2.3-1/src/fortran/lapack/dzsum1.f
diff options
context:
space:
mode:
authorSandeep Gupta2017-06-18 23:55:40 +0530
committerSandeep Gupta2017-06-18 23:55:40 +0530
commitb43eccd4cffed5bd1017c5821524fb6e49202f78 (patch)
tree4c53d798252cbeae9bcf7dc9604524b20bb10f27 /2.3-1/src/fortran/lapack/dzsum1.f
downloadScilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.gz
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.bz2
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.zip
First commit
Diffstat (limited to '2.3-1/src/fortran/lapack/dzsum1.f')
-rw-r--r--2.3-1/src/fortran/lapack/dzsum1.f81
1 files changed, 81 insertions, 0 deletions
diff --git a/2.3-1/src/fortran/lapack/dzsum1.f b/2.3-1/src/fortran/lapack/dzsum1.f
new file mode 100644
index 00000000..0b6c60e7
--- /dev/null
+++ b/2.3-1/src/fortran/lapack/dzsum1.f
@@ -0,0 +1,81 @@
+ DOUBLE PRECISION FUNCTION DZSUM1( N, CX, INCX )
+*
+* -- LAPACK auxiliary routine (version 3.1) --
+* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
+* November 2006
+*
+* .. Scalar Arguments ..
+ INTEGER INCX, N
+* ..
+* .. Array Arguments ..
+ COMPLEX*16 CX( * )
+* ..
+*
+* Purpose
+* =======
+*
+* DZSUM1 takes the sum of the absolute values of a complex
+* vector and returns a double precision result.
+*
+* Based on DZASUM from the Level 1 BLAS.
+* The change is to use the 'genuine' absolute value.
+*
+* Contributed by Nick Higham for use with ZLACON.
+*
+* Arguments
+* =========
+*
+* N (input) INTEGER
+* The number of elements in the vector CX.
+*
+* CX (input) COMPLEX*16 array, dimension (N)
+* The vector whose elements will be summed.
+*
+* INCX (input) INTEGER
+* The spacing between successive values of CX. INCX > 0.
+*
+* =====================================================================
+*
+* .. Local Scalars ..
+ INTEGER I, NINCX
+ DOUBLE PRECISION STEMP
+* ..
+* .. Intrinsic Functions ..
+ INTRINSIC ABS
+* ..
+* .. Executable Statements ..
+*
+ DZSUM1 = 0.0D0
+ STEMP = 0.0D0
+ IF( N.LE.0 )
+ $ RETURN
+ IF( INCX.EQ.1 )
+ $ GO TO 20
+*
+* CODE FOR INCREMENT NOT EQUAL TO 1
+*
+ NINCX = N*INCX
+ DO 10 I = 1, NINCX, INCX
+*
+* NEXT LINE MODIFIED.
+*
+ STEMP = STEMP + ABS( CX( I ) )
+ 10 CONTINUE
+ DZSUM1 = STEMP
+ RETURN
+*
+* CODE FOR INCREMENT EQUAL TO 1
+*
+ 20 CONTINUE
+ DO 30 I = 1, N
+*
+* NEXT LINE MODIFIED.
+*
+ STEMP = STEMP + ABS( CX( I ) )
+ 30 CONTINUE
+ DZSUM1 = STEMP
+ RETURN
+*
+* End of DZSUM1
+*
+ END