Free cookie consent management tool by TermsFeed Policy Generator

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

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

#2789 added Finbarr O'Sullivan smoothing spline code

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