Function Repository Resource:

# BlockSubmatrices

Decompose a matrix into a comprehensive set of smaller matrices

 ResourceFunction["BlockSubmatrices"][data,{m,n}] returns a List of associations that decompose data into a complete covering set of submatrices whose elements are partitioned into non-overlapping m×n blocks.

## Details and Options

Each Association in the output list represents a block submatrix with the following keys and values:
 "BlockData" elements of the block submatrix "Offset" location of the submatrix within initial data "MatrixDimensions" dimensions of initial data "SubmatrixDimensions" flat dimensions of the submatrix
The entire list contains sufficient information for reconstructing the input matrix.
In a complete covering set, every possible m×n block appears in at least one block submatrix.
ResourceFunction["BlockSubmatrices"] takes the following options:
 "Cyclic" {True,True} determines cyclic or terminal boundary conditions for row and columns Method "MinimalCompletion" specifies how to achieve a complete cover of all possible m×n blocks
The choices for Method are as follows:
The "Atomize" method returns the exact covering of maximum cardinality where each block submatrix contains one unique block.
The "MinimalCompletion" method returns a most useful, tightly packed exact covering.
The "Lazy" method returns a covering with uniform submatrix dimensions, inexact with one or more cyclic boundary conditions.
The "Overkill" method is like the "Lazy" method, but returns more non-identical submatrices with one or more cyclic boundary conditions.

## Examples

### Basic Examples (3)

List all 2×2 blocks of a multiplication table:

 In:= Out= Check the exact covering property against "Atomize" method:

 In:= Out= Check completeness and inexactness of the "Lazy" method:

 In:= Out= ### Scope (2)

Display a partitioning in graphical form:

 In:= Out= Compare with terminal (non-cyclic) boundary conditions:

 In:= Out= ### Properties and Relations (1)

It is possible to reconstruct input matrix from any output data set:

 In:= In:= In:= Out= 