|
From: Axel R. <Axe...@ir...> - 2006-10-23 11:14:17
|
On Sunday 22 October 2006 19:37, Eduardo Moguillansky wrote:
> so, here is a small example of the eaSDIF library in Python. This
> module reads many different types of sdif files and returns them in a
> way that makes sense. Also implemented is a parser to convert between
> 1TRC, RBEP (Loris) and the binary format from ATS (I don't include this
> yet, needs some testing). To be able to make the interaction more tight
> I would really appreciate having access to Pm2 for Linux since i'm now
> doing all the work there
> I also attach a revised version of the wrapper eaSDIF.py with most of
> the documentation in it, so you can use python's clever pydoc.
> I have only one question. I don't get to see any function to access all
> the data in a Row at the same time, so a have to read element by
> element. this is not very effective. But there are actually many
> functions that are not totally usable in Python because of many pointer
> issues where there is no type conversion implemented. That might be the
> reason. for instance. in the documentation of eaSDIF there seems to be
> a function GetRow which is not wrapped.
>
> cheers, Eduardo
The GetRow (and GetCol) function are templates.
If I compare with the basic Get function which is a template as well
I see that the template itself is not wrapped, but, the overloaded
version for float is.
So you may try to provide overloaded functions like
void GetRow(double* out,int irow) const throw (SDIFArrayPosition) {
mInter->GetRow(out,irow);
return;
}
void GetCol(double* out,int irow) const throw (SDIFArrayPosition) {
mInter->GetCol(out,irow);
return;
}
in sdif_matrix.hpp
These functions will be used instead of the template if the
argument is a double pointer. For c++ this changes nothing, but, for
swig that may help to find a proper wrapping.
If this works we may put these overloads into the next library
release to help swig.
As far as I understand we may even add these overloads
in a swig encapsulated section, so that these functions are
visible for swig only. I don't work much with swig, so I don't
know whether there is a swig macro name for such sections.
--
Axel Roebel
IRCAM Analysis/Synthesis Team
Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540
|