Mercurial > hg > audiodb
diff audioDB-internals.h @ 426:4a22a0bdf9a9 api-inversion
Deal with audioDB::UnitNorm
Deal with it by removing it completely, that is. New inline function
audiodb_l2norm_buffer(), replacing the three instances of that
functionality dotted throughout the code.
author | mas01cr |
---|---|
date | Wed, 24 Dec 2008 10:55:20 +0000 |
parents | d65410f4bb85 |
children | adaa6a688a04 |
line wrap: on
line diff
--- a/audioDB-internals.h Wed Dec 24 10:55:16 2008 +0000 +++ b/audioDB-internals.h Wed Dec 24 10:55:20 2008 +0000 @@ -110,3 +110,12 @@ } return result; } + +static inline void audiodb_l2norm_buffer(double *d, size_t dim, size_t nvectors, double *l) { + while(nvectors--) { + double *d1 = d; + double *d2 = d; + *l++ = audiodb_dot_product(d1, d2, dim); + d += dim; + } +}