Mercurial > hg > aimc
diff carfac/carfac_output.cc @ 611:0fbaf443ec82
Carfac C++ revision 3, indluding more style improvements. The output structs are now classes again, and have separate storage methods for each output structure along with flags in the Run and RunSegment methods to allow for only storing NAPs if desired.
author | alexbrandmeyer |
---|---|
date | Fri, 17 May 2013 19:52:45 +0000 |
parents | 01986636257a |
children | 586b0677aae8 |
line wrap: on
line diff
--- a/carfac/carfac_output.cc Thu May 16 17:33:23 2013 +0000 +++ b/carfac/carfac_output.cc Fri May 17 19:52:45 2013 +0000 @@ -22,16 +22,36 @@ #include "carfac_output.h" -void CARFACOutput::InitOutput(int n_ears, int n_ch, long n_tp) { +void CARFACOutput::InitOutput(int n_ears, int n_ch, int32_t n_tp) { n_ears_ = n_ears; - ears_ = new EarOutput[n_ears_]; + ears_.resize(n_ears_); for (int i = 0; i < n_ears_; i++) { - ears_[i].InitOutput(n_ch, n_tp); + ears_.at(i).InitOutput(n_ch, n_tp); } } -void CARFACOutput::MergeOutput(CARFACOutput output, long start, long length) { +void CARFACOutput::MergeOutput(CARFACOutput output, int32_t start, int32_t length) { for (int i = 0; i < n_ears_; i++){ - ears_[i].MergeOutput(output.ears_[i], start, length); + ears_.at(i).MergeOutput(output.ears_[i], start, length); } +} + +void CARFACOutput::StoreNAPOutput(int32_t timepoint, int ear, int n_ch, + FloatArray nap) { + ears_.at(ear).StoreNAPOutput(timepoint, n_ch, nap); +} + +void CARFACOutput::StoreBMOutput(int32_t timepoint, int ear, int n_ch, + FloatArray nap) { + ears_.at(ear).StoreBMOutput(timepoint, n_ch, nap); +} + +void CARFACOutput::StoreOHCOutput(int32_t timepoint, int ear, int n_ch, + FloatArray nap) { + ears_.at(ear).StoreOHCOutput(timepoint, n_ch, nap); +} + +void CARFACOutput::StoreAGCOutput(int32_t timepoint, int ear, int n_ch, + FloatArray nap) { + ears_.at(ear).StoreNAPOutput(timepoint, n_ch, nap); } \ No newline at end of file