| 1 | /* eispack/elmhes.f -- translated by f2c (version 20050501). |
| 2 | You must link the resulting object file with libf2c: |
| 3 | on Microsoft Windows system, link with libf2c.lib; |
| 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm |
| 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm |
| 6 | -- in that order, at the end of the command line, as in |
| 7 | cc *.o -lf2c -lm |
| 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., |
| 9 | |
| 10 | http://www.netlib.org/f2c/libf2c.zip |
| 11 | */ |
| 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | #include "v3p_netlib.h"cxx . . $ `<file>/Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib.h`/ |
| 17 | |
| 18 | /*< subroutine elmhes(nm,n,low,igh,a,int) >*/ |
| 19 | /* Subroutine */ int elmhes_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:159:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *nm, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *n, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *low, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! * |
| 20 | igh, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *a, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *int__) |
| 21 | { |
| 22 | /* System generated locals */ |
| 23 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! a_dim1, a_offset, i__1, i__2, i__3; |
| 24 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! d__1; |
| 25 | |
| 26 | /* Local variables */ |
| 27 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__, j, m; |
| 28 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! x, y; |
| 29 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! la, mm1, kp1, mp1; |
| 30 | |
| 31 | |
| 32 | /*< integer i,j,m,n,la,nm,igh,kp1,low,mm1,mp1 >*/ |
| 33 | /*< double precision a(nm,n) >*/ |
| 34 | /*< double precision x,y >*/ |
| 35 | /*< integer int(igh) >*/ |
| 36 | |
| 37 | /* this subroutine is a translation of the algol procedure elmhes, */ |
| 38 | /* num. math. 12, 349-368(1968) by martin and wilkinson. */ |
| 39 | /* handbook for auto. comp., vol.ii-linear algebra, 339-358(1971). */ |
| 40 | |
| 41 | /* given a real general matrix, this subroutine */ |
| 42 | /* reduces a submatrix situated in rows and columns */ |
| 43 | /* low through igh to upper hessenberg form by */ |
| 44 | /* stabilized elementary similarity transformations. */ |
| 45 | |
| 46 | /* on input */ |
| 47 | |
| 48 | /* nm must be set to the row dimension of two-dimensional */ |
| 49 | /* array parameters as declared in the calling program */ |
| 50 | /* dimension statement. */ |
| 51 | |
| 52 | /* n is the order of the matrix. */ |
| 53 | |
| 54 | /* low and igh are integers determined by the balancing */ |
| 55 | /* subroutine balanc. if balanc has not been used, */ |
| 56 | /* set low=1, igh=n. */ |
| 57 | |
| 58 | /* a contains the input matrix. */ |
| 59 | |
| 60 | /* on output */ |
| 61 | |
| 62 | /* a contains the hessenberg matrix. the multipliers */ |
| 63 | /* which were used in the reduction are stored in the */ |
| 64 | /* remaining triangle under the hessenberg matrix. */ |
| 65 | |
| 66 | /* int contains information on the rows and columns */ |
| 67 | /* interchanged in the reduction. */ |
| 68 | /* only elements low through igh are used. */ |
| 69 | |
| 70 | /* questions and comments should be directed to burton s. garbow, */ |
| 71 | /* mathematics and computer science div, argonne national laboratory */ |
| 72 | |
| 73 | /* this version dated august 1983. */ |
| 74 | |
| 75 | /* ------------------------------------------------------------------ */ |
| 76 | |
| 77 | /*< la = igh - 1 >*/ |
| 78 | /* Parameter adjustments */ |
| 79 | a_dim1 = *nm; |
| 80 | a_offset = 1 + a_dim1; |
| 81 | a -= a_offset; |
| 82 | --int__; |
| 83 | |
| 84 | /* Function Body */ |
| 85 | la = *igh - 1; |
| 86 | /*< kp1 = low + 1 >*/ |
| 87 | kp1 = *low + 1; |
| 88 | /*< if (la .lt. kp1) go to 200 >*/ |
| 89 | if (la < kp1) { |
| 90 | goto L200; |
| 91 | } |
| 92 | |
| 93 | /*< do 180 m = kp1, la >*/ |
| 94 | i__1 = la; |
| 95 | for (m = kp1; m <= i__1; ++m) { |
| 96 | /*< mm1 = m - 1 >*/ |
| 97 | mm1 = m - 1; |
| 98 | /*< x = 0.0d0 >*/ |
| 99 | x = 0.; |
| 100 | /*< i = m >*/ |
| 101 | i__ = m; |
| 102 | |
| 103 | /*< do 100 j = m, igh >*/ |
| 104 | i__2 = *igh; |
| 105 | for (j = m; j <= i__2; ++j) { |
| 106 | /*< if (dabs(a(j,mm1)) .le. dabs(x)) go to 100 >*/ |
| 107 | if ((d__1 = a[j + mm1 * a_dim1], abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(d__1)) <= abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(x)) { |
| 108 | goto L100; |
| 109 | } |
| 110 | /*< x = a(j,mm1) >*/ |
| 111 | x = a[j + mm1 * a_dim1]; |
| 112 | /*< i = j >*/ |
| 113 | i__ = j; |
| 114 | /*< 100 continue >*/ |
| 115 | L100: |
| 116 | ; |
| 117 | } |
| 118 | |
| 119 | /*< int(m) = i >*/ |
| 120 | int__[m] = i__; |
| 121 | /*< if (i .eq. m) go to 130 >*/ |
| 122 | if (i__ == m) { |
| 123 | goto L130; |
| 124 | } |
| 125 | /* .......... interchange rows and columns of a .......... */ |
| 126 | /*< do 110 j = mm1, n >*/ |
| 127 | i__2 = *n; |
| 128 | for (j = mm1; j <= i__2; ++j) { |
| 129 | /*< y = a(i,j) >*/ |
| 130 | y = a[i__ + j * a_dim1]; |
| 131 | /*< a(i,j) = a(m,j) >*/ |
| 132 | a[i__ + j * a_dim1] = a[m + j * a_dim1]; |
| 133 | /*< a(m,j) = y >*/ |
| 134 | a[m + j * a_dim1] = y; |
| 135 | /*< 110 continue >*/ |
| 136 | /* L110: */ |
| 137 | } |
| 138 | |
| 139 | /*< do 120 j = 1, igh >*/ |
| 140 | i__2 = *igh; |
| 141 | for (j = 1; j <= i__2; ++j) { |
| 142 | /*< y = a(j,i) >*/ |
| 143 | y = a[j + i__ * a_dim1]; |
| 144 | /*< a(j,i) = a(j,m) >*/ |
| 145 | a[j + i__ * a_dim1] = a[j + m * a_dim1]; |
| 146 | /*< a(j,m) = y >*/ |
| 147 | a[j + m * a_dim1] = y; |
| 148 | /*< 120 continue >*/ |
| 149 | /* L120: */ |
| 150 | } |
| 151 | /* .......... end interchange .......... */ |
| 152 | /*< 130 if (x .eq. 0.0d0) go to 180 >*/ |
| 153 | L130: |
| 154 | if (x == 0.) { |
| 155 | goto L180; |
| 156 | } |
| 157 | /*< mp1 = m + 1 >*/ |
| 158 | mp1 = m + 1; |
| 159 | |
| 160 | /*< do 160 i = mp1, igh >*/ |
| 161 | i__2 = *igh; |
| 162 | for (i__ = mp1; i__ <= i__2; ++i__) { |
| 163 | /*< y = a(i,mm1) >*/ |
| 164 | y = a[i__ + mm1 * a_dim1]; |
| 165 | /*< if (y .eq. 0.0d0) go to 160 >*/ |
| 166 | if (y == 0.) { |
| 167 | goto L160; |
| 168 | } |
| 169 | /*< y = y / x >*/ |
| 170 | y /= x; |
| 171 | /*< a(i,mm1) = y >*/ |
| 172 | a[i__ + mm1 * a_dim1] = y; |
| 173 | |
| 174 | /*< do 140 j = m, n >*/ |
| 175 | i__3 = *n; |
| 176 | for (j = m; j <= i__3; ++j) { |
| 177 | /*< 140 a(i,j) = a(i,j) - y * a(m,j) >*/ |
| 178 | /* L140: */ |
| 179 | a[i__ + j * a_dim1] -= y * a[m + j * a_dim1]; |
| 180 | } |
| 181 | |
| 182 | /*< do 150 j = 1, igh >*/ |
| 183 | i__3 = *igh; |
| 184 | for (j = 1; j <= i__3; ++j) { |
| 185 | /*< 150 a(j,m) = a(j,m) + y * a(j,i) >*/ |
| 186 | /* L150: */ |
| 187 | a[j + m * a_dim1] += y * a[j + i__ * a_dim1]; |
| 188 | } |
| 189 | |
| 190 | /*< 160 continue >*/ |
| 191 | L160: |
| 192 | ; |
| 193 | } |
| 194 | |
| 195 | /*< 180 continue >*/ |
| 196 | L180: |
| 197 | ; |
| 198 | } |
| 199 | |
| 200 | /*< 200 return >*/ |
| 201 | L200: |
| 202 | return 0; |
| 203 | /*< end >*/ |
| 204 | } /* elmhes_ */ |
| 205 | |
| 206 | #ifdef __cplusplus |
| 207 | } |
| 208 | #endif |