Python Sympy ufuncify FallingFactorial

216 views Asked by At

I want to ufuncify Sympy's FallingFactorial function so that it works similar to numpy on array inputs instead of just a pair of integers.

I tried the following code:

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))

But I get the following error:

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_

Does the code above work for anyone else or do I have something wrong? I'm using Python 2.7 and Sympy 0.7.4.1

0

There are 0 answers