support_code
nd numpy 配列と対話する関数を定義するために使用したいと思います。code
引数の内部では、FOO3(i, j, k)
表記法は機能しますが、その中でのみ機能し、support_code
.Something では機能しません:
import scipy
import scipy.weave
code = '''return_val = f(1);'''
support_code = '''int f(int i) {
return FOO3(i, i, i);
}''''
foo = scipy.arange(3**3).reshape(3,3,3)
print(scipy.weave.inline(code, ['foo'], support_code=support_code))