gneiss.util.block_diagonal

gneiss.util.block_diagonal(ncols, nrows, nblocks)[source]

Generate block diagonal with uniformly distributed values within blocks.

Parameters:
  • ncol (int) – Number of columns
  • nrows (int) – Number of rows
  • nblocks (int) – Number of blocks

Note

The number of blocks specified by nblocks needs to be greater than 1.