Import GotoBLAS2 1.13 BSD version codes.
This commit is contained in:
27
reference/srotgf.f
Normal file
27
reference/srotgf.f
Normal file
@@ -0,0 +1,27 @@
|
||||
subroutine srotgf(sa,sb,c,s)
|
||||
c
|
||||
c construct givens plane rotation.
|
||||
c jack dongarra, linpack, 3/11/78.
|
||||
c
|
||||
real sa,sb,c,s,roe,scale,r,z
|
||||
c
|
||||
roe = sb
|
||||
if( abs(sa) .gt. abs(sb) ) roe = sa
|
||||
scale = abs(sa) + abs(sb)
|
||||
if( scale .ne. 0.0 ) go to 10
|
||||
c = 1.0
|
||||
s = 0.0
|
||||
r = 0.0
|
||||
z = 0.0
|
||||
go to 20
|
||||
10 r = scale*sqrt((sa/scale)**2 + (sb/scale)**2)
|
||||
r = sign(1.0,roe)*r
|
||||
c = sa/r
|
||||
s = sb/r
|
||||
z = 1.0
|
||||
if( abs(sa) .gt. abs(sb) ) z = s
|
||||
if( abs(sb) .ge. abs(sa) .and. c .ne. 0.0 ) z = 1.0/c
|
||||
20 sa = r
|
||||
sb = z
|
||||
return
|
||||
end
|
||||
Reference in New Issue
Block a user