예제 #1
0
def test_diff():
    from sympy.abc import x, y, z
    md = MutableDenseNDimArray([[x, y], [x*z, x*y*z]])
    assert md.diff(x) == MutableDenseNDimArray([[1, 0], [z, y*z]])

    sd = MutableSparseNDimArray(md)
    assert sd == MutableSparseNDimArray([x, y, x*z, x*y*z], (2, 2))
    assert sd.diff(x) == MutableSparseNDimArray([[1, 0], [z, y*z]])
예제 #2
0
def test_diff():
    from sympy.abc import x, y, z
    md = MutableDenseNDimArray([[x, y], [x * z, x * y * z]])
    assert md.diff(x) == MutableDenseNDimArray([[1, 0], [z, y * z]])

    sd = MutableSparseNDimArray(md)
    assert sd == MutableSparseNDimArray([x, y, x * z, x * y * z], (2, 2))
    assert sd.diff(x) == MutableSparseNDimArray([[1, 0], [z, y * z]])