'solve_triangular on a simple 2x2 matrix.'

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])
    sol = solve_triangular(A.T, b, lower=False)
    assert_array_almost_equal(sol, [0.5, 0.5])
    sol = solve_triangular(A, b, lower=True, trans=1)
    assert_array_almost_equal(sol, [0.5, 0.5])
    b = identity(2)
    sol = solve_triangular(A, b, lower=True, trans=1)
    assert_array_almost_equal(sol, [[1.0, (-0.5)], [0, 0.5]])
