00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016 int claqr1_(integer *n, complex *h__, integer *ldh, complex *
00017 s1, complex *s2, complex *v)
00018 {
00019
00020 integer h_dim1, h_offset, i__1, i__2, i__3, i__4;
00021 real r__1, r__2, r__3, r__4, r__5, r__6;
00022 complex q__1, q__2, q__3, q__4, q__5, q__6, q__7, q__8;
00023
00024
00025 double r_imag(complex *);
00026
00027
00028 real s;
00029 complex h21s, h31s;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 h_dim1 = *ldh;
00089 h_offset = 1 + h_dim1;
00090 h__ -= h_offset;
00091 --v;
00092
00093
00094 if (*n == 2) {
00095 i__1 = h_dim1 + 1;
00096 q__2.r = h__[i__1].r - s2->r, q__2.i = h__[i__1].i - s2->i;
00097 q__1.r = q__2.r, q__1.i = q__2.i;
00098 i__2 = h_dim1 + 2;
00099 s = (r__1 = q__1.r, dabs(r__1)) + (r__2 = r_imag(&q__1), dabs(r__2))
00100 + ((r__3 = h__[i__2].r, dabs(r__3)) + (r__4 = r_imag(&h__[
00101 h_dim1 + 2]), dabs(r__4)));
00102 if (s == 0.f) {
00103 v[1].r = 0.f, v[1].i = 0.f;
00104 v[2].r = 0.f, v[2].i = 0.f;
00105 } else {
00106 i__1 = h_dim1 + 2;
00107 q__1.r = h__[i__1].r / s, q__1.i = h__[i__1].i / s;
00108 h21s.r = q__1.r, h21s.i = q__1.i;
00109 i__1 = (h_dim1 << 1) + 1;
00110 q__2.r = h21s.r * h__[i__1].r - h21s.i * h__[i__1].i, q__2.i =
00111 h21s.r * h__[i__1].i + h21s.i * h__[i__1].r;
00112 i__2 = h_dim1 + 1;
00113 q__4.r = h__[i__2].r - s1->r, q__4.i = h__[i__2].i - s1->i;
00114 i__3 = h_dim1 + 1;
00115 q__6.r = h__[i__3].r - s2->r, q__6.i = h__[i__3].i - s2->i;
00116 q__5.r = q__6.r / s, q__5.i = q__6.i / s;
00117 q__3.r = q__4.r * q__5.r - q__4.i * q__5.i, q__3.i = q__4.r *
00118 q__5.i + q__4.i * q__5.r;
00119 q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
00120 v[1].r = q__1.r, v[1].i = q__1.i;
00121 i__1 = h_dim1 + 1;
00122 i__2 = (h_dim1 << 1) + 2;
00123 q__4.r = h__[i__1].r + h__[i__2].r, q__4.i = h__[i__1].i + h__[
00124 i__2].i;
00125 q__3.r = q__4.r - s1->r, q__3.i = q__4.i - s1->i;
00126 q__2.r = q__3.r - s2->r, q__2.i = q__3.i - s2->i;
00127 q__1.r = h21s.r * q__2.r - h21s.i * q__2.i, q__1.i = h21s.r *
00128 q__2.i + h21s.i * q__2.r;
00129 v[2].r = q__1.r, v[2].i = q__1.i;
00130 }
00131 } else {
00132 i__1 = h_dim1 + 1;
00133 q__2.r = h__[i__1].r - s2->r, q__2.i = h__[i__1].i - s2->i;
00134 q__1.r = q__2.r, q__1.i = q__2.i;
00135 i__2 = h_dim1 + 2;
00136 i__3 = h_dim1 + 3;
00137 s = (r__1 = q__1.r, dabs(r__1)) + (r__2 = r_imag(&q__1), dabs(r__2))
00138 + ((r__3 = h__[i__2].r, dabs(r__3)) + (r__4 = r_imag(&h__[
00139 h_dim1 + 2]), dabs(r__4))) + ((r__5 = h__[i__3].r, dabs(r__5))
00140 + (r__6 = r_imag(&h__[h_dim1 + 3]), dabs(r__6)));
00141 if (s == 0.f) {
00142 v[1].r = 0.f, v[1].i = 0.f;
00143 v[2].r = 0.f, v[2].i = 0.f;
00144 v[3].r = 0.f, v[3].i = 0.f;
00145 } else {
00146 i__1 = h_dim1 + 2;
00147 q__1.r = h__[i__1].r / s, q__1.i = h__[i__1].i / s;
00148 h21s.r = q__1.r, h21s.i = q__1.i;
00149 i__1 = h_dim1 + 3;
00150 q__1.r = h__[i__1].r / s, q__1.i = h__[i__1].i / s;
00151 h31s.r = q__1.r, h31s.i = q__1.i;
00152 i__1 = h_dim1 + 1;
00153 q__4.r = h__[i__1].r - s1->r, q__4.i = h__[i__1].i - s1->i;
00154 i__2 = h_dim1 + 1;
00155 q__6.r = h__[i__2].r - s2->r, q__6.i = h__[i__2].i - s2->i;
00156 q__5.r = q__6.r / s, q__5.i = q__6.i / s;
00157 q__3.r = q__4.r * q__5.r - q__4.i * q__5.i, q__3.i = q__4.r *
00158 q__5.i + q__4.i * q__5.r;
00159 i__3 = (h_dim1 << 1) + 1;
00160 q__7.r = h__[i__3].r * h21s.r - h__[i__3].i * h21s.i, q__7.i =
00161 h__[i__3].r * h21s.i + h__[i__3].i * h21s.r;
00162 q__2.r = q__3.r + q__7.r, q__2.i = q__3.i + q__7.i;
00163 i__4 = h_dim1 * 3 + 1;
00164 q__8.r = h__[i__4].r * h31s.r - h__[i__4].i * h31s.i, q__8.i =
00165 h__[i__4].r * h31s.i + h__[i__4].i * h31s.r;
00166 q__1.r = q__2.r + q__8.r, q__1.i = q__2.i + q__8.i;
00167 v[1].r = q__1.r, v[1].i = q__1.i;
00168 i__1 = h_dim1 + 1;
00169 i__2 = (h_dim1 << 1) + 2;
00170 q__5.r = h__[i__1].r + h__[i__2].r, q__5.i = h__[i__1].i + h__[
00171 i__2].i;
00172 q__4.r = q__5.r - s1->r, q__4.i = q__5.i - s1->i;
00173 q__3.r = q__4.r - s2->r, q__3.i = q__4.i - s2->i;
00174 q__2.r = h21s.r * q__3.r - h21s.i * q__3.i, q__2.i = h21s.r *
00175 q__3.i + h21s.i * q__3.r;
00176 i__3 = h_dim1 * 3 + 2;
00177 q__6.r = h__[i__3].r * h31s.r - h__[i__3].i * h31s.i, q__6.i =
00178 h__[i__3].r * h31s.i + h__[i__3].i * h31s.r;
00179 q__1.r = q__2.r + q__6.r, q__1.i = q__2.i + q__6.i;
00180 v[2].r = q__1.r, v[2].i = q__1.i;
00181 i__1 = h_dim1 + 1;
00182 i__2 = h_dim1 * 3 + 3;
00183 q__5.r = h__[i__1].r + h__[i__2].r, q__5.i = h__[i__1].i + h__[
00184 i__2].i;
00185 q__4.r = q__5.r - s1->r, q__4.i = q__5.i - s1->i;
00186 q__3.r = q__4.r - s2->r, q__3.i = q__4.i - s2->i;
00187 q__2.r = h31s.r * q__3.r - h31s.i * q__3.i, q__2.i = h31s.r *
00188 q__3.i + h31s.i * q__3.r;
00189 i__3 = (h_dim1 << 1) + 3;
00190 q__6.r = h21s.r * h__[i__3].r - h21s.i * h__[i__3].i, q__6.i =
00191 h21s.r * h__[i__3].i + h21s.i * h__[i__3].r;
00192 q__1.r = q__2.r + q__6.r, q__1.i = q__2.i + q__6.i;
00193 v[3].r = q__1.r, v[3].i = q__1.i;
00194 }
00195 }
00196 return 0;
00197 }