File tree Expand file tree Collapse file tree 4 files changed +0
-26
lines changed
main/scala/org/apache/spark/ml/linalg
test/scala/org/apache/spark/ml/linalg
main/scala/org/apache/spark/mllib/linalg
test/scala/org/apache/spark/mllib/linalg Expand file tree Collapse file tree 4 files changed +0
-26
lines changed Original file line number Diff line number Diff line change @@ -247,14 +247,6 @@ object Vectors {
247247 }.toSeq)
248248 }
249249
250- /**
251- * Calculate the dot product of two vectors.
252- *
253- * If `size` does not match an [[IllegalArgumentException ]] is thrown.
254- */
255- @ Since (" 3.0.0" )
256- def dot (v1 : Vector , v2 : Vector ): Double = v1.dot(v2)
257-
258250 /**
259251 * Creates a vector of all zeros.
260252 *
Original file line number Diff line number Diff line change @@ -384,27 +384,22 @@ class VectorsSuite extends SparkMLFunSuite {
384384 test(" dot product only supports vectors of same size" ) {
385385 val vSize4 = Vectors .dense(arr)
386386 val vSize1 = Vectors .zeros(1 )
387- intercept[IllegalArgumentException ]{ Vectors .dot(vSize4, vSize1) }
388387 intercept[IllegalArgumentException ]{ vSize1.dot(vSize4) }
389388 }
390389
391390 test(" dense vector dot product" ) {
392391 val dv = Vectors .dense(arr)
393- assert(Vectors .dot(dv, dv) === 0.26 )
394392 assert(dv.dot(dv) === 0.26 )
395393 }
396394
397395 test(" sparse vector dot product" ) {
398396 val sv = Vectors .sparse(n, indices, values)
399- assert(Vectors .dot(sv, sv) === 0.26 )
400397 assert(sv.dot(sv) === 0.26 )
401398 }
402399
403400 test(" mixed sparse and dense vector dot product" ) {
404401 val sv = Vectors .sparse(n, indices, values)
405402 val dv = Vectors .dense(arr)
406- assert(Vectors .dot(sv, dv) === 0.26 )
407- assert(Vectors .dot(dv, sv) === 0.26 )
408403 assert(sv.dot(dv) === 0.26 )
409404 assert(dv.dot(sv) === 0.26 )
410405 }
Original file line number Diff line number Diff line change @@ -359,14 +359,6 @@ object Vectors {
359359 }.toSeq)
360360 }
361361
362- /**
363- * Calculate the dot product of two vectors.
364- *
365- * If `size` does not match an [[IllegalArgumentException ]] is thrown.
366- */
367- @ Since (" 3.0.0" )
368- def dot (v1 : Vector , v2 : Vector ): Double = v1.dot(v2)
369-
370362 /**
371363 * Creates a vector of all zeros.
372364 *
Original file line number Diff line number Diff line change @@ -514,27 +514,22 @@ class VectorsSuite extends SparkFunSuite with Logging {
514514 test(" dot product only supports vectors of same size" ) {
515515 val vSize4 = Vectors .dense(arr)
516516 val vSize1 = Vectors .zeros(1 )
517- intercept[IllegalArgumentException ]{ Vectors .dot(vSize4, vSize1) }
518517 intercept[IllegalArgumentException ]{ vSize1.dot(vSize4) }
519518 }
520519
521520 test(" dense vector dot product" ) {
522521 val dv = Vectors .dense(arr)
523- assert(Vectors .dot(dv, dv) === 0.26 )
524522 assert(dv.dot(dv) === 0.26 )
525523 }
526524
527525 test(" sparse vector dot product" ) {
528526 val sv = Vectors .sparse(n, indices, values)
529- assert(Vectors .dot(sv, sv) === 0.26 )
530527 assert(sv.dot(sv) === 0.26 )
531528 }
532529
533530 test(" mixed sparse and dense vector dot product" ) {
534531 val sv = Vectors .sparse(n, indices, values)
535532 val dv = Vectors .dense(arr)
536- assert(Vectors .dot(sv, dv) === 0.26 )
537- assert(Vectors .dot(dv, sv) === 0.26 )
538533 assert(sv.dot(dv) === 0.26 )
539534 assert(dv.dot(sv) === 0.26 )
540535 }
You can’t perform that action at this time.
0 commit comments