chemreac.util.banded¶
this module contains functions to deal with banded matrices.
- chemreac.util.banded.get_banded(A, n, N, order='C', padded=False)[source]¶
Turns a dense matrix (n*N)*(n*N) into a banded matrix including the diagonal and n super-diagonals and n sub-diagonals
Parameters: A: 2-dimensional square matrix
n: int
sub-block dimension
N: int
number of super-blocks
order: {‘C’, ‘F’}, optional
C- or Fortran-contiguous
padded: bool, optional
default: False, if True: A is padded with n rows along the top
Raises: ValueError on mismatch of A.shape and n*N