def check_case(self, a, b, q, r):

        x = solve_discrete_are(a, b, q, r)
        assert_array_almost_equal(
            a.getH()*x*a-(a.getH()*x*b)*inv(r+b.getH()*x*b)*(b.getH()*x*a)+q-x, 0.0)
Checks if X = A'XA-(A'XB)(R+B'XB)^-1(B'XA)+Q) is true
dataset/ETHPy150Open scipy/scipy/scipy/linalg/tests/test_solvers.py/TestSolveDiscreteARE.check_case