Fixed doc string; compute cosine distance without copying matrix.