From 313ded275104952e930d5b11fc5382ccee731b2b Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 25 Apr 2014 18:39:25 +0200 Subject: Fix velocity bug. --- src/powerlist.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/powerlist.cc b/src/powerlist.cc index 86378ca..e0809ab 100644 --- a/src/powerlist.cc +++ b/src/powerlist.cc @@ -186,14 +186,14 @@ void PowerList::finalise() power = sqrt(power); - if(power > power_max) power_max = power; - sample->power = power; } #endif/*AUTO_CALCULATE_POWER*/ item.power = sample->power; + if(item.power > power_max) power_max = item.power; + DEBUG(rand, " - power: %f\n", item.power); si++; @@ -202,6 +202,8 @@ void PowerList::finalise() Sample *PowerList::get(level_t level) { + + Sample *sample = NULL; float power = 0; @@ -210,8 +212,8 @@ Sample *PowerList::get(level_t level) float lvl = box_muller_transform(mean, stddev); - DEBUG(rand, "lvl: %f (mean: %.2f, stddev: %.2f)\n", - lvl, mean, stddev); + DEBUG(rand, "level: %f, lvl: %f (mean: %.2f, stddev: %.2f)\n", + level, lvl, mean, stddev); std::vector::iterator i = samples.begin(); while(i != samples.end()) { -- cgit v1.2.3