[SciPy-user] Need very simple example showing how to return numpy array from C/C++ function

Jeremy Conlin jeremit0@gmail....
Fri Dec 28 14:44:43 CST 2007


On Dec 28, 2007 2:06 PM, Matthieu Brucher <matthieu.brucher@gmail.com>
wrote:

> Thank you, that is beginning to make more sense to one inexperienced in
> > wrapping.  There is one error that I haven't been able to work around.
> >
> > error: no match for 'operator[]' in 'result[0]'
> >
> > This comes from the memcpy line, I guess.  It looks like it is getting
> > mixed up between the $1 and the $result.
> >
>
>
> This is strange... Is there more indications like the type of result ?
>
>
There wasn't much else in the compiler messages.  I am just figuring this
out before I add it to my real code.  As such, the files I use are simple.
 I have attached them to this email.


> Do I need to apply this typemap to avoid this error or is it automatically
> > applied because the type (double) is specified?
> >
>
>
> The fact that you have a compile error shows that it is applied ;)
>
Of course!

Thanks again,
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071228/8c624efc/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_SWIG.i
Type: application/octet-stream
Size: 677 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20071228/8c624efc/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_SWIG.h
Type: application/octet-stream
Size: 526 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20071228/8c624efc/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_SWIG.cpp
Type: application/octet-stream
Size: 593 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20071228/8c624efc/attachment-0002.obj 


More information about the SciPy-user mailing list