162 Stars
Updated Last
12 Months Ago
Started In
May 2016


Build Status codecov Aqua QA

A block array is a partition of an array into blocks or subarrays, see wikipedia for a more extensive description. This package has two purposes. Firstly, it defines an interface for an AbstractBlockArray block arrays that can be shared among types representing different types of block arrays. The advantage to this is that it provides a consistent API for block arrays.

Secondly, it also implements two different type of block arrays that follow the AbstractBlockArray interface. The type BlockArray stores each block contiguously while the type PseudoBlockArray stores the full matrix contiguously. This means that BlockArray supports fast non copying extraction and insertion of blocks while PseudoBlockArray supports fast access to the full matrix to use in in for example a linear solver.

A simple way to produce BlockArrays is via mortar, which combines an array of arrays into a BlockArray:

julia> mortar([randn(3), randn(4)])
2-blocked 7-element BlockVector{Float64}:

julia> mortar(reshape([randn(2,2), randn(1,2), randn(2,3), randn(1,3)],2,2))
2×2-blocked 3×5 BlockMatrix{Float64}:
 -1.17797    0.3597380.87676    -2.06495    1.74256 
  1.54787    1.64133-0.0416484  -2.00241   -0.522441
  0.430093  -0.0263753-1.31275     0.278447  -0.139579


  • STABLEmost recently tagged version of the documentation.
  • LATESTin-development version of the documentation.


Possible ways of contributing to this package include:

  • Implement the fusing broadcasting interface for blocked arrays.
  • Make different Linear Algebra function (like matrix / vector multiplications) with blocked arrays work.
  • Implement different reductions functionalities, (sum and co.).
  • Audit the performance and make improvements as needed.