32.5 Real double vectors

Module: sage.modules.real_double_vector

File: sage/modules/real_double_vector.pyx (starting at line 1)

Real double vectors

Author Log:

TESTS:

sage: v = vector(RDF, [1,2,3,4])
sage: loads(dumps(v)) == v
True

Module-level Functions

unpickle_v0( )

Class: RealDoubleVectorSpaceElement

class RealDoubleVectorSpaceElement

Functions: change_ring,$  $ complex_vector,$  $ fft,$  $ mean,$  $ numpy,$  $ standard_deviation,$  $ stats_kurtosis,$  $ stats_lag1_autocorrelation,$  $ stats_skew,$  $ variance

change_ring( )

sage: v = vector(RDF,4,range(4)); v
(0.0, 1.0, 2.0, 3.0)
sage: v.change_ring(CC)
(0, 1.00000000000000, 2.00000000000000, 3.00000000000000)
sage: v.change_ring(CDF)
(0, 1.0, 2.0, 3.0)
sage: v.change_ring(RR)
(0.000000000000000, 1.00000000000000, 2.00000000000000, 3.00000000000000)  

sage: v = vector(RDF,0)
sage: v.change_ring(CC)
()

complex_vector( )

Return the associated complex vector, i.e., this vector but with coefficients viewed as complex numbers.

sage: v = vector(RDF,4,range(4)); v
(0.0, 1.0, 2.0, 3.0)
sage: v.complex_vector()
(0, 1.0, 2.0, 3.0)
sage: v = vector(RDF,0)
sage: v.complex_vector()
()

fft( )

Return the fast Fourier transform of this vector over the complex numbers.

INPUT:
   direction -- 'forward' (default) or 'backward'

sage: v = vector(RDF,4,range(4)); v
(0.0, 1.0, 2.0, 3.0)
sage: v.fft()
(6.0, -2.0 + 2.0*I, -2.0, -2.0 - 2.0*I)
sage: v.fft(direction='backward')
(1.5, -0.5 - 0.5*I, -0.5, -0.5 + 0.5*I)
sage: v.fft(direction='backward').fft()     # random low order bits
(0, 1.0 - 5.74627151417e-18*I, 2.0, 3.0 + 5.74627151417e-18*I)

numpy( )

Return numpy array corresponding to this vector.

sage: v = vector(RDF,4,range(4))
sage: v.numpy()
array([ 0.,  1.,  2.,  3.])
sage: v = vector(RDF,0)
sage: v.numpy()
array([], shape=(1, 0), dtype=float64)

standard_deviation( )

sage: v = vector(RDF, 5, [1,2,3,4,5])
sage: v.standard_deviation()
1.5811388300841898

Special Functions: __copy__,$  $ __delitem__,$  $ __getitem__,$  $ __len__,$  $ __reduce__,$  $ __setitem__,$  $ _replace_self_with_numpy

__copy__( )

__reduce__( )

_replace_self_with_numpy( )

See About this document... for information on suggesting changes.