I have no idea, how to properly declare/use Numeric functions in pyrex.
For example the code below causes segmentation fault:
--in pyrex--------------
[... some lines from Pyrex-0.9/Demos/numeric_demo.py x, plus: ]
cdef extern from "Numeric/arrayobject.h":
object PyArray_Contigu ousFromObject ( object, int, int, int )
def contiguous_tst ( ArrayType A ) :
if A.nd != 1 :
raise ValueError("1D array expected.")
B = PyArray_Contigu ousFromObject(< object>A,A.desc r.type,1,1)
print '***'
return B
--in python--------------
from Numeric import *
A = array((1,2,3,4, 5))
contiguous_tst( A)
My environment is 'quite new': python 2.3.3, Numeric 23.1, pyrex 0.9.
I hope you will give me some light on this problem, please.
Best regards
p.o.