def test_simple(self):
        A = array([[1,0], [1,2]])
        b = [1, 1]
        sol = solve_triangular(A, b, lower=True)
        assert_array_almost_equal(sol, [1, 0])

        # check that it works also for non-contiguous matrices
        sol = solve_triangular(A.T, b, lower=False)
        assert_array_almost_equal(sol, [.5, .5])

        # and that it gives the same result as trans=1
        sol = solve_triangular(A, b, lower=True, trans=1)
        assert_array_almost_equal(sol, [.5, .5])

        b = identity(2)
        sol = solve_triangular(A, b, lower=True, trans=1)
        assert_array_almost_equal(sol, [[1., -.5], [0, 0.5]])
Raw request to upload a file ``filename``
dataset/ETHPy150Open scipy/scipy/scipy/linalg/tests/test_basic.py/TestSolveTriangular.test_simple--crossover with--dataset/ETHPy150Open shichao-an/115wangpan/u115/api.py/API._req_upload