srowen commented on a change in pull request #25818: [SPARK-29121][ML][MLLIB]
Support for dot product operation on Vector(s)
URL: https://github.com/apache/spark/pull/25818#discussion_r325715899
##########
File path: mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala
##########
@@ -178,6 +178,13 @@ sealed trait Vector extends Serializable {
*/
@Since("2.0.0")
def argmax: Int
+
+ /**
+ * Calculate the dot product of this vector with another.
+ *
+ * If `size` does not match an [IllegalArgumentException] is thrown.
+ */
+ def dot(v: Vector): Double = BLAS.dot(this, v)
Review comment:
Add `@Since("3.0.0")`. I think this needs to be exposed in Pyspark and/or
SparkR too?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]