Mercurial > hg > audiodb
comparison 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 |
comparison
equal
deleted
inserted
replaced
425:d65410f4bb85 | 426:4a22a0bdf9a9 |
---|---|
108 while(count--) { | 108 while(count--) { |
109 result += *p++ * *q++; | 109 result += *p++ * *q++; |
110 } | 110 } |
111 return result; | 111 return result; |
112 } | 112 } |
113 | |
114 static inline void audiodb_l2norm_buffer(double *d, size_t dim, size_t nvectors, double *l) { | |
115 while(nvectors--) { | |
116 double *d1 = d; | |
117 double *d2 = d; | |
118 *l++ = audiodb_dot_product(d1, d2, dim); | |
119 d += dim; | |
120 } | |
121 } |