summaryrefslogtreecommitdiff
path: root/2.3-1/src/fortran/blas/zrotg.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/blas/zrotg.f
downloadScilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.gz
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.bz2
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.zip
First commit
Diffstat (limited to '2.3-1/src/fortran/blas/zrotg.f')
-rw-r--r--2.3-1/src/fortran/blas/zrotg.f21
1 files changed, 21 insertions, 0 deletions
diff --git a/2.3-1/src/fortran/blas/zrotg.f b/2.3-1/src/fortran/blas/zrotg.f
new file mode 100644
index 00000000..f6a4aa12
--- /dev/null
+++ b/2.3-1/src/fortran/blas/zrotg.f
@@ -0,0 +1,21 @@
+ subroutine zrotg(ca,cb,c,s)
+ double complex ca,cb,s
+ double precision c
+ double precision norm,scale
+ double complex alpha
+ if (cdabs(ca) .ne. 0.0d0) go to 10
+ c = 0.0d0
+ s = (1.0d0,0.0d0)
+ ca = cb
+ go to 20
+ 10 continue
+ scale = cdabs(ca) + cdabs(cb)
+ norm = scale*dsqrt((cdabs(ca/dcmplx(scale,0.0d0)))**2 +
+ * (cdabs(cb/dcmplx(scale,0.0d0)))**2)
+ alpha = ca /cdabs(ca)
+ c = cdabs(ca) / norm
+ s = alpha * dconjg(cb) / norm
+ ca = alpha * norm
+ 20 continue
+ return
+ end