Vectors with rational entries#
AUTHOR:
William Stein (2007)
Soroosh Yazdani (2007)
EXAMPLES:
sage: v = vector(QQ,[1,2,3,4,5])
sage: v
(1, 2, 3, 4, 5)
sage: 3*v
(3, 6, 9, 12, 15)
sage: v/2
(1/2, 1, 3/2, 2, 5/2)
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
55
We make a large zero vector:
sage: k = QQ^100000; k
Vector space of dimension 100000 over Rational Field
sage: v = k(0)
sage: v[:10]
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- class sage.modules.vector_rational_dense.Vector_rational_dense#
Bases:
FreeModuleElement
- list(copy=True)#
The list of entries of the vector.
INPUT:
copy
, ignored optional argument.
EXAMPLES:
sage: v = vector(QQ,[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_rational_dense.unpickle_v0(parent, entries, degree)#
- sage.modules.vector_rational_dense.unpickle_v1(parent, entries, degree, is_mutable)#