Dense real double vectors using a NumPy backend#
EXAMPLES:
sage: v = vector(RDF,[1, pi, sqrt(2)])
sage: v
(1.0, 3.141592653589793, 1.414213562373095)
sage: type(v)
<class 'sage.modules.vector_real_double_dense.Vector_real_double_dense'>
sage: parent(v)
Vector space of dimension 3 over Real Double Field
sage: v[0] = 5
sage: v
(5.0, 3.141592653589793, 1.414213562373095)
sage: loads(dumps(v)) == v
True
- AUTHORS:
- – Jason Grout, Oct 2008: switch to numpy backend, factored out
Vector_double_dense class
- class sage.modules.vector_real_double_dense.Vector_real_double_dense#
Bases:
sage.modules.vector_double_dense.Vector_double_dense
Vectors over the Real Double Field. These are supposed to be fast vector operations using C doubles. Most operations are implemented using numpy which will call the underlying BLAS, if needed, on the system.
EXAMPLES:
sage: v = vector(RDF, [1,2,3,4]); v (1.0, 2.0, 3.0, 4.0) sage: v*v 30.0
- stats_skew()#
Computes the skewness of a data set.
For normally distributed data, the skewness should be about 0. A skewness value > 0 means that there is more weight in the left tail of the distribution. (Paragraph from the scipy.stats docstring.)
EXAMPLES:
sage: v = vector(RDF, range(9)) sage: v.stats_skew() 0.0
- sage.modules.vector_real_double_dense.unpickle_v0(parent, entries, degree)#
Create a real double vector containing the entries.
EXAMPLES:
sage: v = vector(RDF, [1,2,3]) sage: w = sage.modules.vector_real_double_dense.unpickle_v0(v.parent(), list(v), v.degree()) sage: v == w True
- sage.modules.vector_real_double_dense.unpickle_v1(parent, entries, degree, is_mutable=None)#
Create a real double vector with the given parent, entries, degree, and mutability.
EXAMPLES:
sage: v = vector(RDF, [1,2,3]) sage: w = sage.modules.vector_real_double_dense.unpickle_v1(v.parent(), list(v), v.degree(), v.is_immutable()) sage: v == w True