Mercurial > hg > qm-dsp
diff maths/Correlation.cpp @ 499:af5b7ef02aa7
Style fixes: avoid unsigned, fix formatting
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Mon, 03 Jun 2019 14:20:39 +0100 |
parents | 701233f8ed41 |
children |
line wrap: on
line diff
--- a/maths/Correlation.cpp Mon Jun 03 14:20:07 2019 +0100 +++ b/maths/Correlation.cpp Mon Jun 03 14:20:39 2019 +0100 @@ -31,21 +31,21 @@ } -void Correlation::doAutoUnBiased(double *src, double *dst, unsigned int length) +void Correlation::doAutoUnBiased(double *src, double *dst, int length) { double tmp = 0.0; double outVal = 0.0; - unsigned int i,j; + int i, j; - for( i = 0; i < length; i++) { - for( j = i; j < length; j++) { + for (i = 0; i < length; i++) { + for (j = i; j < length; j++) { tmp += src[ j-i ] * src[ j ]; } outVal = tmp / ( length - i ); - if( outVal <= 0 ) { + if (outVal <= 0) { dst[ i ] = EPS; } else { dst[ i ] = outVal;