1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
|
---
:name: cunbdb
:md5sum: f3d37f59c9a21d3cf112e287fa50b474
:category: :subroutine
:arguments:
- trans:
:type: char
:intent: input
- signs:
:type: char
:intent: input
- m:
:type: integer
:intent: input
- p:
:type: integer
:intent: input
- q:
:type: integer
:intent: input
- x11:
:type: complex
:intent: input/output
:dims:
- ldx11
- q
- ldx11:
:type: integer
:intent: input
- x12:
:type: complex
:intent: input/output
:dims:
- ldx12
- m-q
- ldx12:
:type: integer
:intent: input
- x21:
:type: complex
:intent: input/output
:dims:
- ldx21
- q
- ldx21:
:type: integer
:intent: input
- x22:
:type: complex
:intent: input/output
:dims:
- ldx22
- m-q
- ldx22:
:type: integer
:intent: input
- theta:
:type: real
:intent: output
:dims:
- q
- phi:
:type: real
:intent: output
:dims:
- q-1
- taup1:
:type: complex
:intent: output
:dims:
- p
- taup2:
:type: complex
:intent: output
:dims:
- m-p
- tauq1:
:type: complex
:intent: output
:dims:
- q
- tauq2:
:type: complex
:intent: output
:dims:
- m-q
- work:
:type: complex
:intent: workspace
:dims:
- MAX(1,lwork)
- lwork:
:type: integer
:intent: input
:option: true
:default: m-q
- info:
:type: integer
:intent: output
:substitutions:
p: ldx11
ldx12: p
ldx21: p
ldx22: p
:fortran_help: " SUBROUTINE CUNBDB( TRANS, SIGNS, M, P, Q, X11, LDX11, X12, LDX12, X21, LDX21, X22, LDX22, THETA, PHI, TAUP1, TAUP2, TAUQ1, TAUQ2, WORK, LWORK, INFO )\n\n\
* Purpose\n\
* =======\n\
*\n\
* CUNBDB simultaneously bidiagonalizes the blocks of an M-by-M\n\
* partitioned unitary matrix X:\n\
*\n\
* [ B11 | B12 0 0 ]\n\
* [ X11 | X12 ] [ P1 | ] [ 0 | 0 -I 0 ] [ Q1 | ]**H\n\
* X = [-----------] = [---------] [----------------] [---------] .\n\
* [ X21 | X22 ] [ | P2 ] [ B21 | B22 0 0 ] [ | Q2 ]\n\
* [ 0 | 0 0 I ]\n\
*\n\
* X11 is P-by-Q. Q must be no larger than P, M-P, or M-Q. (If this is\n\
* not the case, then X must be transposed and/or permuted. This can be\n\
* done in constant time using the TRANS and SIGNS options. See CUNCSD\n\
* for details.)\n\
*\n\
* The unitary matrices P1, P2, Q1, and Q2 are P-by-P, (M-P)-by-\n\
* (M-P), Q-by-Q, and (M-Q)-by-(M-Q), respectively. They are\n\
* represented implicitly by Householder vectors.\n\
*\n\
* B11, B12, B21, and B22 are Q-by-Q bidiagonal matrices represented\n\
* implicitly by angles THETA, PHI.\n\
*\n\n\
* Arguments\n\
* =========\n\
*\n\
* TRANS (input) CHARACTER\n\
* = 'T': X, U1, U2, V1T, and V2T are stored in row-major\n\
* order;\n\
* otherwise: X, U1, U2, V1T, and V2T are stored in column-\n\
* major order.\n\
*\n\
* SIGNS (input) CHARACTER\n\
* = 'O': The lower-left block is made nonpositive (the\n\
* \"other\" convention);\n\
* otherwise: The upper-right block is made nonpositive (the\n\
* \"default\" convention).\n\
*\n\
* M (input) INTEGER\n\
* The number of rows and columns in X.\n\
*\n\
* P (input) INTEGER\n\
* The number of rows in X11 and X12. 0 <= P <= M.\n\
*\n\
* Q (input) INTEGER\n\
* The number of columns in X11 and X21. 0 <= Q <=\n\
* MIN(P,M-P,M-Q).\n\
*\n\
* X11 (input/output) COMPLEX array, dimension (LDX11,Q)\n\
* On entry, the top-left block of the unitary matrix to be\n\
* reduced. On exit, the form depends on TRANS:\n\
* If TRANS = 'N', then\n\
* the columns of tril(X11) specify reflectors for P1,\n\
* the rows of triu(X11,1) specify reflectors for Q1;\n\
* else TRANS = 'T', and\n\
* the rows of triu(X11) specify reflectors for P1,\n\
* the columns of tril(X11,-1) specify reflectors for Q1.\n\
*\n\
* LDX11 (input) INTEGER\n\
* The leading dimension of X11. If TRANS = 'N', then LDX11 >=\n\
* P; else LDX11 >= Q.\n\
*\n\
* X12 (input/output) CMPLX array, dimension (LDX12,M-Q)\n\
* On entry, the top-right block of the unitary matrix to\n\
* be reduced. On exit, the form depends on TRANS:\n\
* If TRANS = 'N', then\n\
* the rows of triu(X12) specify the first P reflectors for\n\
* Q2;\n\
* else TRANS = 'T', and\n\
* the columns of tril(X12) specify the first P reflectors\n\
* for Q2.\n\
*\n\
* LDX12 (input) INTEGER\n\
* The leading dimension of X12. If TRANS = 'N', then LDX12 >=\n\
* P; else LDX11 >= M-Q.\n\
*\n\
* X21 (input/output) COMPLEX array, dimension (LDX21,Q)\n\
* On entry, the bottom-left block of the unitary matrix to\n\
* be reduced. On exit, the form depends on TRANS:\n\
* If TRANS = 'N', then\n\
* the columns of tril(X21) specify reflectors for P2;\n\
* else TRANS = 'T', and\n\
* the rows of triu(X21) specify reflectors for P2.\n\
*\n\
* LDX21 (input) INTEGER\n\
* The leading dimension of X21. If TRANS = 'N', then LDX21 >=\n\
* M-P; else LDX21 >= Q.\n\
*\n\
* X22 (input/output) COMPLEX array, dimension (LDX22,M-Q)\n\
* On entry, the bottom-right block of the unitary matrix to\n\
* be reduced. On exit, the form depends on TRANS:\n\
* If TRANS = 'N', then\n\
* the rows of triu(X22(Q+1:M-P,P+1:M-Q)) specify the last\n\
* M-P-Q reflectors for Q2,\n\
* else TRANS = 'T', and\n\
* the columns of tril(X22(P+1:M-Q,Q+1:M-P)) specify the last\n\
* M-P-Q reflectors for P2.\n\
*\n\
* LDX22 (input) INTEGER\n\
* The leading dimension of X22. If TRANS = 'N', then LDX22 >=\n\
* M-P; else LDX22 >= M-Q.\n\
*\n\
* THETA (output) REAL array, dimension (Q)\n\
* The entries of the bidiagonal blocks B11, B12, B21, B22 can\n\
* be computed from the angles THETA and PHI. See Further\n\
* Details.\n\
*\n\
* PHI (output) REAL array, dimension (Q-1)\n\
* The entries of the bidiagonal blocks B11, B12, B21, B22 can\n\
* be computed from the angles THETA and PHI. See Further\n\
* Details.\n\
*\n\
* TAUP1 (output) COMPLEX array, dimension (P)\n\
* The scalar factors of the elementary reflectors that define\n\
* P1.\n\
*\n\
* TAUP2 (output) COMPLEX array, dimension (M-P)\n\
* The scalar factors of the elementary reflectors that define\n\
* P2.\n\
*\n\
* TAUQ1 (output) COMPLEX array, dimension (Q)\n\
* The scalar factors of the elementary reflectors that define\n\
* Q1.\n\
*\n\
* TAUQ2 (output) COMPLEX array, dimension (M-Q)\n\
* The scalar factors of the elementary reflectors that define\n\
* Q2.\n\
*\n\
* WORK (workspace) COMPLEX array, dimension (LWORK)\n\
*\n\
* LWORK (input) INTEGER\n\
* The dimension of the array WORK. LWORK >= M-Q.\n\
*\n\
* If LWORK = -1, then a workspace query is assumed; the routine\n\
* only calculates the optimal size of the WORK array, returns\n\
* this value as the first entry of the WORK array, and no error\n\
* message related to LWORK is issued by XERBLA.\n\
*\n\
* INFO (output) INTEGER\n\
* = 0: successful exit.\n\
* < 0: if INFO = -i, the i-th argument had an illegal value.\n\
*\n\n\
* Further Details\n\
* ===============\n\
*\n\
* The bidiagonal blocks B11, B12, B21, and B22 are represented\n\
* implicitly by angles THETA(1), ..., THETA(Q) and PHI(1), ...,\n\
* PHI(Q-1). B11 and B21 are upper bidiagonal, while B21 and B22 are\n\
* lower bidiagonal. Every entry in each bidiagonal band is a product\n\
* of a sine or cosine of a THETA with a sine or cosine of a PHI. See\n\
* [1] or CUNCSD for details.\n\
*\n\
* P1, P2, Q1, and Q2 are represented as products of elementary\n\
* reflectors. See CUNCSD for details on generating P1, P2, Q1, and Q2\n\
* using CUNGQR and CUNGLQ.\n\
*\n\
* Reference\n\
* =========\n\
*\n\
* [1] Brian D. Sutton. Computing the complete CS decomposition. Numer.\n\
* Algorithms, 50(1):33-65, 2009.\n\
*\n\
* ====================================================================\n\
*\n"
|