logo       

Re: typenames.i, double * and python: msg#00116

programming.swig

Subject: Re: typenames.i, double * and python

Did you try the CVS version?

Marcelo

pav_ml@xxxxxxxxxxx wrote:

Swig v1.3.21



What Swig version are you using?

Marcelo

pav_ml@xxxxxxxxxxx wrote:


I'm new to this SWIG thing, but I've been working with Python for awhile now.
I'm having problems getting a double * to work with swig/python. I can get int
* values to work fine, but every double * I've tried (including some examples
pulled from the typenames.i file) don't seem to. I've copied my test.i,
test.c, and a sample output in this message. Also, I'm using the latest Python
(2.3.4rc1) and ditutils. Oh yeah, and Windows (against my will, I promise).
Any ideas?

test.i
-------

%module test
%include "typemaps.i"

%types(int *, short *, long *, float *, double *);

int twice(int *INPUT);
double twotimes(double *INPUT);



test.c
--------
%module test
%include "typemaps.i"

%types(int *, short *, long *, float *, double *);

int twice(int *INPUT);
double twotimes(double *INPUT);



Python session
---------------------



import _test
_test.twice(3)


6



_test.twotimes(3)


1244484.0



_test.twotimes(3.0)


1244484.0
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig






_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise