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
|
---
:name: cgglse
:md5sum: 76651864baa26d2d1471eeda133757a5
:category: :subroutine
:arguments:
- m:
:type: integer
:intent: input
- n:
:type: integer
:intent: input
- p:
:type: integer
:intent: input
- a:
:type: complex
:intent: input/output
:dims:
- lda
- n
- lda:
:type: integer
:intent: input
- b:
:type: complex
:intent: input/output
:dims:
- ldb
- n
- ldb:
:type: integer
:intent: input
- c:
:type: complex
:intent: input/output
:dims:
- m
- d:
:type: complex
:intent: input/output
:dims:
- p
- x:
:type: complex
:intent: output
:dims:
- n
- work:
:type: complex
:intent: output
:dims:
- MAX(1,lwork)
- lwork:
:type: integer
:intent: input
:option: true
:default: m+n+p
- info:
:type: integer
:intent: output
:substitutions: {}
:fortran_help: " SUBROUTINE CGGLSE( M, N, P, A, LDA, B, LDB, C, D, X, WORK, LWORK, INFO )\n\n\
* Purpose\n\
* =======\n\
*\n\
* CGGLSE solves the linear equality-constrained least squares (LSE)\n\
* problem:\n\
*\n\
* minimize || c - A*x ||_2 subject to B*x = d\n\
*\n\
* where A is an M-by-N matrix, B is a P-by-N matrix, c is a given\n\
* M-vector, and d is a given P-vector. It is assumed that\n\
* P <= N <= M+P, and\n\
*\n\
* rank(B) = P and rank( (A) ) = N.\n\
* ( (B) )\n\
*\n\
* These conditions ensure that the LSE problem has a unique solution,\n\
* which is obtained using a generalized RQ factorization of the\n\
* matrices (B, A) given by\n\
*\n\
* B = (0 R)*Q, A = Z*T*Q.\n\
*\n\n\
* Arguments\n\
* =========\n\
*\n\
* M (input) INTEGER\n\
* The number of rows of the matrix A. M >= 0.\n\
*\n\
* N (input) INTEGER\n\
* The number of columns of the matrices A and B. N >= 0.\n\
*\n\
* P (input) INTEGER\n\
* The number of rows of the matrix B. 0 <= P <= N <= M+P.\n\
*\n\
* A (input/output) COMPLEX array, dimension (LDA,N)\n\
* On entry, the M-by-N matrix A.\n\
* On exit, the elements on and above the diagonal of the array\n\
* contain the min(M,N)-by-N upper trapezoidal matrix T.\n\
*\n\
* LDA (input) INTEGER\n\
* The leading dimension of the array A. LDA >= max(1,M).\n\
*\n\
* B (input/output) COMPLEX array, dimension (LDB,N)\n\
* On entry, the P-by-N matrix B.\n\
* On exit, the upper triangle of the subarray B(1:P,N-P+1:N)\n\
* contains the P-by-P upper triangular matrix R.\n\
*\n\
* LDB (input) INTEGER\n\
* The leading dimension of the array B. LDB >= max(1,P).\n\
*\n\
* C (input/output) COMPLEX array, dimension (M)\n\
* On entry, C contains the right hand side vector for the\n\
* least squares part of the LSE problem.\n\
* On exit, the residual sum of squares for the solution\n\
* is given by the sum of squares of elements N-P+1 to M of\n\
* vector C.\n\
*\n\
* D (input/output) COMPLEX array, dimension (P)\n\
* On entry, D contains the right hand side vector for the\n\
* constrained equation.\n\
* On exit, D is destroyed.\n\
*\n\
* X (output) COMPLEX array, dimension (N)\n\
* On exit, X is the solution of the LSE problem.\n\
*\n\
* WORK (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))\n\
* On exit, if INFO = 0, WORK(1) returns the optimal LWORK.\n\
*\n\
* LWORK (input) INTEGER\n\
* The dimension of the array WORK. LWORK >= max(1,M+N+P).\n\
* For optimum performance LWORK >= P+min(M,N)+max(M,N)*NB,\n\
* where NB is an upper bound for the optimal blocksizes for\n\
* CGEQRF, CGERQF, CUNMQR and CUNMRQ.\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\
* = 1: the upper triangular factor R associated with B in the\n\
* generalized RQ factorization of the pair (B, A) is\n\
* singular, so that rank(B) < P; the least squares\n\
* solution could not be computed.\n\
* = 2: the (N-P) by (N-P) part of the upper trapezoidal factor\n\
* T associated with A in the generalized RQ factorization\n\
* of the pair (B, A) is singular, so that\n\
* rank( (A) ) < N; the least squares solution could not\n\
* ( (B) )\n\
* be computed.\n\
*\n\n\
* =====================================================================\n\
*\n"
|