Mercurial > hg > midi-score-follower
comparison src/DynamicVector.h @ 4:4a8e6a6cd224
optimised draw function in dynamic vector class. Added Gaussian lookup but not yet used.
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Fri, 19 Aug 2011 15:53:04 +0100 |
parents | 5581023e0de4 |
children | 75dcd1308658 |
comparison
equal
deleted
inserted
replaced
3:de86d77f2612 | 4:4a8e6a6cd224 |
---|---|
12 #include "stdlib.h" | 12 #include "stdlib.h" |
13 #include "ofMain.h" | 13 #include "ofMain.h" |
14 | 14 |
15 #ifndef _DYNAMIC_VECTOR | 15 #ifndef _DYNAMIC_VECTOR |
16 #define _DYNAMIC_VECTOR | 16 #define _DYNAMIC_VECTOR |
17 #define GAUSSIAN_LOOKUP_LENGTH 1000000 | |
17 | 18 |
18 class DynamicVector{ | 19 class DynamicVector{ |
19 public: | 20 public: |
20 DynamicVector(); | 21 DynamicVector(); |
21 | 22 |
24 void translateDistribution(int translationIndex); | 25 void translateDistribution(int translationIndex); |
25 typedef std::vector<double> DoubleVector; | 26 typedef std::vector<double> DoubleVector; |
26 DoubleVector array; | 27 DoubleVector array; |
27 double getMaximum(); | 28 double getMaximum(); |
28 double getIntegratedEstimate(); | 29 double getIntegratedEstimate(); |
30 double getLookupIndex(const int& i, const double& mean, const double& StdDev); | |
31 void addGaussianShapeByLookupTable(double& mean, double& StdDev, double& factor); | |
32 double gaussianLookupTable[GAUSSIAN_LOOKUP_LENGTH]; | |
33 double gaussianLookupMean, gaussianLookupStdDev; | |
34 | |
29 | 35 |
30 void drawVector(const int& minIndex, const int& maxIndex); | 36 void drawVector(const int& minIndex, const int& maxIndex); |
31 void drawConstrainedVector(const int& minIndex, const int& maxIndex, const int& minScreenIndex, const int& maxScreenIndex); | 37 void drawConstrainedVector(const int& minIndex, const int& maxIndex, const int& minScreenIndex, const int& maxScreenIndex); |
32 | 38 |
33 void addConstant(double value); | 39 void addConstant(double value); |