go-v.orgcodex
Menu
Page tools

codex · Philosophy

Packed storage matrix

A packed storage matrix, also known as packed matrix, is a term used in programming for representing an m×n 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:

symmetric or hermitian matrix Triangular matrix Banded matrix.

== Triangular packed matrices == The packed storage matrix allows a matrix to be converted to an array, shrinking the matrix significantly. In doing so, a square n×n matrix is converted to an array of length ⁠n(n+1)/2⁠. Consider the following upper matrix:

𝐔=(a11a12a13a14a22a23a24a33a34a44) which can be packed into the one array:

𝐔𝐏=(a11⏟ a12 a22⏟ a13 a23 a33⏟ a14, a24 a34 a44⏟)

Similarly the lower matrix:

𝐋=(a11a21a22a31a32a33a41a42a43a44). can be packed into the following one dimensional array:

LP=(a11 a21 a31 a41⏟ a22 a32 a42⏟ a33 a43⏟ a44⏟)

== Code examples (Fortran) == Both of the following storage schemes are used extensively in BLAS and LAPACK. An example of packed storage for Hermitian matrix:

An example of packed storage for banded matrix:

== See also == Sparse matrix Skyline matrix band matrix

== Further reading == https://www.netlib.org/lapack/lug/ https://www.netlib.org/blas/ https://github.com/numericalalgorithmsgroup/LAPACK_Examples

== References ==

Wikipedia contributors, "Packed storage matrix", Wikipedia, revision 1285634819, retrieved 21 November 2026, source, CC BY-SA 4.0.

More Philosophy · Search the codex