summaryrefslogtreecommitdiff
path: root/src/fortran/blas/zdotu.f
diff options
context:
space:
mode:
authorSiddhesh Wani2015-05-25 14:46:31 +0530
committerSiddhesh Wani2015-05-25 14:46:31 +0530
commitdb464f35f5a10b58d9ed1085e0b462689adee583 (patch)
treede5cdbc71a54765d9fec33414630ae2c8904c9b8 /src/fortran/blas/zdotu.f
downloadScilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.gz
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.bz2
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.zip
Original Version
Diffstat (limited to 'src/fortran/blas/zdotu.f')
-rw-r--r--src/fortran/blas/zdotu.f36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/fortran/blas/zdotu.f b/src/fortran/blas/zdotu.f
new file mode 100644
index 0000000..329e988
--- /dev/null
+++ b/src/fortran/blas/zdotu.f
@@ -0,0 +1,36 @@
+ double complex function zdotu(n,zx,incx,zy,incy)
+c
+c forms the dot product of two vectors.
+c jack dongarra, 3/11/78.
+c modified 12/3/93, array(1) declarations changed to array(*)
+c
+ double complex zx(*),zy(*),ztemp
+ integer i,incx,incy,ix,iy,n
+ ztemp = (0.0d0,0.0d0)
+ zdotu = (0.0d0,0.0d0)
+ if(n.le.0)return
+ if(incx.eq.1.and.incy.eq.1)go to 20
+c
+c code for unequal increments or equal increments
+c not equal to 1
+c
+ ix = 1
+ iy = 1
+ if(incx.lt.0)ix = (-n+1)*incx + 1
+ if(incy.lt.0)iy = (-n+1)*incy + 1
+ do 10 i = 1,n
+ ztemp = ztemp + zx(ix)*zy(iy)
+ ix = ix + incx
+ iy = iy + incy
+ 10 continue
+ zdotu = ztemp
+ return
+c
+c code for both increments equal to 1
+c
+ 20 do 30 i = 1,n
+ ztemp = ztemp + zx(i)*zy(i)
+ 30 continue
+ zdotu = ztemp
+ return
+ end