The Vector class represents a mathematical vector, which is useful in its own right, and also constitutes a row or column of a Matrix.
Method Catalogue
To create a Vector:
-
Vector.[](*array)
-
Vector.elements(array, copy = true)
To access elements:
-
#[](i)
To enumerate the elements:
-
#each2(v)
-
#collect2(v)
Vector arithmetic:
-
#*(x) “is matrix or number”
-
#+(v)
-
#-(v)
Vector functions:
-
#inner_product(v)
-
#cross_product(v)
-
#map2(v)
Conversion to other data types:
String representations: