comparison data/model/test/MockWaveModel.cpp @ 1326:54af1e21705c 3.0-integration

Update to use bqvec allocator for float vectors
author Chris Cannam
date Tue, 13 Dec 2016 15:23:21 +0000
parents 1309b66eff53
children 48e9f538e6e9 c0f69bddea12
comparison
equal deleted inserted replaced
1325:3aea4f7617bb 1326:54af1e21705c
24 for (auto sort: sorts) { 24 for (auto sort: sorts) {
25 m_data.push_back(generate(sort, length, pad)); 25 m_data.push_back(generate(sort, length, pad));
26 } 26 }
27 } 27 }
28 28
29 vector<float> 29 floatvec_t
30 MockWaveModel::getData(int channel, sv_frame_t start, sv_frame_t count) const 30 MockWaveModel::getData(int channel, sv_frame_t start, sv_frame_t count) const
31 { 31 {
32 sv_frame_t i = 0; 32 sv_frame_t i = 0;
33 33
34 // cerr << "MockWaveModel::getData(" << channel << "," << start << "," << count << "): "; 34 // cerr << "MockWaveModel::getData(" << channel << "," << start << "," << count << "): ";
35 35
36 vector<float> data; 36 floatvec_t data;
37 37
38 while (i < count) { 38 while (i < count) {
39 sv_frame_t idx = start + i; 39 sv_frame_t idx = start + i;
40 if (!in_range_for(m_data[channel], idx)) break; 40 if (!in_range_for(m_data[channel], idx)) break;
41 data.push_back(m_data[channel][idx]); 41 data.push_back(m_data[channel][idx]);
46 // cerr << endl; 46 // cerr << endl;
47 47
48 return data; 48 return data;
49 } 49 }
50 50
51 vector<vector<float>> 51 vector<floatvec_t>
52 MockWaveModel::getMultiChannelData(int fromchannel, int tochannel, 52 MockWaveModel::getMultiChannelData(int fromchannel, int tochannel,
53 sv_frame_t start, sv_frame_t count) const 53 sv_frame_t start, sv_frame_t count) const
54 { 54 {
55 vector<vector<float>> data(tochannel - fromchannel + 1); 55 vector<floatvec_t> data(tochannel - fromchannel + 1);
56 56
57 for (int c = fromchannel; c <= tochannel; ++c) { 57 for (int c = fromchannel; c <= tochannel; ++c) {
58 data.push_back(getData(c, start, count)); 58 data.push_back(getData(c, start, count));
59 } 59 }
60 60