LUfactorization to compute the solution to the system of linear equations with a square matrix
Aand multiple right-hand sides, and provides error bounds on the solution.
LUfactorization to compute the solution to a real or complex system of linear equations
Error bounds on the solution and a condition estimate are also provided.
In the following description,
afstands for the subarray
p?gesvxperforms the following steps:
- Iffact='E', real scaling factorsRandCare computed to equilibrate the system::trans='N'diag(R)*A*diag(C) *diag(C)-1*X= diag(R)*B:trans='T'(diag(R)*A*diag(C))T*diag(R)-1*X= diag(C)*B:trans='C'(diag(R)*A*diag(C))H*diag(R)-1*X= diag(C)*BWhether or not the system will be equilibrated depends on the scaling of the matrixA, but if equilibration is used,Ais overwritten bydiag(andR)*A*diag(C)Bbydiag((ifR)*Bortrans='N')diag((ifc)*Bortrans='T''C').
- Iforfact='N''E', theLUdecomposition is used to factor the matrixA(after equilibration ifasfact='E'), whereA=PLUPis a permutation matrix,Lis a unit lower triangular matrix, andUis upper triangular.
- The factored form ofAis used to estimate the condition number of the matrixA. If the reciprocal of the condition number is less than relative machine precision, steps 4 - 6 are skipped.
- The system of equations is solved forXusing the factored form ofA.
- Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
- If equilibration was used, the matrixXis premultiplied by diag(C) (ifor diag(trans='N')R) (ifortrans='T''C') so that it solves the original system before equilibration.
- (global) Must be'F','N', or'E'.Specifies whether or not the factored form of the matrixAis supplied on entry, and if not, whether the matrixAshould be equilibrated before it is factored.Ifthen, on entry,fact='F'afandipivcontain the factored form ofA. Ifequedis not'N', the matrixAhas been equilibrated with scaling factors given byrandc. Arraysa,af, andipivare not modified.If, the matrixfact='N'Ais copied toafand factored.If, the matrixfact='E'Ais equilibrated if necessary, then copied toafand factored.
- (global) Must be'N','T', or'C'.Specifies the form of the system of equations:If, the system has the formtrans='N'A*X=B(No transpose);If, the system has the formtrans='T'A*TX=B(Transpose);If, the system has the formtrans='C'AH*X=B(Conjugate transpose);
- (global) The number of linear equations; the order of the submatrixA(.n≥0)
- (global) The number of right hand sides; the number of columns of the distributed submatricesBandX(.nrhs≥0)
- (local)Pointers into the local memory to arrays of local size,a:lld_a*LOCc(ja+n-1),af:lld_af*LOCc(ja+n-1),b:lld_b*LOCc(jb+nrhs-1).work:lworkThe arrayacontains the matrixA. Ifandfact='F'equedis not'N', thenAmust have been equilibrated by the scaling factors inrand/orc.The arrayafis an input argument if. In this case it contains on entry the factored form of the matrixfact='F'A, that is, the factorsLandUfrom the factorizationas computed byA=P*L*Up?getrf. Ifequedis not'N', thenafis the factored form of the equilibrated matrixA.The arraybcontains on entry the matrixBwhose columns are the right-hand sides for the systems of equations.workis a workspace array. The size ofworkis (lwork).
- (global) The row and column indices in the global matrixAindicating the first row and the first column of the submatrix, respectively.A(ia:ia+n-1,ja:ja+n-1)
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixA.
- (global) The row and column indices in the global matrixAFindicating the first row and the first column of the subarray, respectively.af
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixAF.
- (global) The row and column indices in the global matrixBindicating the first row and the first column of the submatrix, respectively.B(ib:ib+n-1,jb:jb+nrhs-1)
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixB.
- (local) Array of size.LOCr(m_a)+mb_aThe arrayipivis an input argument if.fact='F'On entry, it contains the pivot indices from the factorizationas computed byA=P*L*Up?getrf; (local) rowiof the matrix was interchanged with the (global) rowipiv[.i- 1]This array must be aligned with.A(ia:ia+n-1,*)
- (global) Must be'N','R','C', or'B'.equedis an input argument iffact='F'. It specifies the form of equilibration that was done:If, no equilibration was done (always true ifequed='N');fact='N'If, row equilibration was done, that is,equed='R'Ahas been premultiplied by diag(r);If, column equilibration was done, that is,equed='C'Ahas been postmultiplied by diag(c);If, both row and column equilibration was done;equed='B'Ahas been replaced bydiag(.r)*A*diag(c)
- (local)Arrays of sizeandLOCr(m_a), respectively.LOCc(n_a)The arrayrcontains the row scale factors forA, and the arrayccontains the column scale factors forA. These arrays are input arguments ifonly; otherwise they are output arguments. Iffact='F'orequed='R''B',Ais multiplied on the left by diag(r); iforequed='N''C',ris not accessed.Ifandfact='F'orequed='R''B', each element ofrmust be positive.Iforequed='C''B',Ais multiplied on the right by diag(c); iforequed='N''R',cis not accessed.Ifandfact='F'orequed='C''B', each element ofcmust be positive. Arrayris replicated in every process column, and is aligned with the distributed matrixA. Arraycis replicated in every process row, and is aligned with the distributed matrixA.
- (global) The row and column indices in the global matrixXindicating the first row and the first column of the submatrix, respectively.X(ix:ix+n-1,jx:jx+nrhs-1)
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixX.
- (local or global) The size of the arraywork; must be at leastmax(.p?gecon(lwork),p?gerfs(lwork))+LOCr(n_a)
- (local,psgesvx/pdgesvxonly). Workspace array. The size ofiworkis (liwork).
- (local,psgesvx/pdgesvxonly). The size of the arrayiwork, must be at least.LOCr(n_a)
- (local)Workspace array, used in complex flavors only.The size ofrworkis (lrwork).
- (local or global,pcgesvx/pzgesvxonly). The size of the arrayrwork;must be at least2.*LOCc(n_a)
- (local)Pointer into the local memory to an array of local size.lld_x*LOCc(jx+nrhs-1)If, the arrayinfo= 0xcontains the solution matrixXto theoriginalsystem of equations. Note thatAandBare modified on exit if, and the solution to theequed≠'N'equilibratedsystem is:diag(, ifC)-1*Xandtrans='N'orequed='C''B'; anddiag(, ifR)-1*Xortrans='T''C'andorequed='R''B'.
- Arrayais not modified on exit iforfact='F''N', or ifandfact='E'.equed='N'If,equed≠'N'Ais scaled on exit as follows::equed='R'A= diag(R)*A:equed='C'A=A*diag(c):equed='B'A= diag(R)*A*diag(c)
- Iforfact='N''E', thenafis an output argument and on exit returns the factorsLandUfrom the factorizationof the original matrixA=P*L*UA(if) or of the equilibrated matrixfact='N'A(if). See the description offact='E'afor the form of the equilibrated matrix.
- Overwritten bydiag(ifR)*Bandtrans='N'orequed='R''B';overwritten bydiag(ifc)*Bandtrans='T'orequed='C''B'; not changed if.equed='N'
- These arrays are output arguments if.fact≠'F'See the description ofr,cinInput Argumentssection.
- (global).An estimate of the reciprocal condition number of the matrixAafter equilibration (if done). Thefunctionsetsif the estimate underflows; in this case the matrix is singular (to working precision). However, anytimercond=0rcondis small compared to 1.0, for the working precision, the matrix may be poorly conditioned or even singular.
- (local)Arrays of sizeeach. Contain the component-wise forward and relative backward errors, respectively, for each solution vector.LOCc(n_b)Arraysferrandberrare both replicated in every process row, and are aligned with the matricesBandX.
- Iforfact='N''E', thenipivis an output argument and on exit contains the pivot indices from the factorizationof the original matrixA=P*L*UA(if) or of the equilibrated matrixfact='N'A(if).fact='E'
- If, thenfact≠'F'equedis an output argument. It specifies the form of equilibration that was done (see the description ofequedinInput Argumentssection).
- If, on exitinfo=0workreturns the minimum value oflworkrequired for optimum performance.
- If, on exitinfo=0iworkreturns the minimum value ofliworkrequired for optimum performance.
- If, on exitinfo=0rwork