[Numpy-discussion] A basic question about swig and Numeric
Russell E. Owen
Thu Sep 25 14:45:49 CDT 2008
In article <BAY144-W4884C4D9C7A96C6A5DB601F4450@phx.gbl>,
Michel Dupront <email@example.com> wrote:
> I am trying to use Numeric and swig but it seems that
> there are few points that I don't understand.
> The only excuse I have is that I am new to these tools.
> I have a simple example that I cannot make work the
> way I would like.
> I have a c++ function that take as argument a std::vector.
> >From python I want to call the c++ function with an array
> object. For that purpose I want to write a typemap.
Would this suffice:
This will certainly make a SWIGged function accept a list where a vector
of floats or doubles is expected (and you can expand the types of
course). I'm not sure it'll take a numpy or Numeric array of float or
double, but if not then perhaps you can read the code in std_vector.i
and see how it works.
More information about the Numpy-discussion