Mercurial > hg > svcore
comparison base/test/TestColumnOp.h @ 1837:1b688ab5f1b3
Unify various vectors to our base floatvec_t type; store columns in fft model cache at their desired height so we can return a reference (speeding up the peak-frequency spectrogram in particular)
author | Chris Cannam |
---|---|
date | Thu, 09 Apr 2020 11:22:55 +0100 |
parents | 9ef1cc26024c |
children |
comparison
equal
deleted
inserted
replaced
1835:804dd0c06f0e | 1837:1b688ab5f1b3 |
---|---|
34 typedef ColumnOp C; | 34 typedef ColumnOp C; |
35 typedef ColumnOp::Column Column; | 35 typedef ColumnOp::Column Column; |
36 typedef vector<double> BinMapping; | 36 typedef vector<double> BinMapping; |
37 | 37 |
38 #ifdef REPORT | 38 #ifdef REPORT |
39 template <typename T> | 39 template <typename T, typename Alloc> |
40 void report(vector<T> v) { | 40 void report(vector<T, Alloc> v) { |
41 cerr << "Vector is: [ "; | 41 cerr << "Vector is: [ "; |
42 for (int i = 0; i < int(v.size()); ++i) { | 42 for (int i = 0; i < int(v.size()); ++i) { |
43 if (i > 0) cerr << ", "; | 43 if (i > 0) cerr << ", "; |
44 cerr << v[i]; | 44 cerr << v[i]; |
45 } | 45 } |
46 cerr << " ]\n"; | 46 cerr << " ]\n"; |
47 } | 47 } |
48 #else | 48 #else |
49 template <typename T> | 49 template <typename T, typename Alloc> |
50 void report(vector<T> ) { } | 50 void report(vector<T, Alloc> ) { } |
51 #endif | 51 #endif |
52 | 52 |
53 private slots: | 53 private slots: |
54 void applyGain() { | 54 void applyGain() { |
55 QCOMPARE(C::applyGain({}, 1.0), Column()); | 55 QCOMPARE(C::applyGain({}, 1.0), Column()); |