Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(14)  |  Derive(0)  |  Import(0)

src/s/y/sympy-0.7.5/sympy/matrices/tests/test_matrices.py   sympy(Download)
def test_diagonal_symmetrical():
    m = Matrix(2, 2, [0, 1, 1, 0])
    assert not m.is_diagonal()
    assert m.is_symmetric()
    assert m.is_symmetric(simplify=False)
 
    m = Matrix(2, 2, [1, 0, 0, 1])
    assert m.is_diagonal()
 
    m = diag(1, 2, 3)
    assert m.is_diagonal()
    assert m.is_symmetric()
 
    m = Matrix(2, 3, zeros(2, 3))
    assert not m.is_symmetric()
    assert m.is_diagonal()
 
    m = Matrix(((5, 0), (0, 6), (0, 0)))
    assert m.is_diagonal()

src/s/y/sympy-HEAD/sympy/matrices/tests/test_matrices.py   sympy(Download)
def test_diagonal_symmetrical():
    m = Matrix(2, 2, [0, 1, 1, 0])
    assert not m.is_diagonal()
    assert m.is_symmetric()
    assert m.is_symmetric(simplify=False)
 
    m = Matrix(2, 2, [1, 0, 0, 1])
    assert m.is_diagonal()
 
    m = diag(1, 2, 3)
    assert m.is_diagonal()
    assert m.is_symmetric()
 
    m = Matrix(2, 3, zeros(2, 3))
    assert not m.is_symmetric()
    assert m.is_diagonal()
 
    m = Matrix(((5, 0), (0, 6), (0, 0)))
    assert m.is_diagonal()