Python Sympy ufuncify FallingFactorial

时间:2016-12-16 19:41:02

标签: python numpy sympy factorial numpy-ufunc

我想ufuncify Sympy的FallingFactorial函数,以便它类似于数组输入上的numpy,而不仅仅是一对整数。

我尝试了以下代码:

from sympy.functions.combinatorial.factorials import FallingFactorial
from sympy.utilities.autowrap import ufuncify
from sympy.abc import A,B
FF = ufuncify((A,B), FallingFactorial(A,B))

但是我收到以下错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/sympy/utilities/autowrap.py", line 486, in ufuncify
    return autowrap(C.Equality(y[i], f(*args)), **kwargs)
  File "/usr/lib/python2.7/dist-packages/sympy/utilities/autowrap.py", line 404, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "/usr/lib/python2.7/dist-packages/sympy/utilities/autowrap.py", line 141, in wrap_code
    mod = __import__(self.module_name)
ImportError: ./wrapper_module_0.so: undefined symbol: fallingfactorial_

上面的代码是否适用于其他人或我有什么问题? 我正在使用Python 2.7和Sympy 0.7.4.1

0 个答案:

没有答案