lib.utils.blockinv

lib.utils.blockinv(blocks, inv=<function inv>, check=True)

Return inverse of input blocks matrix.

Parameters
  • blocks (list of list of arrays) – Input matrix to invert, in the form of blocks, e.g. [[A,B],[C,D]].

  • inv (callable, default=np.linalg.inv) – Function that takes in 2D array and returns its inverse.

  • check (bool, default=True) – If inversion inaccurate, raise a LinAlgError (see _check_inv()).

Returns

toret – Inverse of blocks matrix.

Return type

2D array