[SciPy-user] conversion of c++ vector in weave

Michael Sorich mike_sorich at hotmail.com
Fri Oct 11 03:02:01 EDT 2002


Hi

I wish to convert a small part of my code to C++ for speed. The code is
not amenable to numeric arrays and uses lists extensively. I am thinking
about using c++ vectors in place of python lists (I presume that this
will be a lot faster than using Py::List). What little experience I have
in extending python with C/C++ is limited to using weave.

If I use vectors, is there any method to automatically convert my result
(vector< vector<int> >) to something that can be returned to python
(tuple/list/array). I believe that Boost can do this (at least the
upcoming v2, see
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/li
bs/python/doc/v2/faq.html), however I am not sure how I would be able to
integrate this with weave.inline. It does not appear obvious that there
is anything in CXX that will do this.

Any help would be appreciated.

Thanks

Michael Sorich
PhD Student
School of Pharmaceutical, Molecular and Biomedical Sciences
University of South Australia
Email: michael.sorich at postgrads.unisa.edu.au
           mike_sorich at hotmail.com



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.393 / Virus Database: 223 - Release Date: 30/09/2002
 



More information about the SciPy-User mailing list