Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/lapack/complex16/ztgsen.c

raw symbols SCIP
1 /* lapack/complex16/ztgsen.f -- translated by f2c (version 20090411).
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 /* Table of constant values */
19
20 static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! c__1cxx . . $ c__1. = 1;
21
22 /*< >*/
23 /* Subroutine */ int ztgsen_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:370:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ijob, logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! *wantq, logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! *wantz,
24 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! *select, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *n, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *a, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *lda,
25 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *b, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldb, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *alpha, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *
26 beta, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *q, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldq, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *z__, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *
27 ldz, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *m, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *pl, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *pr, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *dif,
28 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *work, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *lwork, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *iwork, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *liwork,
29 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *info)
30 {
31 /* System generated locals */
32 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! a_dim1, a_offset, b_dim1, b_offset, q_dim1, q_offset, z_dim1,
33 z_offset, i__1, i__2, i__3;
34 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! z__1, z__2;
35
36 /* Builtin functions */
37 double sqrtcxx . . $ sqrt(447c67c6676f75c3).(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!), z_abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:28:9`!(doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *);
38 void d_cnjgcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:11:9`!(doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *);
39
40 /* Local variables */
41 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__, k, n1, n2, ks, mn2, ijb, kase, ierr;
42 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! dsum;
43 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! swap;
44 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! temp1, temp2;
45 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! isave[3];
46 extern /* Subroutine */ int zscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:339:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *,
47 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *);
48 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! wantd;
49 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! lwmin;
50 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! wantp;
51 extern /* Subroutine */ int zlacn2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:352:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *,
52 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *);
53 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! wantd1, wantd2;
54 extern doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!(char *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
55 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! dscale, rdscal, safmin;
56 extern /* Subroutine */ int xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
57 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! liwmin;
58 extern /* Subroutine */ int zlacpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:322:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
59 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!),
60 ztgexc_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:354:9`!(logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! *, logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`!
61 *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
62 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *),
63 zlassq_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:335:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *,
64 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *);
65 logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! lquery;
66 extern /* Subroutine */ int ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`!
67 *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
68 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
69 doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
70 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, doublecomplexcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:56:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
71 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
72
73
74 /* -- LAPACK routine (version 3.2.2) -- */
75 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
76 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
77 /* January 2007 */
78
79 /* Modified to call ZLACN2 in place of ZLACON, 10 Feb 03, SJH. */
80
81 /* .. Scalar Arguments .. */
82 /*< LOGICAL WANTQ, WANTZ >*/
83 /*< >*/
84 /*< DOUBLE PRECISION PL, PR >*/
85 /* .. */
86 /* .. Array Arguments .. */
87 /*< LOGICAL SELECT( * ) >*/
88 /*< INTEGER IWORK( * ) >*/
89 /*< DOUBLE PRECISION DIF( * ) >*/
90 /*< >*/
91 /* .. */
92
93 /* Purpose */
94 /* ======= */
95
96 /* ZTGSEN reorders the generalized Schur decomposition of a complex */
97 /* matrix pair (A, B) (in terms of an unitary equivalence trans- */
98 /* formation Q' * (A, B) * Z), so that a selected cluster of eigenvalues */
99 /* appears in the leading diagonal blocks of the pair (A,B). The leading */
100 /* columns of Q and Z form unitary bases of the corresponding left and */
101 /* right eigenspaces (deflating subspaces). (A, B) must be in */
102 /* generalized Schur canonical form, that is, A and B are both upper */
103 /* triangular. */
104
105 /* ZTGSEN also computes the generalized eigenvalues */
106
107 /* w(j)= ALPHA(j) / BETA(j) */
108
109 /* of the reordered matrix pair (A, B). */
110
111 /* Optionally, the routine computes estimates of reciprocal condition */
112 /* numbers for eigenvalues and eigenspaces. These are Difu[(A11,B11), */
113 /* (A22,B22)] and Difl[(A11,B11), (A22,B22)], i.e. the separation(s) */
114 /* between the matrix pairs (A11, B11) and (A22,B22) that correspond to */
115 /* the selected cluster and the eigenvalues outside the cluster, resp., */
116 /* and norms of "projections" onto left and right eigenspaces w.r.t. */
117 /* the selected cluster in the (1,1)-block. */
118
119
120 /* Arguments */
121 /* ========= */
122
123 /* IJOB (input) integer */
124 /* Specifies whether condition numbers are required for the */
125 /* cluster of eigenvalues (PL and PR) or the deflating subspaces */
126 /* (Difu and Difl): */
127 /* =0: Only reorder w.r.t. SELECT. No extras. */
128 /* =1: Reciprocal of norms of "projections" onto left and right */
129 /* eigenspaces w.r.t. the selected cluster (PL and PR). */
130 /* =2: Upper bounds on Difu and Difl. F-norm-based estimate */
131 /* (DIF(1:2)). */
132 /* =3: Estimate of Difu and Difl. 1-norm-based estimate */
133 /* (DIF(1:2)). */
134 /* About 5 times as expensive as IJOB = 2. */
135 /* =4: Compute PL, PR and DIF (i.e. 0, 1 and 2 above): Economic */
136 /* version to get it all. */
137 /* =5: Compute PL, PR and DIF (i.e. 0, 1 and 3 above) */
138
139 /* WANTQ (input) LOGICAL */
140 /* .TRUE. : update the left transformation matrix Q; */
141 /* .FALSE.: do not update Q. */
142
143 /* WANTZ (input) LOGICAL */
144 /* .TRUE. : update the right transformation matrix Z; */
145 /* .FALSE.: do not update Z. */
146
147 /* SELECT (input) LOGICAL array, dimension (N) */
148 /* SELECT specifies the eigenvalues in the selected cluster. To */
149 /* select an eigenvalue w(j), SELECT(j) must be set to */
150 /* .TRUE.. */
151
152 /* N (input) INTEGER */
153 /* The order of the matrices A and B. N >= 0. */
154
155 /* A (input/output) COMPLEX*16 array, dimension(LDA,N) */
156 /* On entry, the upper triangular matrix A, in generalized */
157 /* Schur canonical form. */
158 /* On exit, A is overwritten by the reordered matrix A. */
159
160 /* LDA (input) INTEGER */
161 /* The leading dimension of the array A. LDA >= max(1,N). */
162
163 /* B (input/output) COMPLEX*16 array, dimension(LDB,N) */
164 /* On entry, the upper triangular matrix B, in generalized */
165 /* Schur canonical form. */
166 /* On exit, B is overwritten by the reordered matrix B. */
167
168 /* LDB (input) INTEGER */
169 /* The leading dimension of the array B. LDB >= max(1,N). */
170
171 /* ALPHA (output) COMPLEX*16 array, dimension (N) */
172 /* BETA (output) COMPLEX*16 array, dimension (N) */
173 /* The diagonal elements of A and B, respectively, */
174 /* when the pair (A,B) has been reduced to generalized Schur */
175 /* form. ALPHA(i)/BETA(i) i=1,...,N are the generalized */
176 /* eigenvalues. */
177
178 /* Q (input/output) COMPLEX*16 array, dimension (LDQ,N) */
179 /* On entry, if WANTQ = .TRUE., Q is an N-by-N matrix. */
180 /* On exit, Q has been postmultiplied by the left unitary */
181 /* transformation matrix which reorder (A, B); The leading M */
182 /* columns of Q form orthonormal bases for the specified pair of */
183 /* left eigenspaces (deflating subspaces). */
184 /* If WANTQ = .FALSE., Q is not referenced. */
185
186 /* LDQ (input) INTEGER */
187 /* The leading dimension of the array Q. LDQ >= 1. */
188 /* If WANTQ = .TRUE., LDQ >= N. */
189
190 /* Z (input/output) COMPLEX*16 array, dimension (LDZ,N) */
191 /* On entry, if WANTZ = .TRUE., Z is an N-by-N matrix. */
192 /* On exit, Z has been postmultiplied by the left unitary */
193 /* transformation matrix which reorder (A, B); The leading M */
194 /* columns of Z form orthonormal bases for the specified pair of */
195 /* left eigenspaces (deflating subspaces). */
196 /* If WANTZ = .FALSE., Z is not referenced. */
197
198 /* LDZ (input) INTEGER */
199 /* The leading dimension of the array Z. LDZ >= 1. */
200 /* If WANTZ = .TRUE., LDZ >= N. */
201
202 /* M (output) INTEGER */
203 /* The dimension of the specified pair of left and right */
204 /* eigenspaces, (deflating subspaces) 0 <= M <= N. */
205
206 /* PL (output) DOUBLE PRECISION */
207 /* PR (output) DOUBLE PRECISION */
208 /* If IJOB = 1, 4 or 5, PL, PR are lower bounds on the */
209 /* reciprocal of the norm of "projections" onto left and right */
210 /* eigenspace with respect to the selected cluster. */
211 /* 0 < PL, PR <= 1. */
212 /* If M = 0 or M = N, PL = PR = 1. */
213 /* If IJOB = 0, 2 or 3 PL, PR are not referenced. */
214
215 /* DIF (output) DOUBLE PRECISION array, dimension (2). */
216 /* If IJOB >= 2, DIF(1:2) store the estimates of Difu and Difl. */
217 /* If IJOB = 2 or 4, DIF(1:2) are F-norm-based upper bounds on */
218 /* Difu and Difl. If IJOB = 3 or 5, DIF(1:2) are 1-norm-based */
219 /* estimates of Difu and Difl, computed using reversed */
220 /* communication with ZLACN2. */
221 /* If M = 0 or N, DIF(1:2) = F-norm([A, B]). */
222 /* If IJOB = 0 or 1, DIF is not referenced. */
223
224 /* WORK (workspace/output) COMPLEX*16 array, dimension (MAX(1,LWORK)) */
225 /* On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */
226
227 /* LWORK (input) INTEGER */
228 /* The dimension of the array WORK. LWORK >= 1 */
229 /* If IJOB = 1, 2 or 4, LWORK >= 2*M*(N-M) */
230 /* If IJOB = 3 or 5, LWORK >= 4*M*(N-M) */
231
232 /* If LWORK = -1, then a workspace query is assumed; the routine */
233 /* only calculates the optimal size of the WORK array, returns */
234 /* this value as the first entry of the WORK array, and no error */
235 /* message related to LWORK is issued by XERBLA. */
236
237 /* IWORK (workspace/output) INTEGER array, dimension (MAX(1,LIWORK)) */
238 /* On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK. */
239
240 /* LIWORK (input) INTEGER */
241 /* The dimension of the array IWORK. LIWORK >= 1. */
242 /* If IJOB = 1, 2 or 4, LIWORK >= N+2; */
243 /* If IJOB = 3 or 5, LIWORK >= MAX(N+2, 2*M*(N-M)); */
244
245 /* If LIWORK = -1, then a workspace query is assumed; the */
246 /* routine only calculates the optimal size of the IWORK array, */
247 /* returns this value as the first entry of the IWORK array, and */
248 /* no error message related to LIWORK is issued by XERBLA. */
249
250 /* INFO (output) INTEGER */
251 /* =0: Successful exit. */
252 /* <0: If INFO = -i, the i-th argument had an illegal value. */
253 /* =1: Reordering of (A, B) failed because the transformed */
254 /* matrix pair (A, B) would be too far from generalized */
255 /* Schur form; the problem is very ill-conditioned. */
256 /* (A, B) may have been partially reordered. */
257 /* If requested, 0 is returned in DIF(*), PL and PR. */
258
259
260 /* Further Details */
261 /* =============== */
262
263 /* ZTGSEN first collects the selected eigenvalues by computing unitary */
264 /* U and W that move them to the top left corner of (A, B). In other */
265 /* words, the selected eigenvalues are the eigenvalues of (A11, B11) in */
266
267 /* U'*(A, B)*W = (A11 A12) (B11 B12) n1 */
268 /* ( 0 A22),( 0 B22) n2 */
269 /* n1 n2 n1 n2 */
270
271 /* where N = n1+n2 and U' means the conjugate transpose of U. The first */
272 /* n1 columns of U and W span the specified pair of left and right */
273 /* eigenspaces (deflating subspaces) of (A, B). */
274
275 /* If (A, B) has been obtained from the generalized real Schur */
276 /* decomposition of a matrix pair (C, D) = Q*(A, B)*Z', then the */
277 /* reordered generalized Schur form of (C, D) is given by */
278
279 /* (C, D) = (Q*U)*(U'*(A, B)*W)*(Z*W)', */
280
281 /* and the first n1 columns of Q*U and Z*W span the corresponding */
282 /* deflating subspaces of (C, D) (Q and Z store Q*U and Z*W, resp.). */
283
284 /* Note that if the selected eigenvalue is sufficiently ill-conditioned, */
285 /* then its value may differ significantly from its value before */
286 /* reordering. */
287
288 /* The reciprocal condition numbers of the left and right eigenspaces */
289 /* spanned by the first n1 columns of U and W (or Q*U and Z*W) may */
290 /* be returned in DIF(1:2), corresponding to Difu and Difl, resp. */
291
292 /* The Difu and Difl are defined as: */
293
294 /* Difu[(A11, B11), (A22, B22)] = sigma-min( Zu ) */
295 /* and */
296 /* Difl[(A11, B11), (A22, B22)] = Difu[(A22, B22), (A11, B11)], */
297
298 /* where sigma-min(Zu) is the smallest singular value of the */
299 /* (2*n1*n2)-by-(2*n1*n2) matrix */
300
301 /* Zu = [ kron(In2, A11) -kron(A22', In1) ] */
302 /* [ kron(In2, B11) -kron(B22', In1) ]. */
303
304 /* Here, Inx is the identity matrix of size nx and A22' is the */
305 /* transpose of A22. kron(X, Y) is the Kronecker product between */
306 /* the matrices X and Y. */
307
308 /* When DIF(2) is small, small changes in (A, B) can cause large changes */
309 /* in the deflating subspace. An approximate (asymptotic) bound on the */
310 /* maximum angular error in the computed deflating subspaces is */
311
312 /* EPS * norm((A, B)) / DIF(2), */
313
314 /* where EPS is the machine precision. */
315
316 /* The reciprocal norm of the projectors on the left and right */
317 /* eigenspaces associated with (A11, B11) may be returned in PL and PR. */
318 /* They are computed as follows. First we compute L and R so that */
319 /* P*(A, B)*Q is block diagonal, where */
320
321 /* P = ( I -L ) n1 Q = ( I R ) n1 */
322 /* ( 0 I ) n2 and ( 0 I ) n2 */
323 /* n1 n2 n1 n2 */
324
325 /* and (L, R) is the solution to the generalized Sylvester equation */
326
327 /* A11*R - L*A22 = -A12 */
328 /* B11*R - L*B22 = -B12 */
329
330 /* Then PL = (F-norm(L)**2+1)**(-1/2) and PR = (F-norm(R)**2+1)**(-1/2). */
331 /* An approximate (asymptotic) bound on the average absolute error of */
332 /* the selected eigenvalues is */
333
334 /* EPS * norm((A, B)) / PL. */
335
336 /* There are also global error bounds which valid for perturbations up */
337 /* to a certain restriction: A lower bound (x) on the smallest */
338 /* F-norm(E,F) for which an eigenvalue of (A11, B11) may move and */
339 /* coalesce with an eigenvalue of (A22, B22) under perturbation (E,F), */
340 /* (i.e. (A + E, B + F), is */
341
342 /* x = min(Difu,Difl)/((1/(PL*PL)+1/(PR*PR))**(1/2)+2*max(1/PL,1/PR)). */
343
344 /* An approximate bound on x can be computed from DIF(1:2), PL and PR. */
345
346 /* If y = ( F-norm(E,F) / x) <= 1, the angles between the perturbed */
347 /* (L', R') and unperturbed (L, R) left and right deflating subspaces */
348 /* associated with the selected cluster in the (1,1)-blocks can be */
349 /* bounded as */
350
351 /* max-angle(L, L') <= arctan( y * PL / (1 - y * (1 - PL * PL)**(1/2)) */
352 /* max-angle(R, R') <= arctan( y * PR / (1 - y * (1 - PR * PR)**(1/2)) */
353
354 /* See LAPACK User's Guide section 4.11 or the following references */
355 /* for more information. */
356
357 /* Note that if the default method for computing the Frobenius-norm- */
358 /* based estimate DIF is not wanted (see ZLATDF), then the parameter */
359 /* IDIFJB (see below) should be changed from 3 to 4 (routine ZLATDF */
360 /* (IJOB = 2 will be used)). See ZTGSYL for more details. */
361
362 /* Based on contributions by */
363 /* Bo Kagstrom and Peter Poromaa, Department of Computing Science, */
364 /* Umea University, S-901 87 Umea, Sweden. */
365
366 /* References */
367 /* ========== */
368
369 /* [1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the */
370 /* Generalized Real Schur Form of a Regular Matrix Pair (A, B), in */
371 /* M.S. Moonen et al (eds), Linear Algebra for Large Scale and */
372 /* Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218. */
373
374 /* [2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified */
375 /* Eigenvalues of a Regular Matrix Pair (A, B) and Condition */
376 /* Estimation: Theory, Algorithms and Software, Report */
377 /* UMINF - 94.04, Department of Computing Science, Umea University, */
378 /* S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. */
379 /* To appear in Numerical Algorithms, 1996. */
380
381 /* [3] B. Kagstrom and P. Poromaa, LAPACK-Style Algorithms and Software */
382 /* for Solving the Generalized Sylvester Equation and Estimating the */
383 /* Separation between Regular Matrix Pairs, Report UMINF - 93.23, */
384 /* Department of Computing Science, Umea University, S-901 87 Umea, */
385 /* Sweden, December 1993, Revised April 1994, Also as LAPACK working */
386 /* Note 75. To appear in ACM Trans. on Math. Software, Vol 22, No 1, */
387 /* 1996. */
388
389 /* ===================================================================== */
390
391 /* .. Parameters .. */
392 /*< INTEGER IDIFJB >*/
393 /*< PARAMETER ( IDIFJB = 3 ) >*/
394 /*< DOUBLE PRECISION ZERO, ONE >*/
395 /*< PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 ) >*/
396 /* .. */
397 /* .. Local Scalars .. */
398 /*< LOGICAL LQUERY, SWAP, WANTD, WANTD1, WANTD2, WANTP >*/
399 /*< >*/
400 /*< DOUBLE PRECISION DSCALE, DSUM, RDSCAL, SAFMIN >*/
401 /*< COMPLEX*16 TEMP1, TEMP2 >*/
402 /* .. */
403 /* .. Local Arrays .. */
404 /*< INTEGER ISAVE( 3 ) >*/
405 /* .. */
406 /* .. External Subroutines .. */
407 /*< >*/
408 /* .. */
409 /* .. Intrinsic Functions .. */
410 /*< INTRINSIC ABS, DCMPLX, DCONJG, MAX, SQRT >*/
411 /* .. */
412 /* .. External Functions .. */
413 /*< DOUBLE PRECISION DLAMCH >*/
414 /*< EXTERNAL DLAMCH >*/
415 /* .. */
416 /* .. Executable Statements .. */
417
418 /* Decode and test the input parameters */
419
420 /*< INFO = 0 >*/
421 /* Parameter adjustments */
422 --select;
423 a_dim1 = *lda;
424 a_offset = 1 + a_dim1;
425 a -= a_offset;
426 b_dim1 = *ldb;
427 b_offset = 1 + b_dim1;
428 b -= b_offset;
429 --alpha;
430 --beta;
431 q_dim1 = *ldq;
432 q_offset = 1 + q_dim1;
433 q -= q_offset;
434 z_dim1 = *ldz;
435 z_offset = 1 + z_dim1;
436 z__ -= z_offset;
437 --dif;
438 --work;
439 --iwork;
440
441 /* Function Body */
442 *info = 0;
443 /*< LQUERY = ( LWORK.EQ.-1 .OR. LIWORK.EQ.-1 ) >*/
444 lquery = *lwork == -1 || *liwork == -1;
445
446 /*< IF( IJOB.LT.0 .OR. IJOB.GT.5 ) THEN >*/
447 if (*ijob < 0 || *ijob > 5) {
448 /*< INFO = -1 >*/
449 *info = -1;
450 /*< ELSE IF( N.LT.0 ) THEN >*/
451 } else if (*n < 0) {
452 /*< INFO = -5 >*/
453 *info = -5;
454 /*< ELSE IF( LDA.LT.MAX( 1, N ) ) THEN >*/
455 } else if (*lda < maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,*n)) {
456 /*< INFO = -7 >*/
457 *info = -7;
458 /*< ELSE IF( LDB.LT.MAX( 1, N ) ) THEN >*/
459 } else if (*ldb < maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,*n)) {
460 /*< INFO = -9 >*/
461 *info = -9;
462 /*< ELSE IF( LDQ.LT.1 .OR. ( WANTQ .AND. LDQ.LT.N ) ) THEN >*/
463 } else if (*ldq < 1 || (*wantq && *ldq < *n)) {
464 /*< INFO = -13 >*/
465 *info = -13;
466 /*< ELSE IF( LDZ.LT.1 .OR. ( WANTZ .AND. LDZ.LT.N ) ) THEN >*/
467 } else if (*ldz < 1 || (*wantz && *ldz < *n)) {
468 /*< INFO = -15 >*/
469 *info = -15;
470 /*< END IF >*/
471 }
472
473 /*< IF( INFO.NE.0 ) THEN >*/
474 if (*info != 0) {
475 /*< CALL XERBLA( 'ZTGSEN', -INFO ) >*/
476 i__1 = -(*info);
477 xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!("ZTGSEN", &i__1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)6);
478 /*< RETURN >*/
479 return 0;
480 /*< END IF >*/
481 }
482
483 /*< IERR = 0 >*/
484 ierr = 0;
485
486 /*< WANTP = IJOB.EQ.1 .OR. IJOB.GE.4 >*/
487 wantp = *ijob == 1 || *ijob >= 4;
488 /*< WANTD1 = IJOB.EQ.2 .OR. IJOB.EQ.4 >*/
489 wantd1 = *ijob == 2 || *ijob == 4;
490 /*< WANTD2 = IJOB.EQ.3 .OR. IJOB.EQ.5 >*/
491 wantd2 = *ijob == 3 || *ijob == 5;
492 /*< WANTD = WANTD1 .OR. WANTD2 >*/
493 wantd = wantd1 || wantd2;
494
495 /* Set M to the dimension of the specified pair of deflating */
496 /* subspaces. */
497
498 /*< M = 0 >*/
499 *m = 0;
500 /*< DO 10 K = 1, N >*/
501 i__1 = *n;
502 for (k = 1; k <= i__1; ++k) {
503 /*< ALPHA( K ) = A( K, K ) >*/
504 i__2 = k;
505 i__3 = k + k * a_dim1;
506 alpha[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = a[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r., alpha[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = a[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i.;
507 /*< BETA( K ) = B( K, K ) >*/
508 i__2 = k;
509 i__3 = k + k * b_dim1;
510 beta[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = b[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r., beta[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = b[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i.;
511 /*< IF( K.LT.N ) THEN >*/
512 if (k < *n) {
513 /*< >*/
514 if (select[k]) {
515 ++(*m);
516 }
517 /*< ELSE >*/
518 } else {
519 /*< >*/
520 if (select[*n]) {
521 ++(*m);
522 }
523 /*< END IF >*/
524 }
525 /*< 10 CONTINUE >*/
526 /* L10: */
527 }
528
529 /*< IF( IJOB.EQ.1 .OR. IJOB.EQ.2 .OR. IJOB.EQ.4 ) THEN >*/
530 if (*ijob == 1 || *ijob == 2 || *ijob == 4) {
531 /*< LWMIN = MAX( 1, 2*M*( N-M ) ) >*/
532 /* Computing MAX */
533 i__1 = 1, i__2 = (*m << 1) * (*n - *m);
534 lwmin = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(i__1,i__2);
535 /*< LIWMIN = MAX( 1, N+2 ) >*/
536 /* Computing MAX */
537 i__1 = 1, i__2 = *n + 2;
538 liwmin = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(i__1,i__2);
539 /*< ELSE IF( IJOB.EQ.3 .OR. IJOB.EQ.5 ) THEN >*/
540 } else if (*ijob == 3 || *ijob == 5) {
541 /*< LWMIN = MAX( 1, 4*M*( N-M ) ) >*/
542 /* Computing MAX */
543 i__1 = 1, i__2 = (*m << 2) * (*n - *m);
544 lwmin = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(i__1,i__2);
545 /*< LIWMIN = MAX( 1, 2*M*( N-M ), N+2 ) >*/
546 /* Computing MAX */
547 i__1 = 1, i__2 = (*m << 1) * (*n - *m), i__1 = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(i__1,i__2), i__2 =
548 *n + 2;
549 liwmin = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(i__1,i__2);
550 /*< ELSE >*/
551 } else {
552 /*< LWMIN = 1 >*/
553 lwmin = 1;
554 /*< LIWMIN = 1 >*/
555 liwmin = 1;
556 /*< END IF >*/
557 }
558
559 /*< WORK( 1 ) = LWMIN >*/
560 work[1].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = (doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!) lwmin, work[1].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
561 /*< IWORK( 1 ) = LIWMIN >*/
562 iwork[1] = liwmin;
563
564 /*< IF( LWORK.LT.LWMIN .AND. .NOT.LQUERY ) THEN >*/
565 if (*lwork < lwmin && ! lquery) {
566 /*< INFO = -21 >*/
567 *info = -21;
568 /*< ELSE IF( LIWORK.LT.LIWMIN .AND. .NOT.LQUERY ) THEN >*/
569 } else if (*liwork < liwmin && ! lquery) {
570 /*< INFO = -23 >*/
571 *info = -23;
572 /*< END IF >*/
573 }
574
575 /*< IF( INFO.NE.0 ) THEN >*/
576 if (*info != 0) {
577 /*< CALL XERBLA( 'ZTGSEN', -INFO ) >*/
578 i__1 = -(*info);
579 xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!("ZTGSEN", &i__1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)6);
580 /*< RETURN >*/
581 return 0;
582 /*< ELSE IF( LQUERY ) THEN >*/
583 } else if (lquery) {
584 /*< RETURN >*/
585 return 0;
586 /*< END IF >*/
587 }
588
589 /* Quick return if possible. */
590
591 /*< IF( M.EQ.N .OR. M.EQ.0 ) THEN >*/
592 if (*m == *n || *m == 0) {
593 /*< IF( WANTP ) THEN >*/
594 if (wantp) {
595 /*< PL = ONE >*/
596 *pl = 1.;
597 /*< PR = ONE >*/
598 *pr = 1.;
599 /*< END IF >*/
600 }
601 /*< IF( WANTD ) THEN >*/
602 if (wantd) {
603 /*< DSCALE = ZERO >*/
604 dscale = 0.;
605 /*< DSUM = ONE >*/
606 dsum = 1.;
607 /*< DO 20 I = 1, N >*/
608 i__1 = *n;
609 for (i__ = 1; i__ <= i__1; ++i__) {
610 /*< CALL ZLASSQ( N, A( 1, I ), 1, DSCALE, DSUM ) >*/
611 zlassq_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:335:9`!(n, &a[i__ * a_dim1 + 1], &c__1cxx . . $ c__1., &dscale, &dsum);
612 /*< CALL ZLASSQ( N, B( 1, I ), 1, DSCALE, DSUM ) >*/
613 zlassq_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:335:9`!(n, &b[i__ * b_dim1 + 1], &c__1cxx . . $ c__1., &dscale, &dsum);
614 /*< 20 CONTINUE >*/
615 /* L20: */
616 }
617 /*< DIF( 1 ) = DSCALE*SQRT( DSUM ) >*/
618 dif[1] = dscale * sqrtcxx . . $ sqrt(447c67c6676f75c3).(dsum);
619 /*< DIF( 2 ) = DIF( 1 ) >*/
620 dif[2] = dif[1];
621 /*< END IF >*/
622 }
623 /*< GO TO 70 >*/
624 goto L70;
625 /*< END IF >*/
626 }
627
628 /* Get machine constant */
629
630 /*< SAFMIN = DLAMCH( 'S' ) >*/
631 safmin = dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!("S", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
632
633 /* Collect the selected blocks at the top-left corner of (A, B). */
634
635 /*< KS = 0 >*/
636 ks = 0;
637 /*< DO 30 K = 1, N >*/
638 i__1 = *n;
639 for (k = 1; k <= i__1; ++k) {
640 /*< SWAP = SELECT( K ) >*/
641 swap = select[k];
642 /*< IF( SWAP ) THEN >*/
643 if (swap) {
644 /*< KS = KS + 1 >*/
645 ++ks;
646
647 /* Swap the K-th block to position KS. Compute unitary Q */
648 /* and Z that will swap adjacent diagonal blocks in (A, B). */
649
650 /*< >*/
651 if (k != ks) {
652 ztgexc_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:354:9`!(wantq, wantz, n, &a[a_offset], lda, &b[b_offset], ldb,
653 &q[q_offset], ldq, &z__[z_offset], ldz, &k, &ks, &
654 ierr);
655 }
656
657 /*< IF( IERR.GT.0 ) THEN >*/
658 if (ierr > 0) {
659
660 /* Swap is rejected: exit. */
661
662 /*< INFO = 1 >*/
663 *info = 1;
664 /*< IF( WANTP ) THEN >*/
665 if (wantp) {
666 /*< PL = ZERO >*/
667 *pl = 0.;
668 /*< PR = ZERO >*/
669 *pr = 0.;
670 /*< END IF >*/
671 }
672 /*< IF( WANTD ) THEN >*/
673 if (wantd) {
674 /*< DIF( 1 ) = ZERO >*/
675 dif[1] = 0.;
676 /*< DIF( 2 ) = ZERO >*/
677 dif[2] = 0.;
678 /*< END IF >*/
679 }
680 /*< GO TO 70 >*/
681 goto L70;
682 /*< END IF >*/
683 }
684 /*< END IF >*/
685 }
686 /*< 30 CONTINUE >*/
687 /* L30: */
688 }
689 /*< IF( WANTP ) THEN >*/
690 if (wantp) {
691
692 /* Solve generalized Sylvester equation for R and L: */
693 /* A11 * R - L * A22 = A12 */
694 /* B11 * R - L * B22 = B12 */
695
696 /*< N1 = M >*/
697 n1 = *m;
698 /*< N2 = N - M >*/
699 n2 = *n - *m;
700 /*< I = N1 + 1 >*/
701 i__ = n1 + 1;
702 /*< CALL ZLACPY( 'Full', N1, N2, A( 1, I ), LDA, WORK, N1 ) >*/
703 zlacpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:322:9`!("Full", &n1, &n2, &a[i__ * a_dim1 + 1], lda, &work[1], &n1, (
704 ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)4);
705 /*< >*/
706 zlacpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:322:9`!("Full", &n1, &n2, &b[i__ * b_dim1 + 1], ldb, &work[n1 * n2 +
707 1], &n1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)4);
708 /*< IJB = 0 >*/
709 ijb = 0;
710 /*< >*/
711 i__1 = *lwork - (n1 << 1) * n2;
712 ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!("N", &ijb, &n1, &n2, &a[a_offset], lda, &a[i__ + i__ * a_dim1]
713 , lda, &work[1], &n1, &b[b_offset], ldb, &b[i__ + i__ *
714 b_dim1], ldb, &work[n1 * n2 + 1], &n1, &dscale, &dif[1], &
715 work[(n1 * n2 << 1) + 1], &i__1, &iwork[1], &ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
716
717 /* Estimate the reciprocal of norms of "projections" onto */
718 /* left and right eigenspaces */
719
720 /*< RDSCAL = ZERO >*/
721 rdscal = 0.;
722 /*< DSUM = ONE >*/
723 dsum = 1.;
724 /*< CALL ZLASSQ( N1*N2, WORK, 1, RDSCAL, DSUM ) >*/
725 i__1 = n1 * n2;
726 zlassq_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:335:9`!(&i__1, &work[1], &c__1cxx . . $ c__1., &rdscal, &dsum);
727 /*< PL = RDSCAL*SQRT( DSUM ) >*/
728 *pl = rdscal * sqrtcxx . . $ sqrt(447c67c6676f75c3).(dsum);
729 /*< IF( PL.EQ.ZERO ) THEN >*/
730 if (*pl == 0.) {
731 /*< PL = ONE >*/
732 *pl = 1.;
733 /*< ELSE >*/
734 } else {
735 /*< PL = DSCALE / ( SQRT( DSCALE*DSCALE / PL+PL )*SQRT( PL ) ) >*/
736 *pl = dscale / (sqrtcxx . . $ sqrt(447c67c6676f75c3).(dscale * dscale / *pl + *pl) * sqrtcxx . . $ sqrt(447c67c6676f75c3).(*pl));
737 /*< END IF >*/
738 }
739 /*< RDSCAL = ZERO >*/
740 rdscal = 0.;
741 /*< DSUM = ONE >*/
742 dsum = 1.;
743 /*< CALL ZLASSQ( N1*N2, WORK( N1*N2+1 ), 1, RDSCAL, DSUM ) >*/
744 i__1 = n1 * n2;
745 zlassq_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:335:9`!(&i__1, &work[n1 * n2 + 1], &c__1cxx . . $ c__1., &rdscal, &dsum);
746 /*< PR = RDSCAL*SQRT( DSUM ) >*/
747 *pr = rdscal * sqrtcxx . . $ sqrt(447c67c6676f75c3).(dsum);
748 /*< IF( PR.EQ.ZERO ) THEN >*/
749 if (*pr == 0.) {
750 /*< PR = ONE >*/
751 *pr = 1.;
752 /*< ELSE >*/
753 } else {
754 /*< PR = DSCALE / ( SQRT( DSCALE*DSCALE / PR+PR )*SQRT( PR ) ) >*/
755 *pr = dscale / (sqrtcxx . . $ sqrt(447c67c6676f75c3).(dscale * dscale / *pr + *pr) * sqrtcxx . . $ sqrt(447c67c6676f75c3).(*pr));
756 /*< END IF >*/
757 }
758 /*< END IF >*/
759 }
760 /*< IF( WANTD ) THEN >*/
761 if (wantd) {
762
763 /* Compute estimates Difu and Difl. */
764
765 /*< IF( WANTD1 ) THEN >*/
766 if (wantd1) {
767 /*< N1 = M >*/
768 n1 = *m;
769 /*< N2 = N - M >*/
770 n2 = *n - *m;
771 /*< I = N1 + 1 >*/
772 i__ = n1 + 1;
773 /*< IJB = IDIFJB >*/
774 ijb = 3;
775
776 /* Frobenius norm-based Difu estimate. */
777
778 /*< >*/
779 i__1 = *lwork - (n1 << 1) * n2;
780 ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!("N", &ijb, &n1, &n2, &a[a_offset], lda, &a[i__ + i__ *
781 a_dim1], lda, &work[1], &n1, &b[b_offset], ldb, &b[i__ +
782 i__ * b_dim1], ldb, &work[n1 * n2 + 1], &n1, &dscale, &
783 dif[1], &work[(n1 * n2 << 1) + 1], &i__1, &iwork[1], &
784 ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
785
786 /* Frobenius norm-based Difl estimate. */
787
788 /*< >*/
789 i__1 = *lwork - (n1 << 1) * n2;
790 ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!("N", &ijb, &n2, &n1, &a[i__ + i__ * a_dim1], lda, &a[
791 a_offset], lda, &work[1], &n2, &b[i__ + i__ * b_dim1],
792 ldb, &b[b_offset], ldb, &work[n1 * n2 + 1], &n2, &dscale,
793 &dif[2], &work[(n1 * n2 << 1) + 1], &i__1, &iwork[1], &
794 ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
795 /*< ELSE >*/
796 } else {
797
798 /* Compute 1-norm-based estimates of Difu and Difl using */
799 /* reversed communication with ZLACN2. In each step a */
800 /* generalized Sylvester equation or a transposed variant */
801 /* is solved. */
802
803 /*< KASE = 0 >*/
804 kase = 0;
805 /*< N1 = M >*/
806 n1 = *m;
807 /*< N2 = N - M >*/
808 n2 = *n - *m;
809 /*< I = N1 + 1 >*/
810 i__ = n1 + 1;
811 /*< IJB = 0 >*/
812 ijb = 0;
813 /*< MN2 = 2*N1*N2 >*/
814 mn2 = (n1 << 1) * n2;
815
816 /* 1-norm-based estimate of Difu. */
817
818 /*< 40 CONTINUE >*/
819 L40:
820 /*< >*/
821 zlacn2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:352:9`!(&mn2, &work[mn2 + 1], &work[1], &dif[1], &kase, isave);
822 /*< IF( KASE.NE.0 ) THEN >*/
823 if (kase != 0) {
824 /*< IF( KASE.EQ.1 ) THEN >*/
825 if (kase == 1) {
826
827 /* Solve generalized Sylvester equation */
828
829 /*< >*/
830 i__1 = *lwork - (n1 << 1) * n2;
831 ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!("N", &ijb, &n1, &n2, &a[a_offset], lda, &a[i__ +
832 i__ * a_dim1], lda, &work[1], &n1, &b[b_offset],
833 ldb, &b[i__ + i__ * b_dim1], ldb, &work[n1 * n2 +
834 1], &n1, &dscale, &dif[1], &work[(n1 * n2 << 1) +
835 1], &i__1, &iwork[1], &ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
836 /*< ELSE >*/
837 } else {
838
839 /* Solve the transposed variant. */
840
841 /*< >*/
842 i__1 = *lwork - (n1 << 1) * n2;
843 ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!("C", &ijb, &n1, &n2, &a[a_offset], lda, &a[i__ +
844 i__ * a_dim1], lda, &work[1], &n1, &b[b_offset],
845 ldb, &b[i__ + i__ * b_dim1], ldb, &work[n1 * n2 +
846 1], &n1, &dscale, &dif[1], &work[(n1 * n2 << 1) +
847 1], &i__1, &iwork[1], &ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
848 /*< END IF >*/
849 }
850 /*< GO TO 40 >*/
851 goto L40;
852 /*< END IF >*/
853 }
854 /*< DIF( 1 ) = DSCALE / DIF( 1 ) >*/
855 dif[1] = dscale / dif[1];
856
857 /* 1-norm-based estimate of Difl. */
858
859 /*< 50 CONTINUE >*/
860 L50:
861 /*< >*/
862 zlacn2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:352:9`!(&mn2, &work[mn2 + 1], &work[1], &dif[2], &kase, isave);
863 /*< IF( KASE.NE.0 ) THEN >*/
864 if (kase != 0) {
865 /*< IF( KASE.EQ.1 ) THEN >*/
866 if (kase == 1) {
867
868 /* Solve generalized Sylvester equation */
869
870 /*< >*/
871 i__1 = *lwork - (n1 << 1) * n2;
872 ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!("N", &ijb, &n2, &n1, &a[i__ + i__ * a_dim1], lda,
873 &a[a_offset], lda, &work[1], &n2, &b[i__ + i__ *
874 b_dim1], ldb, &b[b_offset], ldb, &work[n1 * n2 +
875 1], &n2, &dscale, &dif[2], &work[(n1 * n2 << 1) +
876 1], &i__1, &iwork[1], &ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
877 /*< ELSE >*/
878 } else {
879
880 /* Solve the transposed variant. */
881
882 /*< >*/
883 i__1 = *lwork - (n1 << 1) * n2;
884 ztgsyl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:349:9`!("C", &ijb, &n2, &n1, &a[i__ + i__ * a_dim1], lda,
885 &a[a_offset], lda, &work[1], &n2, &b[b_offset],
886 ldb, &b[i__ + i__ * b_dim1], ldb, &work[n1 * n2 +
887 1], &n2, &dscale, &dif[2], &work[(n1 * n2 << 1) +
888 1], &i__1, &iwork[1], &ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
889 /*< END IF >*/
890 }
891 /*< GO TO 50 >*/
892 goto L50;
893 /*< END IF >*/
894 }
895 /*< DIF( 2 ) = DSCALE / DIF( 2 ) >*/
896 dif[2] = dscale / dif[2];
897 /*< END IF >*/
898 }
899 /*< END IF >*/
900 }
901
902 /* If B(K,K) is complex, make it real and positive (normalization */
903 /* of the generalized Schur form) and Store the generalized */
904 /* eigenvalues of reordered pair (A, B) */
905
906 /*< DO 60 K = 1, N >*/
907 i__1 = *n;
908 for (k = 1; k <= i__1; ++k) {
909 /*< DSCALE = ABS( B( K, K ) ) >*/
910 dscale = z_abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:28:9`!(&b[k + k * b_dim1]);
911 /*< IF( DSCALE.GT.SAFMIN ) THEN >*/
912 if (dscale > safmin) {
913 /*< TEMP1 = DCONJG( B( K, K ) / DSCALE ) >*/
914 i__2 = k + k * b_dim1;
915 z__2.rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = b[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. / dscale, z__2.icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = b[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. / dscale;
916 d_cnjgcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:11:9`!(&z__1, &z__2);
917 temp1.rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = z__1.rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r., temp1.icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = z__1.icxx . . $ $anonymous_type_ec17f80a666933f6_1#i.;
918 /*< TEMP2 = B( K, K ) / DSCALE >*/
919 i__2 = k + k * b_dim1;
920 z__1.rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = b[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. / dscale, z__1.icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = b[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. / dscale;
921 temp2.rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = z__1.rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r., temp2.icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = z__1.icxx . . $ $anonymous_type_ec17f80a666933f6_1#i.;
922 /*< B( K, K ) = DSCALE >*/
923 i__2 = k + k * b_dim1;
924 b[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = dscale, b[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
925 /*< CALL ZSCAL( N-K, TEMP1, B( K, K+1 ), LDB ) >*/
926 i__2 = *n - k;
927 zscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:339:9`!(&i__2, &temp1, &b[k + (k + 1) * b_dim1], ldb);
928 /*< CALL ZSCAL( N-K+1, TEMP1, A( K, K ), LDA ) >*/
929 i__2 = *n - k + 1;
930 zscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:339:9`!(&i__2, &temp1, &a[k + k * a_dim1], lda);
931 /*< >*/
932 if (*wantq) {
933 zscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:339:9`!(n, &temp2, &q[k * q_dim1 + 1], &c__1cxx . . $ c__1.);
934 }
935 /*< ELSE >*/
936 } else {
937 /*< B( K, K ) = DCMPLX( ZERO, ZERO ) >*/
938 i__2 = k + k * b_dim1;
939 b[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = 0., b[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
940 /*< END IF >*/
941 }
942
943 /*< ALPHA( K ) = A( K, K ) >*/
944 i__2 = k;
945 i__3 = k + k * a_dim1;
946 alpha[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = a[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r., alpha[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = a[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i.;
947 /*< BETA( K ) = B( K, K ) >*/
948 i__2 = k;
949 i__3 = k + k * b_dim1;
950 beta[i__2].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = b[i__3].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r., beta[i__2].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = b[i__3].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i.;
951
952 /*< 60 CONTINUE >*/
953 /* L60: */
954 }
955
956 /*< 70 CONTINUE >*/
957 L70:
958
959 /*< WORK( 1 ) = LWMIN >*/
960 work[1].rcxx . . $ $anonymous_type_ec17f80a666933f6_1#r. = (doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!) lwmin, work[1].icxx . . $ $anonymous_type_ec17f80a666933f6_1#i. = 0.;
961 /*< IWORK( 1 ) = LIWMIN >*/
962 iwork[1] = liwmin;
963
964 /*< RETURN >*/
965 return 0;
966
967 /* End of ZTGSEN */
968
969 /*< END >*/
970 } /* ztgsen_ */
971
972 #ifdef __cplusplus
973 }
974 #endif