Write a square matrix in blocks, splitting after the first rows and columns:
The Schur complement of with respect to is . Implement three functions from Murphy's book. Assume all blocks you need to invert are invertible; you may use np.linalg.solve/inv/slogdet on blocks, but not on the full matrix .
partitioned_inverse(M, k): return assembled from its four blocks via the partitioned inverse formula built on . 1 <= k < n.
block_slogdet(M, k): return (sign, logabsdet) of using : the sign is the product of the two block signs and the log-absolute value is the sum.
bordered_inverse(A_inv, b, c): given the inverse of a symmetric matrix , a vector b of length and a scalar c, return the inverse of the matrix
in time, using the Schur complement of (the scalar ). Raise ValueError if .