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
|
---
:name: cgelss
:md5sum: 62422f6642a76bd0d56d9f0cc0a57940
:category: :subroutine
:arguments:
- m:
:type: integer
:intent: input
- n:
:type: integer
:intent: input
- nrhs:
: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:
- m
- nrhs
:outdims:
- n
- nrhs
- ldb:
:type: integer
:intent: input
- s:
:type: real
:intent: output
:dims:
- MIN(m,n)
- rcond:
:type: real
:intent: input
- rank:
:type: integer
:intent: output
- work:
:type: complex
:intent: output
:dims:
- MAX(1,lwork)
- lwork:
:type: integer
:intent: input
:option: true
:default: 3*MIN(m,n) + MAX(MAX(2*MIN(m,n),MAX(m,n)),nrhs)
- rwork:
:type: real
:intent: workspace
:dims:
- 5*MIN(m,n)
- info:
:type: integer
:intent: output
:substitutions:
m: lda
ldb: MAX(m, n)
:fortran_help: " SUBROUTINE CGELSS( M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK, LWORK, RWORK, INFO )\n\n\
* Purpose\n\
* =======\n\
*\n\
* CGELSS computes the minimum norm solution to a complex linear\n\
* least squares problem:\n\
*\n\
* Minimize 2-norm(| b - A*x |).\n\
*\n\
* using the singular value decomposition (SVD) of A. A is an M-by-N\n\
* matrix which may be rank-deficient.\n\
*\n\
* Several right hand side vectors b and solution vectors x can be\n\
* handled in a single call; they are stored as the columns of the\n\
* M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix\n\
* X.\n\
*\n\
* The effective rank of A is determined by treating as zero those\n\
* singular values which are less than RCOND times the largest singular\n\
* value.\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 matrix A. N >= 0.\n\
*\n\
* NRHS (input) INTEGER\n\
* The number of right hand sides, i.e., the number of columns\n\
* of the matrices B and X. NRHS >= 0.\n\
*\n\
* A (input/output) COMPLEX array, dimension (LDA,N)\n\
* On entry, the M-by-N matrix A.\n\
* On exit, the first min(m,n) rows of A are overwritten with\n\
* its right singular vectors, stored rowwise.\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,NRHS)\n\
* On entry, the M-by-NRHS right hand side matrix B.\n\
* On exit, B is overwritten by the N-by-NRHS solution matrix X.\n\
* If m >= n and RANK = n, the residual sum-of-squares for\n\
* the solution in the i-th column is given by the sum of\n\
* squares of the modulus of elements n+1:m in that column.\n\
*\n\
* LDB (input) INTEGER\n\
* The leading dimension of the array B. LDB >= max(1,M,N).\n\
*\n\
* S (output) REAL array, dimension (min(M,N))\n\
* The singular values of A in decreasing order.\n\
* The condition number of A in the 2-norm = S(1)/S(min(m,n)).\n\
*\n\
* RCOND (input) REAL\n\
* RCOND is used to determine the effective rank of A.\n\
* Singular values S(i) <= RCOND*S(1) are treated as zero.\n\
* If RCOND < 0, machine precision is used instead.\n\
*\n\
* RANK (output) INTEGER\n\
* The effective rank of A, i.e., the number of singular values\n\
* which are greater than RCOND*S(1).\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 >= 1, and also:\n\
* LWORK >= 2*min(M,N) + max(M,N,NRHS)\n\
* For good performance, LWORK should generally be larger.\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\
* RWORK (workspace) REAL array, dimension (5*min(M,N))\n\
*\n\
* INFO (output) INTEGER\n\
* = 0: successful exit\n\
* < 0: if INFO = -i, the i-th argument had an illegal value.\n\
* > 0: the algorithm for computing the SVD failed to converge;\n\
* if INFO = i, i off-diagonal elements of an intermediate\n\
* bidiagonal form did not converge to zero.\n\
*\n\n\
* =====================================================================\n\
*\n"
|