-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29121][ML][MLLIB] Support for dot product operation on Vector(s) #25818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
f906c3c
2f73684
db41e0b
475922d
7cd1fc5
9d2959b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -239,6 +246,13 @@ object Vectors { | |
| }.toSeq) | ||
| } | ||
|
|
||
| /** | ||
| * Calculate the dot product of two vectors. | ||
| * | ||
| * If `size` does not match an [IllegalArgumentException] is thrown. | ||
| */ | ||
| def dot(v1: Vector, v2: Vector): Double = BLAS.dot(v1, v2) | ||
|
||
|
|
||
| /** | ||
| * Creates a vector of all zeros. | ||
| * | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.