On Jan 27, 2010, at 3:17 PM, Ted Dunning wrote: > This optimization is limited to L_2 norms just as you say. But it really > effective there!
Right, I think the other measures where it doesn't apply just call the other distance measure, right? I'm trying to dig up the SVN history on this, b/c I think we've made several iterations on this and something may have been lost. > > On Wed, Jan 27, 2010 at 12:06 PM, Jake Mannix <jake.man...@gmail.com> wrote: > >> Of course, just calling vector.getDistanceSquared(other) allows the vector >> impl to take care of these optimizations themself. Unfortunately, this >> only >> does SquaredEuclideanDistanceMeasure. (On the other hand, the whole >> idea of optimizing via (x-y)^2 = x^2 + y^2 - 2x.y depends completely >> on the distance measure being defined in terms of dot products, and >> doesn't apply to the general case [Manhattan, Tanimoto, Cosine]). >> >