comparison src/DynamicVector.h @ 0:b299a65a3ad0

start project
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 16 Aug 2011 11:29:59 +0100
parents
children 1a32ce016bb9
comparison
equal deleted inserted replaced
-1:000000000000 0:b299a65a3ad0
1 /*
2 * DynamicVector.h
3 * midiCannamReader
4 *
5 * Created by Andrew on 18/07/2011.
6 * Copyright 2011 QMUL. All rights reserved.
7 *
8 */
9
10 //OPTIMIZE CONSTRAINED VECTOR
11
12 #include "stdlib.h"
13 #include "ofMain.h"
14
15 #ifndef _DYNAMIC_VECTOR
16 #define _DYNAMIC_VECTOR
17
18 class DynamicVector{
19 public:
20 DynamicVector();
21
22 void createVector(int len);
23 void renormalise();
24 void translateDistribution(int translationIndex);
25 typedef std::vector<double> DoubleVector;
26 DoubleVector array;
27 double getMaximum();
28 void drawVector(const int& minIndex, const int& maxIndex);
29 void drawConstrainedVector(const int& minIndex, const int& maxIndex, const int& minScreenIndex, const int& maxScreenIndex);
30
31 void addConstant(double value);
32 void addGaussianShape(double mean, double stddev, double factor);
33 void addToIndex(int index, double constant);
34
35 void doProduct(DynamicVector& arrayOne, DynamicVector& arrayTwo);
36
37 double getIndexInRealTerms(const int& index);
38 double getRealTermsAsIndex(double value);
39
40 void printArray();
41 void zero();
42
43 void copyFromDynamicVector(const DynamicVector& dynamicVec);
44
45 //variables
46 int length, arraySize;
47 double maximumValue;
48 int MAPestimate;
49
50 double offset;
51 double scalar;//each array point is this much of the quantity
52 //i.e. array[index] contributes to (offset + scalar*index) in real terms
53
54 };
55
56 #endif