[Numpy-discussion] A basic question about swig and Numeric
Christopher Barker
Chris.Barker@noaa....
Wed Sep 24 17:34:10 CDT 2008
Michel Dupront wrote:
> 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.
Have you seen the SWIG typemaps that come with numpy?:
...\site-packages\numpy\doc\swig
They are designed to work with plain old fashioned C arrays(pointers),
but you can either learn form them, or write a little C++ that takes a C
pointer and size, creates a vector, and calls your existing functions.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
More information about the Numpy-discussion
mailing list