diff options
author | Ankit Raj | 2017-06-21 10:26:59 +0530 |
---|---|---|
committer | Ankit Raj | 2017-06-21 10:26:59 +0530 |
commit | a555820564d9f2e95ca8c97871339d3a5a2081c3 (patch) | |
tree | adb074b66a8e6750209880e6932305ce0a94c8bf /2.3-1/src/fortran/blas/drotg.f | |
download | Scilab2C-a555820564d9f2e95ca8c97871339d3a5a2081c3.tar.gz Scilab2C-a555820564d9f2e95ca8c97871339d3a5a2081c3.tar.bz2 Scilab2C-a555820564d9f2e95ca8c97871339d3a5a2081c3.zip |
Updated Scilab2C
Diffstat (limited to '2.3-1/src/fortran/blas/drotg.f')
-rw-r--r-- | 2.3-1/src/fortran/blas/drotg.f | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/2.3-1/src/fortran/blas/drotg.f b/2.3-1/src/fortran/blas/drotg.f new file mode 100644 index 00000000..67838e2c --- /dev/null +++ b/2.3-1/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 |