NLSL
drotg.f90
Go to the documentation of this file.
1  subroutine drotg(da,db,c,s)
2 c
3 c construct givens plane rotation.
4 c jack dongarra, linpack, 3/11/78.
5 c modified 9/27/86.
6 c
7  double precision da,db,c,s,roe,scale,r,z
8 c
9  roe = db
10  if( dabs(da) .gt. dabs(db) ) roe = da
11  scale = dabs(da) + dabs(db)
12  if( scale .ne. 0.0d0 ) go to 10
13  c = 1.0d0
14  s = 0.0d0
15  r = 0.0d0
16  go to 20
17  10 r = scale*dsqrt((da/scale)**2 + (db/scale)**2)
18  r = dsign(1.0d0,roe)*r
19  c = da/r
20  s = db/r
21  20 z = s
22  if( dabs(c) .gt. 0.0d0 .and. dabs(c) .le. s ) z = 1.0d0/c
23  da = r
24  db = z
25  return
26  end
subroutine drotg(da, db, c, s)
Definition: drotg.f90:2