Calculates the solution to a system of linear equations defined by a coefficients matrix and a constants matrix.