# HG changeset patch # User Andrew N Robertson # Date 1322656504 0 # Node ID 032edf186a686fec41e395f0772b503a8b3bd4f3 # Parent 9860abc92a307048bf551d10ff97417efa841798 bug fixed on draw vector fn, likelihood drawing fine now diff -r 9860abc92a30 -r 032edf186a68 src/BayesianArrayStructure.cpp --- a/src/BayesianArrayStructure.cpp Wed Nov 30 11:48:35 2011 +0000 +++ b/src/BayesianArrayStructure.cpp Wed Nov 30 12:35:04 2011 +0000 @@ -20,7 +20,7 @@ prior.createVector(1); likelihood.createVector(1); posterior.createVector(1); - tmpPrior.createVector(1); + speedPriorValue = 1.0; speedEstimate = speedPriorValue; @@ -38,7 +38,6 @@ prior.createVector(length); likelihood.createVector(length); posterior.createVector(length); - tmpPrior.createVector(length); lastEventTime = 0; usingIntegratedTempoEstimate = true;//use max index @@ -104,12 +103,6 @@ relativeSpeedPosterior.createVector(length); tmpPosteriorForStorage.createVector(length); - tmpPrior.createVector(length); - tmpPrior.zero(); - tmpPrior.addConstant(0.1); - tmpPrior.addGaussianShape(130, 10, 0.2); - printf("TMP PRIOR TEST VECTOR\n"); - tmpPrior.printArray(); } diff -r 9860abc92a30 -r 032edf186a68 src/BayesianArrayStructure.h --- a/src/BayesianArrayStructure.h Wed Nov 30 11:48:35 2011 +0000 +++ b/src/BayesianArrayStructure.h Wed Nov 30 12:35:04 2011 +0000 @@ -42,7 +42,7 @@ double likelihoodNoise; double speedLikelihoodNoise; - DynamicVector tmpPrior; + //DynamicVector tmpPrior; DynamicVector tmpPosteriorForStorage; DynamicVector prior; DynamicVector posterior; diff -r 9860abc92a30 -r 032edf186a68 src/DynamicVector.cpp --- a/src/DynamicVector.cpp Wed Nov 30 11:48:35 2011 +0000 +++ b/src/DynamicVector.cpp Wed Nov 30 12:35:04 2011 +0000 @@ -233,10 +233,10 @@ int startInt = max(1,minIndex+1); int endInt = min(maxIndex, (int)array.size()); double heightConstant = screenHeight / maxVal; - int lastHeightPixel = heightConstant * (1 - array[startInt-1]); + int lastHeightPixel = heightConstant * (maxVal - array[startInt-1]); int newHeightPixel; for (int i = startInt;i < endInt;i++){ - newHeightPixel = (int) heightConstant * (1 - array[i]); + newHeightPixel = (int) heightConstant * (maxVal - array[i]); ofLine (stepSize*(i-1), lastHeightPixel, stepSize*i, newHeightPixel); lastHeightPixel = newHeightPixel; } diff -r 9860abc92a30 -r 032edf186a68 src/testApp.cpp --- a/src/testApp.cpp Wed Nov 30 11:48:35 2011 +0000 +++ b/src/testApp.cpp Wed Nov 30 12:35:04 2011 +0000 @@ -87,8 +87,7 @@ void testApp::draw(){ midiEvents.drawFile(); - ofSetColor(0,255,0); - midiEvents.bayesStruct.tmpPrior.drawVector(0, 200); + } //--------------------------------------------------------------