Compute the dot product between two vectors
Compute the dot product between two vectors
Under the hood, Spark's BLAS module calls a BLAS routine from netlib-java for the case of two dense vectors, or an optimized Scala implementation in the case of sparse vectors.
Convert a Spark vector to a Breeze vector to access vector operations that Spark doesn't provide.
This shim reaches into Spark's private linear algebra code, in order to take advantage of optimized dot products. While the dot product implementation in question is part of MLlib's BLAS module, BLAS itself only supports dot products between dense vectors, and MLlib implements sparse vector dot products. Using a shim here avoids copy/pasting that implementation.