discretize.utils.inverse_2x2_block_diagonal

discretize.utils.inverse_2x2_block_diagonal(a11, a12, a21, a22)[source]

Inverts a stack of 2x2 matrices by using the inversion formula

inv(A) = (1/det(A)) * cof(A)^T

Input: A - a11, a12, a21, a22

Output: B - inverse