For any $R$-module $M$, there exists an isomorphism between $\operatorname{Hom}(R,M)$ and $M$ given by $f\mapsto f(1)$. Therefore, internally all Vector objects representing elements of $M$ correspond to matrices with source $R^1$ and target $M$. A vector may be constructed from such a matrix using vector.
|
|
|
Alternatively, $M$ may be specified if it differs from the target of the matrix.
|
|
If the matrix would have only one element, then that element may be given instead. If the module is not provided, then the result will be an element of the free module of rank one of the ring of the given element.
|
|
|
Alternatively, a list of elements may be provided. If the module is not specified, then the vector will be an element of a free module over a ring containing all the elements of the list.
|
|
|
The object vector is a method function.