Yes.  That is correct.

I had wanted vectors to cache this squared length, but the consensus was
that the caller could do it more correctly.

On Wed, Jan 27, 2010 at 10:12 AM, Jake Mannix <jake.man...@gmail.com> wrote:

> The interface defines two methods:
>
>
>  double distance(Vector v1, Vector v2);
>  double distance(double centroidLengthSquare, Vector centroid, Vector v);
>
>
> With the latter being an optimized form of the former, and satisfies:
>
>  distance(v1, v2) == distance(v1.getLengthSquared(), v1, v2)
>
> Is this correct?  Every place I see this method called, it is used in this
> fashion, at least...
>
>  -jake
>



-- 
Ted Dunning, CTO
DeepDyve

Reply via email to