From: Neal D. Becker (ndbecker2_at_[hidden])
Date: 2004-08-16 12:34:22
I've posted a few times to the python-c++ list, but maybe this subject is of
more general interest so I'm posting here.
I'm interested in interfacing c++ algorithms (primarily for signal
processing) with python via boost-python. I'm trying to develop a library
of algorithms, but first the proper infrastructure is needed.
Specifically, a choice of underlying container to be used for passing
vectors between python and c++.
Vector processing is in my view one of the primary interests for
boost-python.Â Â ByÂ processingÂ vectors,Â theÂ overheadÂ involvedÂ withÂ pythonÂ and
the python-c++ interface becomes acceptable.
I believe a suitable container for interfacing between python and c++ is of
fundamental interest to the boost-python community.Â Â I'mÂ sureÂ thereÂ mustÂ be
a lot of interest in this subject.
I have tried to investigate 3 candidates.
So far the results are:
1) std::vector -
supports required operations (insert, erase...)
vector_indexing_suite already implemented (could be optimized more)
lacks vector arithmetic - but I just implemented this and it isn't difficult
even for an amateur like myself
already has vector arithmetic
lacks required operations (e.g., erase)
no indexing_suite (see above)
I had a hard time finding documentation.
Heavy-weight interface -> high learning curve
It appears that std::vector is a good choice.Â Â UblasÂ mightÂ beÂ betterÂ inÂ the
future, but at present it lacks some required functionality.Â Â AÂ ublas
vector does not fulfill all the requirements of Sequence.Â Â ThisÂ topicÂ is
known to ublas developers and may be addressed in the future.
Here is an initial version of vector arithmetic for std::vector:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk