summaryrefslogtreecommitdiff
path: root/src/fortran/blas/drotg.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/drotg.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/drotg.f')
-rw-r--r--src/fortran/blas/drotg.f27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/fortran/blas/drotg.f b/src/fortran/blas/drotg.f
new file mode 100644
index 0000000..67838e2
--- /dev/null
+++ b/src/fortran/blas/drotg.f
@@ -0,0 +1,27 @@
+ subroutine drotg(da,db,c,s)
+c
+c construct givens plane rotation.
+c jack dongarra, linpack, 3/11/78.
+c
+ double precision da,db,c,s,roe,scale,r,z
+c
+ roe = db
+ if( dabs(da) .gt. dabs(db) ) roe = da
+ scale = dabs(da) + dabs(db)
+ if( scale .ne. 0.0d0 ) go to 10
+ c = 1.0d0
+ s = 0.0d0
+ r = 0.0d0
+ z = 0.0d0
+ go to 20
+ 10 r = scale*dsqrt((da/scale)**2 + (db/scale)**2)
+ r = dsign(1.0d0,roe)*r
+ c = da/r
+ s = db/r
+ z = 1.0d0
+ if( dabs(da) .gt. dabs(db) ) z = s
+ if( dabs(db) .ge. dabs(da) .and. c .ne. 0.0d0 ) z = 1.0d0/c
+ 20 da = r
+ db = z
+ return
+ end