470,821 Members | 2,067 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

pyrex+Numeric

Hi,

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.pyx, plus: ]

cdef extern from "Numeric/arrayobject.h":

object PyArray_ContiguousFromObject ( object, int, int, int )

def contiguous_tst ( ArrayType A ) :

if A.nd != 1 :
raise ValueError("1D array expected.")

B = PyArray_ContiguousFromObject(<object>A,A.descr.typ e,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.
Jul 18 '05 #1
0 1115

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Marco Bubke | last post: by
reply views Thread by Chris Lambacher | last post: by
7 posts views Thread by ajikoe | last post: by
2 posts views Thread by Brian Blais | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.