You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dlatm6.c 19 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. #include <math.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <stdio.h>
  5. #include <complex.h>
  6. #ifdef complex
  7. #undef complex
  8. #endif
  9. #ifdef I
  10. #undef I
  11. #endif
  12. #if defined(_WIN64)
  13. typedef long long BLASLONG;
  14. typedef unsigned long long BLASULONG;
  15. #else
  16. typedef long BLASLONG;
  17. typedef unsigned long BLASULONG;
  18. #endif
  19. #ifdef LAPACK_ILP64
  20. typedef BLASLONG blasint;
  21. #if defined(_WIN64)
  22. #define blasabs(x) llabs(x)
  23. #else
  24. #define blasabs(x) labs(x)
  25. #endif
  26. #else
  27. typedef int blasint;
  28. #define blasabs(x) abs(x)
  29. #endif
  30. typedef blasint integer;
  31. typedef unsigned int uinteger;
  32. typedef char *address;
  33. typedef short int shortint;
  34. typedef float real;
  35. typedef double doublereal;
  36. typedef struct { real r, i; } complex;
  37. typedef struct { doublereal r, i; } doublecomplex;
  38. #ifdef _MSC_VER
  39. static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
  40. static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
  41. static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
  42. static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
  43. #else
  44. static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
  45. static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
  46. static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
  47. static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
  48. #endif
  49. #define pCf(z) (*_pCf(z))
  50. #define pCd(z) (*_pCd(z))
  51. typedef char integer1;
  52. #define TRUE_ (1)
  53. #define FALSE_ (0)
  54. /* Extern is for use with -E */
  55. #ifndef Extern
  56. #define Extern extern
  57. #endif
  58. /* I/O stuff */
  59. typedef int flag;
  60. typedef int ftnlen;
  61. typedef int ftnint;
  62. /*external read, write*/
  63. typedef struct
  64. { flag cierr;
  65. ftnint ciunit;
  66. flag ciend;
  67. char *cifmt;
  68. ftnint cirec;
  69. } cilist;
  70. /*internal read, write*/
  71. typedef struct
  72. { flag icierr;
  73. char *iciunit;
  74. flag iciend;
  75. char *icifmt;
  76. ftnint icirlen;
  77. ftnint icirnum;
  78. } icilist;
  79. /*open*/
  80. typedef struct
  81. { flag oerr;
  82. ftnint ounit;
  83. char *ofnm;
  84. ftnlen ofnmlen;
  85. char *osta;
  86. char *oacc;
  87. char *ofm;
  88. ftnint orl;
  89. char *oblnk;
  90. } olist;
  91. /*close*/
  92. typedef struct
  93. { flag cerr;
  94. ftnint cunit;
  95. char *csta;
  96. } cllist;
  97. /*rewind, backspace, endfile*/
  98. typedef struct
  99. { flag aerr;
  100. ftnint aunit;
  101. } alist;
  102. /* inquire */
  103. typedef struct
  104. { flag inerr;
  105. ftnint inunit;
  106. char *infile;
  107. ftnlen infilen;
  108. ftnint *inex; /*parameters in standard's order*/
  109. ftnint *inopen;
  110. ftnint *innum;
  111. ftnint *innamed;
  112. char *inname;
  113. ftnlen innamlen;
  114. char *inacc;
  115. ftnlen inacclen;
  116. char *inseq;
  117. ftnlen inseqlen;
  118. char *indir;
  119. ftnlen indirlen;
  120. char *infmt;
  121. ftnlen infmtlen;
  122. char *inform;
  123. ftnint informlen;
  124. char *inunf;
  125. ftnlen inunflen;
  126. ftnint *inrecl;
  127. ftnint *innrec;
  128. char *inblank;
  129. ftnlen inblanklen;
  130. } inlist;
  131. #define VOID void
  132. union Multitype { /* for multiple entry points */
  133. integer1 g;
  134. shortint h;
  135. integer i;
  136. /* longint j; */
  137. real r;
  138. doublereal d;
  139. complex c;
  140. doublecomplex z;
  141. };
  142. typedef union Multitype Multitype;
  143. struct Vardesc { /* for Namelist */
  144. char *name;
  145. char *addr;
  146. ftnlen *dims;
  147. int type;
  148. };
  149. typedef struct Vardesc Vardesc;
  150. struct Namelist {
  151. char *name;
  152. Vardesc **vars;
  153. int nvars;
  154. };
  155. typedef struct Namelist Namelist;
  156. #define abs(x) ((x) >= 0 ? (x) : -(x))
  157. #define dabs(x) (fabs(x))
  158. #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
  159. #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
  160. #define dmin(a,b) (f2cmin(a,b))
  161. #define dmax(a,b) (f2cmax(a,b))
  162. #define bit_test(a,b) ((a) >> (b) & 1)
  163. #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
  164. #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
  165. #define abort_() { sig_die("Fortran abort routine called", 1); }
  166. #define c_abs(z) (cabsf(Cf(z)))
  167. #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
  168. #ifdef _MSC_VER
  169. #define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);}
  170. #define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/df(b)._Val[1]);}
  171. #else
  172. #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
  173. #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
  174. #endif
  175. #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
  176. #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
  177. #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
  178. //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
  179. #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
  180. #define d_abs(x) (fabs(*(x)))
  181. #define d_acos(x) (acos(*(x)))
  182. #define d_asin(x) (asin(*(x)))
  183. #define d_atan(x) (atan(*(x)))
  184. #define d_atn2(x, y) (atan2(*(x),*(y)))
  185. #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
  186. #define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
  187. #define d_cos(x) (cos(*(x)))
  188. #define d_cosh(x) (cosh(*(x)))
  189. #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
  190. #define d_exp(x) (exp(*(x)))
  191. #define d_imag(z) (cimag(Cd(z)))
  192. #define r_imag(z) (cimagf(Cf(z)))
  193. #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  194. #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  195. #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  196. #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  197. #define d_log(x) (log(*(x)))
  198. #define d_mod(x, y) (fmod(*(x), *(y)))
  199. #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
  200. #define d_nint(x) u_nint(*(x))
  201. #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
  202. #define d_sign(a,b) u_sign(*(a),*(b))
  203. #define r_sign(a,b) u_sign(*(a),*(b))
  204. #define d_sin(x) (sin(*(x)))
  205. #define d_sinh(x) (sinh(*(x)))
  206. #define d_sqrt(x) (sqrt(*(x)))
  207. #define d_tan(x) (tan(*(x)))
  208. #define d_tanh(x) (tanh(*(x)))
  209. #define i_abs(x) abs(*(x))
  210. #define i_dnnt(x) ((integer)u_nint(*(x)))
  211. #define i_len(s, n) (n)
  212. #define i_nint(x) ((integer)u_nint(*(x)))
  213. #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
  214. #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
  215. #define pow_si(B,E) spow_ui(*(B),*(E))
  216. #define pow_ri(B,E) spow_ui(*(B),*(E))
  217. #define pow_di(B,E) dpow_ui(*(B),*(E))
  218. #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
  219. #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
  220. #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
  221. #define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; }
  222. #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
  223. #define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
  224. #define sig_die(s, kill) { exit(1); }
  225. #define s_stop(s, n) {exit(0);}
  226. #define z_abs(z) (cabs(Cd(z)))
  227. #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
  228. #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
  229. #define myexit_() break;
  230. #define mycycle() continue;
  231. #define myceiling(w) {ceil(w)}
  232. #define myhuge(w) {HUGE_VAL}
  233. //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
  234. #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
  235. /* procedure parameter types for -A and -C++ */
  236. /* Table of constant values */
  237. static integer c__1 = 1;
  238. static integer c__4 = 4;
  239. static integer c__12 = 12;
  240. static integer c__8 = 8;
  241. static integer c__40 = 40;
  242. static integer c__2 = 2;
  243. static integer c__3 = 3;
  244. static integer c__60 = 60;
  245. /* > \brief \b DLATM6 */
  246. /* =========== DOCUMENTATION =========== */
  247. /* Online html documentation available at */
  248. /* http://www.netlib.org/lapack/explore-html/ */
  249. /* Definition: */
  250. /* =========== */
  251. /* SUBROUTINE DLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA, */
  252. /* BETA, WX, WY, S, DIF ) */
  253. /* INTEGER LDA, LDX, LDY, N, TYPE */
  254. /* DOUBLE PRECISION ALPHA, BETA, WX, WY */
  255. /* DOUBLE PRECISION A( LDA, * ), B( LDA, * ), DIF( * ), S( * ), */
  256. /* $ X( LDX, * ), Y( LDY, * ) */
  257. /* > \par Purpose: */
  258. /* ============= */
  259. /* > */
  260. /* > \verbatim */
  261. /* > */
  262. /* > DLATM6 generates test matrices for the generalized eigenvalue */
  263. /* > problem, their corresponding right and left eigenvector matrices, */
  264. /* > and also reciprocal condition numbers for all eigenvalues and */
  265. /* > the reciprocal condition numbers of eigenvectors corresponding to */
  266. /* > the 1th and 5th eigenvalues. */
  267. /* > */
  268. /* > Test Matrices */
  269. /* > ============= */
  270. /* > */
  271. /* > Two kinds of test matrix pairs */
  272. /* > */
  273. /* > (A, B) = inverse(YH) * (Da, Db) * inverse(X) */
  274. /* > */
  275. /* > are used in the tests: */
  276. /* > */
  277. /* > Type 1: */
  278. /* > Da = 1+a 0 0 0 0 Db = 1 0 0 0 0 */
  279. /* > 0 2+a 0 0 0 0 1 0 0 0 */
  280. /* > 0 0 3+a 0 0 0 0 1 0 0 */
  281. /* > 0 0 0 4+a 0 0 0 0 1 0 */
  282. /* > 0 0 0 0 5+a , 0 0 0 0 1 , and */
  283. /* > */
  284. /* > Type 2: */
  285. /* > Da = 1 -1 0 0 0 Db = 1 0 0 0 0 */
  286. /* > 1 1 0 0 0 0 1 0 0 0 */
  287. /* > 0 0 1 0 0 0 0 1 0 0 */
  288. /* > 0 0 0 1+a 1+b 0 0 0 1 0 */
  289. /* > 0 0 0 -1-b 1+a , 0 0 0 0 1 . */
  290. /* > */
  291. /* > In both cases the same inverse(YH) and inverse(X) are used to compute */
  292. /* > (A, B), giving the exact eigenvectors to (A,B) as (YH, X): */
  293. /* > */
  294. /* > YH: = 1 0 -y y -y X = 1 0 -x -x x */
  295. /* > 0 1 -y y -y 0 1 x -x -x */
  296. /* > 0 0 1 0 0 0 0 1 0 0 */
  297. /* > 0 0 0 1 0 0 0 0 1 0 */
  298. /* > 0 0 0 0 1, 0 0 0 0 1 , */
  299. /* > */
  300. /* > where a, b, x and y will have all values independently of each other. */
  301. /* > \endverbatim */
  302. /* Arguments: */
  303. /* ========== */
  304. /* > \param[in] TYPE */
  305. /* > \verbatim */
  306. /* > TYPE is INTEGER */
  307. /* > Specifies the problem type (see further details). */
  308. /* > \endverbatim */
  309. /* > */
  310. /* > \param[in] N */
  311. /* > \verbatim */
  312. /* > N is INTEGER */
  313. /* > Size of the matrices A and B. */
  314. /* > \endverbatim */
  315. /* > */
  316. /* > \param[out] A */
  317. /* > \verbatim */
  318. /* > A is DOUBLE PRECISION array, dimension (LDA, N). */
  319. /* > On exit A N-by-N is initialized according to TYPE. */
  320. /* > \endverbatim */
  321. /* > */
  322. /* > \param[in] LDA */
  323. /* > \verbatim */
  324. /* > LDA is INTEGER */
  325. /* > The leading dimension of A and of B. */
  326. /* > \endverbatim */
  327. /* > */
  328. /* > \param[out] B */
  329. /* > \verbatim */
  330. /* > B is DOUBLE PRECISION array, dimension (LDA, N). */
  331. /* > On exit B N-by-N is initialized according to TYPE. */
  332. /* > \endverbatim */
  333. /* > */
  334. /* > \param[out] X */
  335. /* > \verbatim */
  336. /* > X is DOUBLE PRECISION array, dimension (LDX, N). */
  337. /* > On exit X is the N-by-N matrix of right eigenvectors. */
  338. /* > \endverbatim */
  339. /* > */
  340. /* > \param[in] LDX */
  341. /* > \verbatim */
  342. /* > LDX is INTEGER */
  343. /* > The leading dimension of X. */
  344. /* > \endverbatim */
  345. /* > */
  346. /* > \param[out] Y */
  347. /* > \verbatim */
  348. /* > Y is DOUBLE PRECISION array, dimension (LDY, N). */
  349. /* > On exit Y is the N-by-N matrix of left eigenvectors. */
  350. /* > \endverbatim */
  351. /* > */
  352. /* > \param[in] LDY */
  353. /* > \verbatim */
  354. /* > LDY is INTEGER */
  355. /* > The leading dimension of Y. */
  356. /* > \endverbatim */
  357. /* > */
  358. /* > \param[in] ALPHA */
  359. /* > \verbatim */
  360. /* > ALPHA is DOUBLE PRECISION */
  361. /* > \endverbatim */
  362. /* > */
  363. /* > \param[in] BETA */
  364. /* > \verbatim */
  365. /* > BETA is DOUBLE PRECISION */
  366. /* > */
  367. /* > Weighting constants for matrix A. */
  368. /* > \endverbatim */
  369. /* > */
  370. /* > \param[in] WX */
  371. /* > \verbatim */
  372. /* > WX is DOUBLE PRECISION */
  373. /* > Constant for right eigenvector matrix. */
  374. /* > \endverbatim */
  375. /* > */
  376. /* > \param[in] WY */
  377. /* > \verbatim */
  378. /* > WY is DOUBLE PRECISION */
  379. /* > Constant for left eigenvector matrix. */
  380. /* > \endverbatim */
  381. /* > */
  382. /* > \param[out] S */
  383. /* > \verbatim */
  384. /* > S is DOUBLE PRECISION array, dimension (N) */
  385. /* > S(i) is the reciprocal condition number for eigenvalue i. */
  386. /* > \endverbatim */
  387. /* > */
  388. /* > \param[out] DIF */
  389. /* > \verbatim */
  390. /* > DIF is DOUBLE PRECISION array, dimension (N) */
  391. /* > DIF(i) is the reciprocal condition number for eigenvector i. */
  392. /* > \endverbatim */
  393. /* Authors: */
  394. /* ======== */
  395. /* > \author Univ. of Tennessee */
  396. /* > \author Univ. of California Berkeley */
  397. /* > \author Univ. of Colorado Denver */
  398. /* > \author NAG Ltd. */
  399. /* > \date December 2016 */
  400. /* > \ingroup double_matgen */
  401. /* ===================================================================== */
  402. /* Subroutine */ void dlatm6_(integer *type__, integer *n, doublereal *a,
  403. integer *lda, doublereal *b, doublereal *x, integer *ldx, doublereal *
  404. y, integer *ldy, doublereal *alpha, doublereal *beta, doublereal *wx,
  405. doublereal *wy, doublereal *s, doublereal *dif)
  406. {
  407. /* System generated locals */
  408. integer a_dim1, a_offset, b_dim1, b_offset, x_dim1, x_offset, y_dim1,
  409. y_offset, i__1, i__2;
  410. /* Local variables */
  411. integer info;
  412. doublereal work[100];
  413. integer i__, j;
  414. doublereal z__[144] /* was [12][12] */;
  415. extern /* Subroutine */ void dlakf2_(integer *, integer *, doublereal *,
  416. integer *, doublereal *, doublereal *, doublereal *, doublereal *,
  417. integer *), dgesvd_(char *, char *, integer *, integer *,
  418. doublereal *, integer *, doublereal *, doublereal *, integer *,
  419. doublereal *, integer *, doublereal *, integer *, integer *), dlacpy_(char *, integer *, integer *, doublereal
  420. *, integer *, doublereal *, integer *);
  421. /* -- LAPACK computational routine (version 3.7.0) -- */
  422. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  423. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  424. /* December 2016 */
  425. /* ===================================================================== */
  426. /* Generate test problem ... */
  427. /* (Da, Db) ... */
  428. /* Parameter adjustments */
  429. b_dim1 = *lda;
  430. b_offset = 1 + b_dim1 * 1;
  431. b -= b_offset;
  432. a_dim1 = *lda;
  433. a_offset = 1 + a_dim1 * 1;
  434. a -= a_offset;
  435. x_dim1 = *ldx;
  436. x_offset = 1 + x_dim1 * 1;
  437. x -= x_offset;
  438. y_dim1 = *ldy;
  439. y_offset = 1 + y_dim1 * 1;
  440. y -= y_offset;
  441. --s;
  442. --dif;
  443. /* Function Body */
  444. i__1 = *n;
  445. for (i__ = 1; i__ <= i__1; ++i__) {
  446. i__2 = *n;
  447. for (j = 1; j <= i__2; ++j) {
  448. if (i__ == j) {
  449. a[i__ + i__ * a_dim1] = (doublereal) i__ + *alpha;
  450. b[i__ + i__ * b_dim1] = 1.;
  451. } else {
  452. a[i__ + j * a_dim1] = 0.;
  453. b[i__ + j * b_dim1] = 0.;
  454. }
  455. /* L10: */
  456. }
  457. /* L20: */
  458. }
  459. /* Form X and Y */
  460. dlacpy_("F", n, n, &b[b_offset], lda, &y[y_offset], ldy);
  461. y[y_dim1 + 3] = -(*wy);
  462. y[y_dim1 + 4] = *wy;
  463. y[y_dim1 + 5] = -(*wy);
  464. y[(y_dim1 << 1) + 3] = -(*wy);
  465. y[(y_dim1 << 1) + 4] = *wy;
  466. y[(y_dim1 << 1) + 5] = -(*wy);
  467. dlacpy_("F", n, n, &b[b_offset], lda, &x[x_offset], ldx);
  468. x[x_dim1 * 3 + 1] = -(*wx);
  469. x[(x_dim1 << 2) + 1] = -(*wx);
  470. x[x_dim1 * 5 + 1] = *wx;
  471. x[x_dim1 * 3 + 2] = *wx;
  472. x[(x_dim1 << 2) + 2] = -(*wx);
  473. x[x_dim1 * 5 + 2] = -(*wx);
  474. /* Form (A, B) */
  475. b[b_dim1 * 3 + 1] = *wx + *wy;
  476. b[b_dim1 * 3 + 2] = -(*wx) + *wy;
  477. b[(b_dim1 << 2) + 1] = *wx - *wy;
  478. b[(b_dim1 << 2) + 2] = *wx - *wy;
  479. b[b_dim1 * 5 + 1] = -(*wx) + *wy;
  480. b[b_dim1 * 5 + 2] = *wx + *wy;
  481. if (*type__ == 1) {
  482. a[a_dim1 * 3 + 1] = *wx * a[a_dim1 + 1] + *wy * a[a_dim1 * 3 + 3];
  483. a[a_dim1 * 3 + 2] = -(*wx) * a[(a_dim1 << 1) + 2] + *wy * a[a_dim1 *
  484. 3 + 3];
  485. a[(a_dim1 << 2) + 1] = *wx * a[a_dim1 + 1] - *wy * a[(a_dim1 << 2) +
  486. 4];
  487. a[(a_dim1 << 2) + 2] = *wx * a[(a_dim1 << 1) + 2] - *wy * a[(a_dim1 <<
  488. 2) + 4];
  489. a[a_dim1 * 5 + 1] = -(*wx) * a[a_dim1 + 1] + *wy * a[a_dim1 * 5 + 5];
  490. a[a_dim1 * 5 + 2] = *wx * a[(a_dim1 << 1) + 2] + *wy * a[a_dim1 * 5 +
  491. 5];
  492. } else if (*type__ == 2) {
  493. a[a_dim1 * 3 + 1] = *wx * 2. + *wy;
  494. a[a_dim1 * 3 + 2] = *wy;
  495. a[(a_dim1 << 2) + 1] = -(*wy) * (*alpha + 2. + *beta);
  496. a[(a_dim1 << 2) + 2] = *wx * 2. - *wy * (*alpha + 2. + *beta);
  497. a[a_dim1 * 5 + 1] = *wx * -2. + *wy * (*alpha - *beta);
  498. a[a_dim1 * 5 + 2] = *wy * (*alpha - *beta);
  499. a[a_dim1 + 1] = 1.;
  500. a[(a_dim1 << 1) + 1] = -1.;
  501. a[a_dim1 + 2] = 1.;
  502. a[(a_dim1 << 1) + 2] = a[a_dim1 + 1];
  503. a[a_dim1 * 3 + 3] = 1.;
  504. a[(a_dim1 << 2) + 4] = *alpha + 1.;
  505. a[a_dim1 * 5 + 4] = *beta + 1.;
  506. a[(a_dim1 << 2) + 5] = -a[a_dim1 * 5 + 4];
  507. a[a_dim1 * 5 + 5] = a[(a_dim1 << 2) + 4];
  508. }
  509. /* Compute condition numbers */
  510. if (*type__ == 1) {
  511. s[1] = 1. / sqrt((*wy * 3. * *wy + 1.) / (a[a_dim1 + 1] * a[a_dim1 +
  512. 1] + 1.));
  513. s[2] = 1. / sqrt((*wy * 3. * *wy + 1.) / (a[(a_dim1 << 1) + 2] * a[(
  514. a_dim1 << 1) + 2] + 1.));
  515. s[3] = 1. / sqrt((*wx * 2. * *wx + 1.) / (a[a_dim1 * 3 + 3] * a[
  516. a_dim1 * 3 + 3] + 1.));
  517. s[4] = 1. / sqrt((*wx * 2. * *wx + 1.) / (a[(a_dim1 << 2) + 4] * a[(
  518. a_dim1 << 2) + 4] + 1.));
  519. s[5] = 1. / sqrt((*wx * 2. * *wx + 1.) / (a[a_dim1 * 5 + 5] * a[
  520. a_dim1 * 5 + 5] + 1.));
  521. dlakf2_(&c__1, &c__4, &a[a_offset], lda, &a[(a_dim1 << 1) + 2], &b[
  522. b_offset], &b[(b_dim1 << 1) + 2], z__, &c__12);
  523. dgesvd_("N", "N", &c__8, &c__8, z__, &c__12, work, &work[8], &c__1, &
  524. work[9], &c__1, &work[10], &c__40, &info);
  525. dif[1] = work[7];
  526. dlakf2_(&c__4, &c__1, &a[a_offset], lda, &a[a_dim1 * 5 + 5], &b[
  527. b_offset], &b[b_dim1 * 5 + 5], z__, &c__12);
  528. dgesvd_("N", "N", &c__8, &c__8, z__, &c__12, work, &work[8], &c__1, &
  529. work[9], &c__1, &work[10], &c__40, &info);
  530. dif[5] = work[7];
  531. } else if (*type__ == 2) {
  532. s[1] = 1. / sqrt(*wy * *wy + .33333333333333331);
  533. s[2] = s[1];
  534. s[3] = 1. / sqrt(*wx * *wx + .5);
  535. s[4] = 1. / sqrt((*wx * 2. * *wx + 1.) / ((*alpha + 1.) * (*alpha +
  536. 1.) + 1. + (*beta + 1.) * (*beta + 1.)));
  537. s[5] = s[4];
  538. dlakf2_(&c__2, &c__3, &a[a_offset], lda, &a[a_dim1 * 3 + 3], &b[
  539. b_offset], &b[b_dim1 * 3 + 3], z__, &c__12);
  540. dgesvd_("N", "N", &c__12, &c__12, z__, &c__12, work, &work[12], &c__1,
  541. &work[13], &c__1, &work[14], &c__60, &info);
  542. dif[1] = work[11];
  543. dlakf2_(&c__3, &c__2, &a[a_offset], lda, &a[(a_dim1 << 2) + 4], &b[
  544. b_offset], &b[(b_dim1 << 2) + 4], z__, &c__12);
  545. dgesvd_("N", "N", &c__12, &c__12, z__, &c__12, work, &work[12], &c__1,
  546. &work[13], &c__1, &work[14], &c__60, &info);
  547. dif[5] = work[11];
  548. }
  549. return;
  550. /* End of DLATM6 */
  551. } /* dlatm6_ */