April 2017
Intermediate to advanced
532 pages
12h 39m
English
Vectors can be added together, subtracted, and multiplied by scalars. Other operations on vectors include finding the mean, normalization, comparison, and geometrical representation.
// vector's val v1 = DenseVector(3, 7, 8.1, 4, 5) val v2 = DenseVector(1, 9, 3, 2.3, 8) // elementwise add operation def add(): Unit = { println(v1 + v2) }
This last code gives us the result as follows: DenseVector(4.0, 16.0, 11.1, 6.3, 13.0)
Read now
Unlock full access