# HG changeset patch # User tomwalters # Date 1280906426 0 # Node ID d4029d3124c47c648c69f06106a91901b869f87b # Parent f75123cf39cee04c70b7cf35ee198b42c02cb48d - Better python support for signals diff -r f75123cf39ce -r d4029d3124c4 src/Support/SignalBank.h --- a/src/Support/SignalBank.h Wed Aug 04 06:41:56 2010 +0000 +++ b/src/Support/SignalBank.h Wed Aug 04 07:20:26 2010 +0000 @@ -54,31 +54,14 @@ bool Initialize(const SignalBank &input); bool Validate() const; - // Return a const reference to an individual signal. Allows for - // signal[channel][sample] referencing of SignalBanks. inline const vector &operator[](int channel) const { return signals_[channel]; }; - // Return a const reference to an individual signal. inline const vector &get_signal(int channel) const { return signals_[channel]; }; - // Return a reference to the signal vector. The reference is not - // const, so the vector is directly modifiable. In order to maintain - // consistency of the data within the filterbank, the size of this - // vector should not be changed. Changes to the vector size can be picked - // up with a call to Validate(), which will return false if the sizes of - // channle vectors are not consistent. - inline vector &get_mutable_signal(int channel) { - return signals_[channel]; - }; - - inline void set_signal(int channel, vector input) { - signals_[channel] = input; - } - inline float sample(int channel, int index) const { return signals_[channel][index]; } @@ -99,7 +82,6 @@ void set_centre_frequency(int i, float cf); bool initialized() const; int channel_count() const; - void Clear(); private: int channel_count_; int buffer_length_; diff -r f75123cf39ce -r d4029d3124c4 swig/aim_modules.i --- a/swig/aim_modules.i Wed Aug 04 06:41:56 2010 +0000 +++ b/swig/aim_modules.i Wed Aug 04 07:20:26 2010 +0000 @@ -18,6 +18,12 @@ %module aimc %include "std_string.i" %include stl.i +%include "std_vector.i" + +namespace std { + %template(FloatVector) vector; +} + %{ #include "Support/Common.h" #include "Support/Module.h" @@ -35,6 +41,7 @@ %} %include "Support/Parameters.h" +using namespace std; %include "Support/SignalBank.h" namespace aimc {