Ejemplo n.º 1
0
        acosh, asinh, atanh, acoth, acsch, asech, cosh, sinh, tanh, coth, sech,
        csch, atan, acsc, asin, acot, acos, asec, fresnels, fresnelc, erfc,
        erfi, Ei, uppergamma, polylog, zeta, factorial, polygamma, digamma, li,
        expint, LambertW, loggamma)
    from sympy.integrals.rubi.utility_function import (Gamma, exp, log,
                                                       ProductLog, PolyGamma,
                                                       rubi_unevaluated_expr,
                                                       process_trig)

    Operation.register(Integral)
    register_operation_iterator(Integral, lambda a:
                                (a._args[0], ) + a._args[1], lambda a: len(
                                    (a._args[0], ) + a._args[1]))

    Operation.register(Pow)
    OneIdentityOperation.register(Pow)
    register_operation_iterator(Pow, lambda a: a._args, lambda a: len(a._args))

    Operation.register(Add)
    OneIdentityOperation.register(Add)
    CommutativeOperation.register(Add)
    AssociativeOperation.register(Add)
    register_operation_iterator(Add, lambda a: a._args, lambda a: len(a._args))

    Operation.register(Mul)
    OneIdentityOperation.register(Mul)
    CommutativeOperation.register(Mul)
    AssociativeOperation.register(Mul)
    register_operation_iterator(Mul, lambda a: a._args, lambda a: len(a._args))

    Operation.register(exp)
Ejemplo n.º 2
0
if matchpy:
    from matchpy import (Operation, CommutativeOperation, AssociativeOperation,
        ManyToOneReplacer, OneIdentityOperation, CustomConstraint)
    from matchpy.expressions.functions import register_operation_iterator, register_operation_factory
    from sympy import Pow, Add, Integral, Basic, Mul, S
    from sympy.functions import (log, sin, cos, tan, cot, csc, sec, sqrt, erf,
        exp, log, gamma, acosh, asinh, atanh, acoth, acsch, asech, cosh, sinh,
        tanh, coth, sech, csch, atan, acsc, asin, acot, acos, asec, fresnels,
        fresnelc, erfc, erfi)

    Operation.register(Integral)
    register_operation_iterator(Integral, lambda a: (a._args[0],) + a._args[1], lambda a: len((a._args[0],) + a._args[1]))

    Operation.register(Pow)
    OneIdentityOperation.register(Pow)
    register_operation_iterator(Pow, lambda a: a._args, lambda a: len(a._args))

    Operation.register(Add)
    OneIdentityOperation.register(Add)
    CommutativeOperation.register(Add)
    AssociativeOperation.register(Add)
    register_operation_iterator(Add, lambda a: a._args, lambda a: len(a._args))

    Operation.register(Mul)
    OneIdentityOperation.register(Mul)
    CommutativeOperation.register(Mul)
    AssociativeOperation.register(Mul)
    register_operation_iterator(Mul, lambda a: a._args, lambda a: len(a._args))

    Operation.register(exp)