buds
0.1
FORTRAN reference counted types
|
Fold a sparse matrix to form a smaller sparse matrix. More...
Private Member Functions | |
subroutine | fold_ (from, nr, nc, to, single) |
Fold a sparse matrix to form a smaller sparse matrix.
Reduce the size of a sparse matrix by folding ir -> mod(ir-1, nnr) + 1
with nnr
being the new number of rows.
If the folding reduces the matrix dimensions by half (for a matrix with even number of rows and columns) it will correspond to the following operation:
\begin{align*} \mathbf M_{\mathrm{old}} &= \begin{bmatrix} \mathbf A & \mathbf B \\{} \mathbf C & \mathbf D \end{bmatrix} \\{} \mathbf M_{\mathrm{new}} &= \mathbf A + \mathbf B + \mathbf C + \mathbf D \end{align*}
Both the number of rows and/or columns may changed individually.