Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2789_MathNetNumerics-Exploration/HeuristicLab.Algorithms.DataAnalysis.Experimental/sbart/srotg.f @ 17751

Last change on this file since 17751 was 15457, checked in by gkronber, 7 years ago

#2789 added Finbarr O'Sullivan smoothing spline code

File size: 783 bytes
Line 
1      SUBROUTINE SROTG(SA,SB,C,S)
2*     .. Scalar Arguments ..
3      REAL C,S,SA,SB
4*     ..
5*
6*  Purpose
7*  =======
8*
9*     construct givens plane rotation.
10*     jack dongarra, linpack, 3/11/78.
11*
12*
13*     .. Local Scalars ..
14      REAL R,ROE,SCALE,Z
15*     ..
16*     .. Intrinsic Functions ..
17      INTRINSIC ABS,SIGN,SQRT
18*     ..
19      ROE = SB
20      IF (ABS(SA).GT.ABS(SB)) ROE = SA
21      SCALE = ABS(SA) + ABS(SB)
22      IF (SCALE.NE.0.0) GO TO 10
23      C = 1.0
24      S = 0.0
25      R = 0.0
26      Z = 0.0
27      GO TO 20
28   10 R = SCALE*SQRT((SA/SCALE)**2+ (SB/SCALE)**2)
29      R = SIGN(1.0,ROE)*R
30      C = SA/R
31      S = SB/R
32      Z = 1.0
33      IF (ABS(SA).GT.ABS(SB)) Z = S
34      IF (ABS(SB).GE.ABS(SA) .AND. C.NE.0.0) Z = 1.0/C
35   20 SA = R
36      SB = Z
37      RETURN
38      END
Note: See TracBrowser for help on using the repository browser.