Free cookie consent management tool by TermsFeed Policy Generator

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

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

#2789 added Finbarr O'Sullivan smoothing spline code

File size: 683 bytes
Line 
1      SUBROUTINE CROTG(CA,CB,C,S)
2*     .. Scalar Arguments ..
3      COMPLEX CA,CB,S
4      REAL C
5*     ..
6*
7*  Purpose
8*  =======
9*
10*  CROTG determines a complex Givens rotation.
11*
12*     .. Local Scalars ..
13      COMPLEX ALPHA
14      REAL NORM,SCALE
15*     ..
16*     .. Intrinsic Functions ..
17      INTRINSIC CABS,CONJG,SQRT
18*     ..
19      IF (CABS(CA).NE.0.) GO TO 10
20      C = 0.
21      S = (1.,0.)
22      CA = CB
23      GO TO 20
24   10 CONTINUE
25      SCALE = CABS(CA) + CABS(CB)
26      NORM = SCALE*SQRT((CABS(CA/SCALE))**2+ (CABS(CB/SCALE))**2)
27      ALPHA = CA/CABS(CA)
28      C = CABS(CA)/NORM
29      S = ALPHA*CONJG(CB)/NORM
30      CA = ALPHA*NORM
31   20 CONTINUE
32      RETURN
33      END
Note: See TracBrowser for help on using the repository browser.