Block Matrix

class fastmat.Blocks

Bases: fastmat.Matrix.Matrix

\[M = \left( A_{i,j}\right)_{i,j},\]

where the \(A_{i,j}\) can be a fast transforms of any type.

>>> # import the package
>>> import fastmat as fm
>>>
>>> # define the blocks
>>> A = fm.Circulant(x_A)
>>> B = fm.Circulant(x_B)
>>> C = fm.Fourier(n)
>>> D = fm.Diag(x_D
>>>
>>> # define the block
>>> # matrix row-wise
>>> M = fm.Blocks([[A,B],[C,D]])

Assume we have two circulant matrices \(A\) and \(B\), an \(N\)-dimensional Fourier matrix \(C\) and a diagonal matrix \(D\). Then we define

\[\begin{split}M = \begin{bmatrix} A & B \\ C & D \end{bmatrix}.\end{split}\]

Todo

  • Blocks should simply skip all Zero Matrices (flag them as “None”)?
__init__

Initialize a Blocks matrix instance.

Parameters:
arrMatrices : iterable

A 2d iterable of py:class:fastmat.Matrix instances. All matrices must form a consistent grid over all instances of the 2d iterable. The inner iterable defines one row of the block matrix whereas the outer iterable defines the stacking of these rows. All inner iterables must be of same length. Further, all matrix instances in a row must have equal height and all instances in a column must have equal width.

**options : optional

Additional keyworded arguments. Supports all optional arguments supported by fastmat.Matrix.