A packed storage matrix, also known as packed matrix, is a term used in programming for representing an matrix. It is a more compact way than an m-by-n rectangular array by exploiting a special structure of the matrix.

Typical examples of matrices that can take advantage of packed storage include:

Triangular packed matrices

edit

The packed storage matrix allows a matrix to be converted to an array, shrinking the matrix significantly. In doing so, a square matrix is converted to an array of length n(n+1)/2.[1]

Consider the following upper matrix:

which can be packed into the one array:

[2]


Similarly the lower matrix:

can be packed into the following one dimensional array:

[2]

Code examples (Fortran)

edit

Both of the following storage schemes are used extensively in BLAS and LAPACK.

An example of packed storage for Hermitian matrix:

complex :: A(n,n) ! a hermitian matrix
complex :: AP(n*(n+1)/2) ! packed storage for A
! the lower triangle of A is stored column-by-column in AP.
! unpacking the matrix AP to A
do j=1,n
  k = j*(j-1)/2
  A(1:j,j) = AP(1+k:j+k)
  A(j,1:j-1) = conjg(AP(1+k:j-1+k))
end do

An example of packed storage for banded matrix:

real :: A(m,n) ! a banded matrix with kl subdiagonals and ku superdiagonals
real :: AP(-kl:ku,n) ! packed storage for A
! the band of A is stored column-by-column in AP. Some elements of AP are unused.
! unpacking the matrix AP to A
do j = 1, n
  forall(i=max(1,j-kl):min(m,j+ku)) A(i,j) = AP(i-j,j)
end do
print *,AP(0,:) ! the diagonal


See also

edit

Further reading

edit

References

edit
  1. ^ Golub, Gene H.; Van Loan, Charles F. (2013). Matrix Computations (4th ed.). Baltimore, MD: Johns Hopkins University Press. p. 170. ISBN 9781421407944.
  2. ^ a b Blackford, Susan (1999-10-01). "Packed Storage". Netlib. LAPACK Users' Guide. Archived from the original on 2024-04-01. Retrieved 2024-10-01.

📚 Artikel Terkait di Wikipedia

LAPACK

value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky and Schur decomposition. The routines

Skyline matrix

skyline matrix storage, or SKS, or a variable band matrix storage, or envelope storage scheme is a form of a sparse matrix storage format matrix that reduces

Adjacency matrix

computer science, an adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices

Vectorization (mathematics)

{vec} (B)} . Duplication and elimination matrices Voigt notation Packed storage matrix Column-major order Matricization Macedo, H. D.; Oliveira, J. N.

Thermal energy storage

system is known as a packed-bed (or pebble-bed) storage unit, in which some fluid, usually air, flows through a bed of loosely packed material (usually rock

Matrix Toolkit Java

decompositions for symmetrical matrices (tridiagonal, banded, packed and dense). Orthogonal matrix decompositions for dense matrices (QR, RQ, LQ, and QL). Iterative

Tendon

(tenocytes). Tendon cells synthesize the tendon's extracellular matrix, which abounds with densely-packed collagen fibers. The collagen fibers run parallel to each

YCbCr

{\displaystyle K_{R}+K_{G}+K_{B}=1} . The equivalent matrix manipulation is often referred to as the "color matrix": [ Y ′ P B P R ] = [ K R K G K B − 1 2 ⋅ K