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

chemreac.util.banded.get_jac_row_from_banded(J, rows, n)[source]

Extracts a rows from a banded matrix J

Parameters:

J: 2-dimensional array

Source matrix with banded storage.

rows: sequence

indices of rows to extract

n: integer

row length