Beispiel #1
0
def test_Function():
    f = Function('f')
    fx = f(x)
    w = WildFunction('w')
    assert str(f) == "f"
    assert str(fx) == "f(x)"
    assert str(w) == "w_"
Beispiel #2
0
def test_functions_X1():
    from sympy.core.function import WildFunction
    x = Symbol('x')
    g = WildFunction('g')
    p = Wild('p')
    q = Wild('q')

    f = cos(5 * x)
    assert f.match(p * g(q * x)) == {p: 1, g: cos, q: 5}
Beispiel #3
0
def test_functions_X1():
    from sympy.core.function import WildFunction

    x = Symbol("x")
    g = WildFunction("g")
    p = Wild("p")
    q = Wild("q")

    f = cos(5 * x)
    assert f.match(p * g(q * x)) == {p: 1, g: cos, q: 5}
Beispiel #4
0
def test_functions():
    from sympy.core.function import WildFunction
    x = Symbol('x')
    g = WildFunction('g')
    p = Wild('p')
    q = Wild('q')

    f = cos(5 * x)
    notf = x
    assert f.match(p * cos(q * x)) == {p: 1, q: 5}
    assert f.match(p * g) == {p: 1, g: cos(5 * x)}
    assert notf.match(g) is None
Beispiel #5
0
def test_functions():
    from sympy.core.function import WildFunction

    x = Symbol("x")
    g = WildFunction("g")
    p = Wild("p")
    q = Wild("q")

    f = cos(5 * x)
    notf = x
    assert f.match(p * cos(q * x)) == {p: 1, q: 5}
    assert f.match(p * g) == {p: 1, g: cos(5 * x)}
    assert notf.match(g) is None
Beispiel #6
0
 def __call__(self, *args, **assumptions):
     from sympy.core.function import WildFunction
     return WildFunction(self.name, nargs=len(args))(*args, **assumptions)
Beispiel #7
0
def test_sympy__core__function__WildFunction():
    from sympy.core.function import WildFunction
    assert _test_args(WildFunction('f'))
Beispiel #8
0
def test_WildFunction():
    sT(WildFunction('w'), "WildFunction('w')")