Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pycba2.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pycba2.f
1 
2 C*********************************************************************
3 
4 C...PYCBA2
5 C...Auxiliary to PYEICG.
6 C
7 C THIS SUBROUTINE IS A TRANSLATION OF THE ALGOL PROCEDURE
8 C CBABK2, WHICH IS A COMPLEX VERSION OF BALBAK,
9 C NUM. MATH. 13, 293-304(1969) BY PARLETT AND REINSCH.
10 C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 315-326(1971).
11 C
12 C THIS SUBROUTINE FORMS THE EIGENVECTORS OF A COMPLEX GENERAL
13 C MATRIX BY BACK TRANSFORMING THOSE OF THE CORRESPONDING
14 C BALANCED MATRIX DETERMINED BY CBAL.
15 C
16 C ON INPUT
17 C
18 C NM MUST BE SET TO THE ROW DIMENSION OF TWO-DIMENSIONAL
19 C ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM
20 C DIMENSION STATEMENT.
21 C
22 C N IS THE ORDER OF THE MATRIX.
23 C
24 C LOW AND IGH ARE INTEGERS DETERMINED BY CBAL.
25 C
26 C SCALE CONTAINS INFORMATION DETERMINING THE PERMUTATIONS
27 C AND SCALING FACTORS USED BY CBAL.
28 C
29 C M IS THE NUMBER OF EIGENVECTORS TO BE BACK TRANSFORMED.
30 C
31 C ZR AND ZI CONTAIN THE REAL AND IMAGINARY PARTS,
32 C RESPECTIVELY, OF THE EIGENVECTORS TO BE
33 C BACK TRANSFORMED IN THEIR FIRST M COLUMNS.
34 C
35 C ON OUTPUT
36 C
37 C ZR AND ZI CONTAIN THE REAL AND IMAGINARY PARTS,
38 C RESPECTIVELY, OF THE TRANSFORMED EIGENVECTORS
39 C IN THEIR FIRST M COLUMNS.
40 C
41 C QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW,
42 C MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY
43 C
44 C THIS VERSION DATED AUGUST 1983.
45 C
46 
47  SUBROUTINE pycba2(NM,N,LOW,IGH,SCALE,M,ZR,ZI)
48 
49  INTEGER i,j,k,m,n,ii,nm,igh,low
50  DOUBLE PRECISION scale(4),zr(4,4),zi(4,4)
51  DOUBLE PRECISION s
52 
53  IF (m .EQ. 0) goto 150
54  IF (igh .EQ. low) goto 120
55 C
56  DO 110 i = low, igh
57  s = scale(i)
58 C .......... LEFT HAND EIGENVECTORS ARE BACK TRANSFORMED
59 C IF THE FOREGOING STATEMENT IS REPLACED BY
60 C S=1.0D0/SCALE(I). ..........
61  DO 100 j = 1, m
62  zr(i,j) = zr(i,j) * s
63  zi(i,j) = zi(i,j) * s
64  100 CONTINUE
65 C
66  110 CONTINUE
67 C .......... FOR I=LOW-1 STEP -1 UNTIL 1,
68 C IGH+1 STEP 1 UNTIL N DO -- ..........
69  120 DO 140 ii = 1, n
70  i = ii
71  IF (i .GE. low .AND. i .LE. igh) goto 140
72  IF (i .LT. low) i = low - ii
73  k = scale(i)
74  IF (k .EQ. i) goto 140
75 C
76  DO 130 j = 1, m
77  s = zr(i,j)
78  zr(i,j) = zr(k,j)
79  zr(k,j) = s
80  s = zi(i,j)
81  zi(i,j) = zi(k,j)
82  zi(k,j) = s
83  130 CONTINUE
84 C
85  140 CONTINUE
86 C
87  150 RETURN
88  END