Vectors with integer entries#
AUTHOR:
William Stein (2007)
EXAMPLES:
sage: v = vector(ZZ,[1,2,3,4,5])
sage: v
(1, 2, 3, 4, 5)
sage: 3*v
(3, 6, 9, 12, 15)
sage: v*7
(7, 14, 21, 28, 35)
sage: -v
(-1, -2, -3, -4, -5)
sage: v - v
(0, 0, 0, 0, 0)
sage: v + v
(2, 4, 6, 8, 10)
sage: v * v # dot product.
55
We make a large zero vector:
sage: k = ZZ^100000; k
Ambient free module of rank 100000 over the principal ideal domain Integer Ring
sage: v = k(0)
sage: v[:10]
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- class sage.modules.vector_integer_dense.Vector_integer_dense#
Bases:
FreeModuleElement
- list(copy=True)#
The list of entries of the vector.
INPUT:
copy
, ignored optional argument.
EXAMPLES:
sage: v = vector([1,2,3,4]) sage: a = v.list(copy=False); a [1, 2, 3, 4] sage: a[0] = 0 sage: v (1, 2, 3, 4)
- sage.modules.vector_integer_dense.unpickle_v0(parent, entries, degree)#
- sage.modules.vector_integer_dense.unpickle_v1(parent, entries, degree, is_mutable)#