%PDF- %PDF-
Direktori : /lib/python3/dist-packages/sympy/matrices/tests/ |
Current File : //lib/python3/dist-packages/sympy/matrices/tests/test_densetools.py |
from sympy.testing.pytest import ignore_warnings from sympy.utilities.exceptions import SymPyDeprecationWarning with ignore_warnings(SymPyDeprecationWarning): from sympy.matrices.densetools import trace, transpose, eye from sympy import ZZ def test_trace(): a = [[ZZ(3), ZZ(7), ZZ(4)], [ZZ(2), ZZ(4), ZZ(5)], [ZZ(6), ZZ(2), ZZ(3)]] b = eye(2, ZZ) assert trace(a, ZZ) == ZZ(10) assert trace(b, ZZ) == ZZ(2) def test_transpose(): a = [[ZZ(3), ZZ(7), ZZ(4)], [ZZ(2), ZZ(4), ZZ(5)], [ZZ(6), ZZ(2), ZZ(3)]] b = eye(4, ZZ) assert transpose(a, ZZ) == ([[ZZ(3), ZZ(2), ZZ(6)], [ZZ(7), ZZ(4), ZZ(2)], [ZZ(4), ZZ(5), ZZ(3)]]) assert transpose(b, ZZ) == b