The do_computations function attempts to compute the multiplicative inverse of a square matrix. When the matrix is not invertible (i.e., its determinant is 0), the following error is raised: numpy.linalg.LinAlgError: Singular matrix
The fix for this is to simply compute the pseudo-inverse, which does not require the matrix to be invertible.
The
do_computations
function attempts to compute the multiplicative inverse of a square matrix. When the matrix is not invertible (i.e., its determinant is 0), the following error is raised:numpy.linalg.LinAlgError: Singular matrix
The fix for this is to simply compute the pseudo-inverse, which does not require the matrix to be invertible.