SND@LHC Software
|
General linear algebra routines. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | sqminv (v, b, n, nrank, diag, next) |
Matrix inversion and solution. | |
subroutine | sqminl (v, b, n, nrank, diag, next) |
Matrix inversion for LARGE matrices. | |
subroutine | devrot (n, diag, u, v, work, iwork) |
Diagonalization. | |
subroutine | devsig (n, diag, u, b, coef) |
Calculate significances. | |
subroutine | devsol (n, diag, u, b, x, work) |
Solution by diagonalization. | |
subroutine | devinv (n, diag, u, v) |
Inversion by diagonalization. Get inverse matrix V from DIAG and U. | |
subroutine | choldc (g, n) |
Cholesky decomposition. | |
subroutine | cholsl (g, x, n) |
Solution after decomposition. | |
subroutine | cholin (g, v, n) |
Inversion after decomposition. | |
subroutine | vabdec (n, val, ilptr) |
Variable band matrix decomposition. | |
subroutine | vabmmm (n, val, ilptr) |
Variable band matrix print minimum and maximum. | |
subroutine | vabslv (n, val, ilptr, x) |
Variable band matrix solution. | |
real(mpd) function | dbdot (n, dx, dy) |
Dot product. | |
subroutine | dbaxpy (n, da, dx, dy) |
Multiply, addition. | |
subroutine | dbsvx (v, a, b, n) |
Product symmetric matrix, vector. | |
subroutine | dbsvxl (v, a, b, n) |
Product LARGE symmetric matrix, vector. | |
subroutine | dbgax (a, x, y, m, n) |
Multiply general M-by-N matrix A and N-vector X. | |
subroutine | dbavat (v, a, w, n, ms) |
A V AT product (similarity). | |
subroutine | dbmprv (lun, x, v, n) |
Print symmetric matrix, vector. | |
subroutine | dbprv (lun, v, n) |
Print symmetric matrix. | |
subroutine | heapf (a, n) |
Heap sort direct (real). | |
subroutine | sort1k (a, n) |
Quick sort 1. | |
subroutine | sort2k (a, n) |
Quick sort 2. | |
subroutine | sort2i (a, n) |
Quick sort 2 with index. | |
real(mps) function | chindl (n, nd) |
Chi2/ndf cuts. | |
subroutine | lltdec (n, c, india, nrkd, iopt) |
LLT decomposition. | |
subroutine | lltfwd (n, c, india, x) |
Forward solution. | |
subroutine | lltbwd (n, c, india, x) |
Backward solution. | |
subroutine | equdec (n, m, ls, c, india, nrkd, nrkd2) |
Decomposition of equilibrium systems. | |
subroutine | equslv (n, m, c, india, x) |
Solution of equilibrium systems (after decomposition). | |
subroutine | precon (p, n, c, cu, a, s, nrkd) |
Constrained preconditioner, decomposition. | |
subroutine | presol (p, n, cu, a, s, x, y) |
Constrained preconditioner, solution. | |
subroutine | sqmibb (v, b, n, nbdr, nbnd, inv, nrank, vbnd, vbdr, aux, vbk, vzru, scdiag, scflag) |
Bordered band matrix. | |
subroutine | sqmibb2 (v, b, n, nbdr, nbnd, inv, nrank, vbnd, vbdr, aux, vbk, vzru, scdiag, scflag) |
Band bordered matrix. | |
General linear algebra routines.
***** Collection of utility routines from V. Blobel *****
V. Blobel, Univ. Hamburg Numerical subprograms used in MP-II: matrix equations, and matrix products, double precision Solution by inversion SQMINV SQMINL for LARGE matrix, use OpenMP (CHK) Solution by diagonalization DEVROT, DEVPRT, DEFSOL,DEVINV Solution by Cholesky decomposition of symmetric matrix CHOLDC Solution by Cholesky decomposition of variable-band matrix VABDEC Solution by Cholesky decomposition of bordered band matrix SQMIBB upper/left border (CHK) SQMIBB2 lower/right border (CHK) Matrix/vector products DBDOT dot vector product DBAXPY multiplication and addition DBSVX symmetric matrix vector DBSVX LARGE symmetric matrix vector (CHK) DBGAX general matrix vector DBAVAT AVAT product DBMPRV print parameter and matrix DBPRV print matrix (CHK) Chi^2 cut values CHINDL Accurate summation (moved to pede.f90) ADDSUM Sorting HEAPF heap sort reals direct SORT1K sort 1-dim key-array (CHK) SORT2K sort 2-dim key-array SORT2I sort 2-dim key-array with index (CHK)
Definition in file mpnum.f90.
real(mps) function chindl | ( | integer(mpi), intent(in) | n, |
integer(mpi), intent(in) | nd | ||
) |
Chi2/ndf cuts.
Return limit in Chi^2/ndf for N sigmas (N=1, 2 or 3).
[in] | n | number of sigmas |
[in] | nd | ndf |
Definition at line 1800 of file mpnum.f90.
subroutine choldc | ( | real(mpd), dimension(*), intent(inout) | g, |
integer(mpi), intent(in) | n | ||
) |
Cholesky decomposition.
Cholesky decomposition of the matrix G: G = L D L^T
The sqrts of the usual Cholesky decomposition are avoided by D. Matrices L and D are stored in the place of matrix G; after the decomposition, the solution of matrix equations and the computation of the inverse of the (original) matrix G are done by CHOLSL and CHOLIN.
[in,out] | g | symmetric matrix, replaced by D,L |
[in] | n | size of matrix |
Definition at line 753 of file mpnum.f90.
subroutine cholin | ( | real(mpd), dimension(*), intent(in) | g, |
real(mpd), dimension(*), intent(out) | v, | ||
integer(mpi), intent(in) | n | ||
) |
Inversion after decomposition.
The inverse of the (original) matrix G is computed and stored in symmetric storage mode in matrix V. Arrays G and V must be different arrays.
[in] | g | decomposed symmetric matrix |
[in,out] | v | inverse matrix |
[in] | n | size of matrix |
Definition at line 845 of file mpnum.f90.
subroutine cholsl | ( | real(mpd), dimension(*), intent(in) | g, |
real(mpd), dimension(n), intent(inout) | x, | ||
integer(mpi), intent(in) | n | ||
) |
Solution after decomposition.
The matrix equation G X = B is solved for X, where the matrix G in the argument is already decomposed by CHOLDC. The vector B is called X in the argument and the content is replaced by the resulting vector X.
[in] | g | decomposed symmetric matrix |
[in,out] | x | r.h.s vector B, replaced by solution vector X |
[in] | n | size of matrix |
Definition at line 799 of file mpnum.f90.
subroutine dbavat | ( | real(mpd), dimension(*), intent(in) | v, |
real(mpd), dimension(*), intent(in) | a, | ||
real(mpd), dimension(*), intent(inout) | w, | ||
integer(mpi), intent(in) | n, | ||
integer(mpi), intent(in) | ms | ||
) |
A V AT product (similarity).
Multiply symmetric N-by-N matrix from the left with general M-by-N matrix and from the right with the transposed of the same general matrix to form symmetric M-by-M matrix (used for error propagation).
[in] | V | symmetric N-by-N matrix |
[in] | A | general M-by-N matrix |
[in,out] | W | symmetric M-by-M matrix |
[in] | MS | rows of A (-rows: don't reset W) |
[in] | N | columns of A |
Definition at line 1276 of file mpnum.f90.
subroutine dbaxpy | ( | integer(mpi), intent(in) | n, |
real(mpd), intent(in) | da, | ||
real(mpd), dimension(*), intent(in) | dx, | ||
real(mpd), dimension(*), intent(inout) | dy | ||
) |
Multiply, addition.
Constant times vector added to a vector: DY:=DY+DA*DX
[in] | n | vector size |
[in] | dx | vector |
[in,out] | dy | vector |
[in] | da | scalar |
Definition at line 1121 of file mpnum.f90.
real(mpd) function dbdot | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(*), intent(in) | dx, | ||
real(mpd), dimension(*), intent(in) | dy | ||
) |
Dot product.
[in] | n | vector size |
[in] | dx | vector |
[in] | dy | vector |
Definition at line 1090 of file mpnum.f90.
subroutine dbgax | ( | real(mpd), dimension(*), intent(in) | a, |
real(mpd), dimension(*), intent(in) | x, | ||
real(mpd), dimension(*), intent(out) | y, | ||
integer(mpi), intent(in) | m, | ||
integer(mpi), intent(in) | n | ||
) |
Multiply general M-by-N matrix A and N-vector X.
[in] | A | general M-by-N matrix (A11 A12 ... A1N A21 A22 ...) |
[in] | X | N vector |
[out] | Y | = M vector |
[in] | M | rows of A |
[in] | N | columns of A |
Definition at line 1239 of file mpnum.f90.
subroutine dbmprv | ( | integer(mpi), intent(in) | lun, |
real(mpd), dimension(*), intent(in) | x, | ||
real(mpd), dimension(*), intent(in) | v, | ||
integer(mpi), intent(in) | n | ||
) |
Print symmetric matrix, vector.
Prints the n-vector X and the symmetric N-by-N covariance matrix V, the latter as a correlation matrix.
[in] | lun | unit number |
[in] | x | vector |
[in] | v | symmetric matrix |
[in] | n | size of matrix, vector |
Definition at line 1348 of file mpnum.f90.
subroutine dbprv | ( | integer(mpi), intent(in) | lun, |
real(mpd), dimension(*), intent(in) | v, | ||
integer(mpi), intent(in) | n | ||
) |
Print symmetric matrix.
Prints the symmetric N-by-N matrix V.
[in] | lun | unit number |
[in] | v | symmetric matrix |
[in] | n | size of matrix, |
Definition at line 1423 of file mpnum.f90.
subroutine dbsvx | ( | real(mpd), dimension(*), intent(in) | v, |
real(mpd), dimension(*), intent(in) | a, | ||
real(mpd), dimension(*), intent(out) | b, | ||
integer(mpi), intent(in) | n | ||
) |
Product symmetric matrix, vector.
Multiply symmetric N-by-N matrix and N-vector.
[in] | v | symmetric matrix |
[in] | a | vector |
[out] | b | vector B = V * A |
[in] | n | size of matrix |
Definition at line 1152 of file mpnum.f90.
subroutine dbsvxl | ( | real(mpd), dimension(*), intent(in) | v, |
real(mpd), dimension(*), intent(in) | a, | ||
real(mpd), dimension(*), intent(out) | b, | ||
integer(mpi), intent(in) | n | ||
) |
Product LARGE symmetric matrix, vector.
Multiply LARGE symmetric N-by-N matrix and N-vector:
[in] | v | symmetric matrix |
[in] | a | vector |
[out] | b | product vector B = V * A |
[in] | n | size of matrix |
Definition at line 1196 of file mpnum.f90.
subroutine devinv | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(n), intent(in) | diag, | ||
real(mpd), dimension(n,n), intent(in) | u, | ||
real(mpd), dimension(*), intent(out) | v | ||
) |
Inversion by diagonalization. Get inverse matrix V from DIAG and U.
[in] | N | size of matrix |
[in] | DIAG | diagonal elements |
[in] | U | transformation matrix |
[out] | V | smmmetric matrix |
Definition at line 704 of file mpnum.f90.
subroutine devrot | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(n), intent(out) | diag, | ||
real(mpd), dimension(n,n), intent(out) | u, | ||
real(mpd), dimension(*), intent(in) | v, | ||
real(mpd), dimension(n), intent(out) | work, | ||
integer(mpi), dimension(n), intent(out) | iwork | ||
) |
Diagonalization.
Determination of eigenvalues and eigenvectors of symmetric matrix V by Householder method
[in] | n | size of matrix |
[out] | diag | diagonal elements |
[out] | u | transformation matrix |
[in] | v | symmetric matrix, unchanged |
[out] | work | work array |
[out] | iwork | work array |
Definition at line 377 of file mpnum.f90.
subroutine devsig | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(n), intent(in) | diag, | ||
real(mpd), dimension(n,n), intent(in) | u, | ||
real(mpd), dimension(n), intent(in) | b, | ||
real(mpd), dimension(n), intent(out) | coef | ||
) |
Calculate significances.
Definition at line 619 of file mpnum.f90.
subroutine devsol | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(n), intent(in) | diag, | ||
real(mpd), dimension(n,n), intent(in) | u, | ||
real(mpd), dimension(n), intent(in) | b, | ||
real(mpd), dimension(n), intent(out) | x, | ||
real(mpd), dimension(n), intent(out) | work | ||
) |
Solution by diagonalization.
Solution of matrix equation V * X = B after diagonalization of V.
[in] | N | size of matrix |
[in] | DIAG | diagonal elements |
[in] | U | transformation matrix |
[in] | B | r.h.s. of matrix equation (unchanged) |
[out] | X | solution vector |
[out] | WORK | work array |
Definition at line 657 of file mpnum.f90.
subroutine equdec | ( | integer(mpi), intent(in) | n, |
integer(mpi), intent(in) | m, | ||
integer(mpi), intent(in) | ls, | ||
real(mpd), dimension(*), intent(inout) | c, | ||
integer(mpi), dimension(n+m), intent(inout) | india, | ||
integer(mpi), intent(out) | nrkd, | ||
integer(mpi), intent(out) | nrkd2 | ||
) |
Decomposition of equilibrium systems.
N x N matrix C: starting with sym.pos.def. matrix (N) length of array C: INDIA(N) + N*M + (M*M+M)/2 Content of array C: band matrix, as described by INDIA(1)...INDIA(N) followed by: NxM elements of constraint matrix A followed by: (M*M+M)/2 unused elements INDIA(N+1)...INDIA(N+M) defined internally
[in] | n | size of symmetric matrix |
[in] | m | number of constrains |
[in] | ls | flag for skyline decomposition |
[in,out] | c | combined variable-band + constraints matrix, replaced by decomposition |
[in,out] | india | pointer array |
[out] | nrkd | removed components |
[out] | nrkd2 | removed components |
Definition at line 2034 of file mpnum.f90.
subroutine equslv | ( | integer(mpi), intent(in) | n, |
integer(mpi), intent(in) | m, | ||
real(mpd), dimension(*), intent(in) | c, | ||
integer(mpi), dimension(n+m), intent(in) | india, | ||
real(mpd), dimension(n+m), intent(inout) | x | ||
) |
Solution of equilibrium systems (after decomposition).
N x N matrix C: starting with sym.pos.def. matrix (N) length of array C: INDIA(N) + N*M + (M*M+M)/2 Content of array C: band matrix, as described by INDIA(1)...INDIA(N) followed by: NxM elements of constraint matrix A followed by: (M*M+M)/2 unused elements INDIA(N+1)...INDIA(N+M) defined internally
[in] | n | size of symmetric matrix |
[in] | m | number of constrains |
[in] | c | decomposed combined variable-band + constraints matrix |
[in] | india | pointer array |
[in,out] | x | r.h.s vector B, replaced by solution vector X |
Definition at line 2100 of file mpnum.f90.
subroutine heapf | ( | real(mps), dimension(*), intent(inout) | a, |
integer(mpi), intent(in) | n | ||
) |
Heap sort direct (real).
Real keys A(*), sorted at return.
[in,out] | a | array of keys |
[in] | n | number of keys |
Definition at line 1467 of file mpnum.f90.
subroutine lltbwd | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(*), intent(in) | c, | ||
integer(mpi), dimension(n), intent(in) | india, | ||
real(mpd), dimension(n), intent(inout) | x | ||
) |
Backward solution.
The matrix equation A X = B is solved by forward + backward solution. The matrix is assumed to decomposed before using LLTDEC. The array X(N) contains on entry the right-hand-side B(N); at return it contains the solution.
[in] | n | size of matrix |
[in,out] | c | decomposed variable-band matrix |
[in] | india | pointer array |
[in,out] | x | r.h.s vector B, replaced by solution vector X |
Definition at line 1994 of file mpnum.f90.
subroutine lltdec | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(*), intent(inout) | c, | ||
integer(mpi), dimension(n), intent(in) | india, | ||
integer(mpi), intent(out) | nrkd, | ||
integer(mpi), intent(in) | iopt | ||
) |
LLT decomposition.
Decomposition: C = L L^T.
Variable-band matrix row-Doolittle decomposition of pos. def. matrix. A variable-band NxN symmetric matrix, is stored row by row in the array C(.). For each row all coefficients from the first non-zero element in the row to the diagonal is stored. The pointer array INDIA(N) contains the indices in C(.) of the diagonal elements. INDIA(1) is always 1, and INDIA(N) is equal to the total number of coefficients stored, called the profile. The form of a variable-band matrix is preserved in the L D L^T decomposition. No fill-in is created ahead in any row or ahead of the first entry in any column, but existing zero-values will become non-zero. The decomposition is done "in-place". (The diagonal will contain the inverse of the diaginal of L).
The matrix C is assumed to be positive definite, e.g. from the normal equations of least squares. The (positive) diagonal elements are reduced during decomposition. If a diagonal element is reduced by about a word length (see line "test for linear dependence"), then the pivot is assumed as zero and the entire row/column is reset to zero, removing the corresponding element from the solution. Optionally use only diagonal element in this case to preserve rank (changing band to skyline matrix).
[in] | n | size of matrix |
[in,out] | c | variable-band matrix, replaced by L |
[in] | india | pointer array |
[out] | nrkd | removed components |
[in] | iopt | >0: use diagonal to preserve rank ('skyline') |
Definition at line 1877 of file mpnum.f90.
subroutine lltfwd | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(*), intent(in) | c, | ||
integer(mpi), dimension(n), intent(in) | india, | ||
real(mpd), dimension(n), intent(inout) | x | ||
) |
Forward solution.
The matrix equation A X = B is solved by forward + backward solution. The matrix is assumed to decomposed before using LLTDEC. The array X(N) contains on entry the right-hand-side B(N); at return it contains the solution.
[in] | n | size of matrix |
[in,out] | c | decomposed variable-band matrix |
[in] | india | pointer array |
[in,out] | x | r.h.s vector B, replaced by solution vector X |
Definition at line 1959 of file mpnum.f90.
subroutine precon | ( | integer(mpi), intent(in) | p, |
integer(mpi), intent(in) | n, | ||
real(mpd), dimension(n), intent(in) | c, | ||
real(mpd), dimension(n), intent(out) | cu, | ||
real(mpd), dimension(n,p), intent(inout) | a, | ||
real(mpd), dimension((p*p+p)/2), intent(out) | s, | ||
integer(mpi), intent(out) | nrkd | ||
) |
Constrained preconditioner, decomposition.
Constrained preconditioner, e.g for GMRES solution: intermediate ( ) ( ) ( ) ( ) ( C A^T ) ( x ) = ( y ) ( u ) ( ) ( ) ( ) ( ) ( A 0 ) ( l ) ( d ) ( v ) input: C(N) is diagonal matrix and remains unchanged may be identical to CU(N), then it is changed A(N,P) is modified Y(N+P) is rhs vector, unchanged may be identical to X(N), then it is changed result: CU(N) is 1/sqrt of diagonal matrix C(N) X(N+P) is result vector S((P*P+P)/2) is Cholesky decomposed symmetric (P,P) matrix
[in] | p | number of constraints |
[in] | n | size of diagonal matrix |
[in] | c | diagonal matrix (changed if c=cu as actual parameters) |
[out] | cu | 1/sqrt(c) |
[in,out] | a | constraint matrix (size n*p), modified |
[out] | s | Cholesky decomposed symmetric (P,P) matrix |
[out] | nrkd | removed components |
Definition at line 2171 of file mpnum.f90.
subroutine presol | ( | integer(mpi), intent(in) | p, |
integer(mpi), intent(in) | n, | ||
real(mpd), dimension(n), intent(in) | cu, | ||
real(mpd), dimension(n,p), intent(in) | a, | ||
real(mpd), dimension((p*p+p)/2), intent(in) | s, | ||
real(mpd), dimension(n+p), intent(out) | x, | ||
real(mpd), dimension(n+p), intent(in) | y | ||
) |
Constrained preconditioner, solution.
[in] | p | number of constraints |
[in] | n | size of diagonal matrix |
[in] | cu | 1/sqrt(c) |
[in] | a | modified constraint matrix (size n*p) |
[in] | s | Cholesky decomposed symmetric (P,P) matrix |
[out] | x | result vector |
[in] | y | rhs vector (changed if x=y as actual parameters) |
Definition at line 2245 of file mpnum.f90.
subroutine sort1k | ( | integer(mpi), dimension(*), intent(inout) | a, |
integer(mpi), intent(in) | n | ||
) |
Quick sort 1.
Quick sort of A(1,N) integer.
[in,out] | a | vector of integers, sorted at return |
[in] | n | size of vector |
Definition at line 1522 of file mpnum.f90.
subroutine sort2i | ( | integer(mpi), dimension(3,*), intent(inout) | a, |
integer(mpi), intent(in) | n | ||
) |
Quick sort 2 with index.
Quick sort of A(3,N) integer.
[in,out] | a | vector (pair) of integers, sorted at return and an index |
[in] | n | size of vector |
Definition at line 1700 of file mpnum.f90.
subroutine sort2k | ( | integer(mpi), dimension(2,*), intent(inout) | a, |
integer(mpi), intent(in) | n | ||
) |
Quick sort 2.
Quick sort of A(2,N) integer.
[in,out] | a | vector (pair) of integers, sorted at return |
[in] | n | size of vector |
Definition at line 1607 of file mpnum.f90.
subroutine sqmibb | ( | real(mpd), dimension(*), intent(inout) | v, |
real(mpd), dimension(n), intent(out) | b, | ||
integer(mpi), intent(in) | n, | ||
integer(mpi), intent(in) | nbdr, | ||
integer(mpi), intent(in) | nbnd, | ||
integer(mpi), intent(in) | inv, | ||
integer(mpi), intent(out) | nrank, | ||
real(mpd), dimension(n*(nbnd+1)), intent(out) | vbnd, | ||
real(mpd), dimension(n*nbdr), intent(out) | vbdr, | ||
real(mpd), dimension(n*nbdr), intent(out) | aux, | ||
real(mpd), dimension((nbdr*nbdr+nbdr)/2), intent(out) | vbk, | ||
real(mpd), dimension(nbdr), intent(out) | vzru, | ||
real(mpd), dimension(nbdr), intent(out) | scdiag, | ||
integer(mpi), dimension(nbdr), intent(out) | scflag | ||
) |
Bordered band matrix.
Obtain solution of a system of linear equations with symmetric bordered band matrix (V * X = B), on request inverse is calculated. For band part root-free Cholesky decomposition and forward/backward substitution is used.
Use decomposition in border and band part for block matrix algebra:
| A Ct | | x1 | | b1 | , A is the border part | | * | | = | | , Ct is the mixed part | C D | | x2 | | b2 | , D is the band part
Explicit inversion of D is avoided by using solution X of D*X=C (X=D^-1*C, obtained from Cholesky decomposition and forward/backward substitution)
| x1 | | E*b1 - E*Xt*b2 | , E^-1 = A-Ct*D^-1*C = A-Ct*X | | = | | | x2 | | x - X*x1 | , x is solution of D*x=b2 (x=D^-1*b2)
Inverse matrix is:
| E -E*Xt | | | , only band part of (D^-1 + X*E*Xt) | -X*E D^-1 + X*E*Xt | is calculated for inv=1
[in,out] | v | symmetric N-by-N matrix in symmetric storage mode (V(1) = V11, V(2) = V12, V(3) = V22, V(4) = V13, ...), replaced by inverse matrix |
[in,out] | b | N-vector, replaced by solution vector |
[in] | n | size of V, B |
[in] | nbdr | border size |
[in] | nbnd | band width |
[in] | inv | =1 calculate band part of inverse (for pulls), >1 calculate complete inverse |
[out] | nrank | rank of matrix V |
[out] | vbnd | band part of V |
[out] | vbdr | border part of V |
[out] | aux | solutions for border rows |
[out] | vbk | matrix for border solution |
[out] | vzru | border solution |
[out] | scdiag | workspace (D) |
[out] | scflag | workspace (I) |
Definition at line 2354 of file mpnum.f90.
subroutine sqmibb2 | ( | real(mpd), dimension(*), intent(inout) | v, |
real(mpd), dimension(n), intent(out) | b, | ||
integer(mpi), intent(in) | n, | ||
integer(mpi), intent(in) | nbdr, | ||
integer(mpi), intent(in) | nbnd, | ||
integer(mpi), intent(in) | inv, | ||
integer(mpi), intent(out) | nrank, | ||
real(mpd), dimension(n*(nbnd+1)), intent(out) | vbnd, | ||
real(mpd), dimension(n*nbdr), intent(out) | vbdr, | ||
real(mpd), dimension(n*nbdr), intent(out) | aux, | ||
real(mpd), dimension((nbdr*nbdr+nbdr)/2), intent(out) | vbk, | ||
real(mpd), dimension(nbdr), intent(out) | vzru, | ||
real(mpd), dimension(nbdr), intent(out) | scdiag, | ||
integer(mpi), dimension(nbdr), intent(out) | scflag | ||
) |
Band bordered matrix.
Obtain solution of a system of linear equations with symmetric band bordered matrix (V * X = B), on request inverse is calculated. For band part root-free Cholesky decomposition and forward/backward substitution is used.
Use decomposition in band and border part for block matrix algebra:
| A Ct | | x1 | | b1 | , A is the band part | | * | | = | | , Ct is the mixed part | C D | | x2 | | b2 | , D is the border part
[in,out] | v | symmetric N-by-N matrix in symmetric storage mode (V(1) = V11, V(2) = V12, V(3) = V22, V(4) = V13, ...), replaced by inverse matrix |
[in,out] | b | N-vector, replaced by solution vector |
[in] | n | size of V, B |
[in] | nbdr | border size |
[in] | nbnd | band width |
[in] | inv | =1 calculate band part of inverse (for pulls), >1 calculate complete inverse |
[out] | nrank | rank of matrix V |
[out] | vbnd | band part of V |
[out] | vbdr | border part of V |
[out] | aux | solutions for border rows |
[out] | vbk | matrix for border solution |
[out] | vzru | border solution |
[out] | scdiag | workspace (D) |
[out] | scflag | workspace (I) |
Definition at line 2610 of file mpnum.f90.
subroutine sqminl | ( | real(mpd), dimension(*), intent(inout) | v, |
real(mpd), dimension(n), intent(out) | b, | ||
integer(mpi), intent(in) | n, | ||
integer(mpi), intent(out) | nrank, | ||
real(mpd), dimension(n), intent(out) | diag, | ||
integer(mpi), dimension(n), intent(out) | next | ||
) |
Matrix inversion for LARGE matrices.
Like SQMINV, additional parallelization with OpenMP.
[in,out] | V | symmetric N-by-N matrix in symmetric storage mode (V(1) = V11, V(2) = V12, V(3) = V22, V(4) = V13, ...), replaced by inverse matrix |
[in,out] | B | N-vector, replaced by solution vector |
[in] | N | size of V, B |
[out] | NRANK | rank of matrix V |
[out] | DIAG | double precision scratch array |
[out] | NEXT | integer aux array |
Definition at line 224 of file mpnum.f90.
subroutine sqminv | ( | real(mpd), dimension(*), intent(inout) | v, |
real(mpd), dimension(n), intent(out) | b, | ||
integer(mpi), intent(in) | n, | ||
integer(mpi), intent(out) | nrank, | ||
real(mpd), dimension(n), intent(out) | diag, | ||
integer(mpi), dimension(n), intent(out) | next | ||
) |
Matrix inversion and solution.
Obtain solution of a system of linear equations with symmetric matrix (V * X = B) and the inverse.
Method of solution is by elimination selecting the pivot on the diagonal each stage. The rank of the matrix is returned in NRANK. For NRANK ne N, all remaining rows and cols of the resulting matrix V and the corresponding elements of B are set to zero.
[in,out] | V | symmetric N-by-N matrix in symmetric storage mode (V(1) = V11, V(2) = V12, V(3) = V22, V(4) = V13, ...), replaced by inverse matrix |
[in,out] | B | N-vector, replaced by solution vector |
[in] | N | size of V, B |
[out] | NRANK | rank of matrix V |
[out] | DIAG | double precision scratch array |
[out] | NEXT | INTEGER(mpi) aux array |
Definition at line 93 of file mpnum.f90.
subroutine vabdec | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(*), intent(inout) | val, | ||
integer(mpi), dimension(n), intent(in) | ilptr | ||
) |
Variable band matrix decomposition.
Decomposition: A = L D L^T
Variable-band matrix row Doolittle decomposition. A variable-band NxN symmetric matrix, also called skyline, is stored row by row in the array VAL(.). For each row every coefficient between the first non-zero element in the row and the diagonal is stored. The pointer array ILPTR(N) contains the indices in VAL(.) of the diagonal elements. ILPTR(1) is always 1, and ILPTR(N) is equal to the total number of coefficients stored, called the profile. The form of a variable-band matrix is preserved in the L D L^T decomposition no fill-in is created ahead in any row or ahead of the first entry in any column, but existing zero-values will become non-zero. The decomposition is done "in-place".
[in] | n | size of matrix |
[in,out] | val | variable-band matrix, replaced by D,L |
[in] | ilptr | pointer array |
Definition at line 900 of file mpnum.f90.
subroutine vabmmm | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(*), intent(inout) | val, | ||
integer(mpi), dimension(n), intent(in) | ilptr | ||
) |
Variable band matrix print minimum and maximum.
[in] | n | size of matrix |
[in,out] | val | variable-band matrix, replaced by D,L |
[in] | ilptr | pointer array |
Definition at line 1012 of file mpnum.f90.
subroutine vabslv | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(*), intent(inout) | val, | ||
integer(mpi), dimension(n), intent(in) | ilptr, | ||
real(mpd), dimension(n), intent(inout) | x | ||
) |
Variable band matrix solution.
The matrix equation A X = B is solved. The matrix is assumed to decomposed before using VABDEC. The array X(N) contains on entry the right-hand-side B(N); at return it contains the solution.
[in] | n | size of matrix |
[in,out] | val | decomposed variable-band matrix |
[in] | ilptr | pointer array |
[in,out] | x | r.h.s vector B, replaced by solution vector X |
Definition at line 1049 of file mpnum.f90.