GSL::Vector::Complex.alloc(size)GSL::Vector::Complex.alloc(re, im)GSL::Vector::Complex.alloc(z0, z1, z2, ...)GSL::Vector::Complex.alloc()GSL::Vector::Complex[...]With two (real) vectors:
irb(main):006:0> re = Vector[0..3] irb(main):007:0> im = Vector[5..8] irb(main):008:0> z = Vector::Complex[re, im] [ [0.000e+00 5.000e+00] [1.000e+00 6.000e+00] [2.000e+00 7.000e+00] [3.000e+00 8.000e+00] ]
With arrays
irb(main):009:0> z = Vector::Complex.alloc([0, 1], [2, 5], [-3, 4]) [ [0.000e+00 1.000e+00] [2.000e+00 5.000e+00] [-3.000e+00 4.000e+00] ]
GSL::Vector::Complex.calloc(n)GSL::Vector::Complex#get(args)GSL::Vector::Complex#[args]Returns elements(s) of the complex vector self if args is a
single Fixnum, a single Array of Fixnums, or a single GSL::Permutation (or
GSL::Index). For all other args, the parameters are treated as
with Vector#subvector and a Vector::View is returned.
Example:
irb(main):010:0> z [ [0.000e+00 1.000e+00] [2.000e+00 5.000e+00] [-3.000e+00 4.000e+00] ] => #<GSL::Vector::Complex:0x6c5b9c> irb(main):011:0> z[1] => GSL::Complex [ 2.000000 5.000000 ] irb(main):012:0> z[-1] => GSL::Complex [ -3.000000 4.000000 ] irb(main):013:0> z[0, 2] [ [0.000e+00 1.000e+00] [-3.000e+00 4.000e+00] ] => #<GSL::Vector::Complex:0x6bfbac>
GSL::Vector::Complex#set(args, val)GSL::Vector::Complex#[args]=valIf args is empty, behaves as #set_all and val must be a
[re,im] Array, Float, Integer, or
GSL::Complex.
If args is a single Fixnum, i, sets the i-th
element of the vector self to val, which must be a
[re,im] Array, Float, Integer, or
GSL::Complex.
All other args specify a subvector (as with #subvector) whose
elements are assigned from val. In this case, val can be an
Array, Range, GSL::Vector::Complex, or one of the classes
listed in the previous cases.
NOTE: GSL does not provide a vector copy function that properly copies data
across overlapping memory regions, so watch out if assigning to part of a
Vector from another part of itself (see #set example of
GSL::Vector).
GSL::Vector::Complex#set_all(z)GSL::Vector::Complex#set_zeroGSL::Vector::Complex#set_real(x)GSL::Vector::Complex#real=(x)GSL::Vector::Complex#re=(x)GSL::Vector::Complex#set_imag(x)GSL::Vector::Complex#imag=(x)GSL::Vector::Complex#im=(x)GSL::Vector::Complex#sizeGSL::Vector::Complex#lenGSL::Vector::Complex#lengthGSL::Vector::Complex#strideGSL::Vector::Complex#eachGSL::Vector::Complex#each_indexGSL::Vector::Complex#collectGSL::Vector::Complex#mapGSL::Vector::Complex#collect!GSL::Vector::Complex#map!GSL::Vector::Complex provides four methods for shifting the frequency
domain data between FFT order, shown in the table in the Overview of
complex data FFTs, and natural order, which has the
most negative freqeuncy component first, the zero frequency component in the
middle, and the most positive frequency component last. For more information
on Ruby/GSL and FFTs, see Fast Fourier Transforms.
GSL::Vector::Complex#fftshiftGSL::Vector::Complex#fftshift!#fftshift method leaves self unmodified and returns a new
GSL::Vector::Complex object containing the shifted data. The
#fftshift! method modifies self in-place and returns
self. Note that #fftshift and #ifftshift are equivalent
for even lengths, but not for odd lengths.GSL::Vector::Complex#ifftshiftGSL::Vector::Complex#ifftshift!#ifftshift method leaves self unmodified and returns a new
GSL::Vector::Complex object containing the shifted data. The
#ifftshift! method modifies self in-place and returns
self. Note that #fftshift and #ifftshift are equivalent
for even lengths, but not for odd lengths.GSL::Vector::Complex#+(other)GSL::Vector::Complex#-(other)GSL::Vector::Complex#*(other)GSL::Vector::Complex#/(other)GSL::Vector::Complex#add(other)GSL::Vector::Complex#sub(other)GSL::Vector::Complex#mul(other)GSL::Vector::Complex#div(other)GSL::Vector::Complex instance containing the result of
the appropriate arithmetic operation on self and other. The
inputs are unchanged. The other parameter may be a scalar,
GSL::Vector, or GSL::Vector::Complex.GSL::Vector::Complex#+=(other)GSL::Vector::Complex#-=(other)GSL::Vector::Complex#*=(other)GSL::Vector::Complex#/=(other)GSL::Vector::Complex#add!(other)GSL::Vector::Complex#sub!(other)GSL::Vector::Complex#mul!(other)GSL::Vector::Complex#div!(other)GSL::Vector, or
GSL::Vector::Complex.GSL::Vector::Complex#fwite(io)GSL::Vector::Complex#fread(io)GSL::Vector::Complex#fprintf(io, format)GSL::Vector::Complex#fscanf(io)GSL::Vector::Complex#conjGSL::Vector::Complex#conjugateGSL::Vector::Complex that is the complex conjugate of
self.GSL::Vector::Complex#conj!GSL::Vector::Complex#conjugate!GSL::Vector::Complex#argGSL::Vector::Complex#angleGSL::Vector::Complex#phaseGSL::Vector::Complex#abs2GSL::Vector::Complex#absGSL::Vector::Complex#ampGSL::Vector::Complex#logabsGSL::Vector::Complex#sqrtGSL::Vector::Complex#expGSL::Vector::Complex#pow(a)GSL::Vector::Complex#logGSL::Vector::Complex#log10GSL::Vector::Complex#log_b(base)GSL::Vector::Complex#sinGSL::Vector::Complex#cosGSL::Vector::Complex#tanGSL::Vector::Complex#secGSL::Vector::Complex#cscGSL::Vector::Complex#cotGSL::Vector::Complex#arcsinGSL::Vector::Complex#arccosGSL::Vector::Complex#arctanGSL::Vector::Complex#arcsecGSL::Vector::Complex#arccscGSL::Vector::Complex#arccotGSL::Vector::Complex#sinhGSL::Vector::Complex#coshGSL::Vector::Complex#tanhGSL::Vector::Complex#sechGSL::Vector::Complex#cschGSL::Vector::Complex#cothGSL::Vector::Complex#arcsinhGSL::Vector::Complex#arccoshGSL::Vector::Complex#arctanhGSL::Vector::Complex#arcsechGSL::Vector::Complex#arccschGSL::Vector::Complex#arccothGSL::Vector::Complex#sumGSL::Complex object representing the sum of all elements of
self.GSL::Vector::Complex#meanGSL::Complex object representing the mean of all elements
of self.GSL::Vector::Complex#tssself.mean. This is a real
number, i.e. a Float.GSL::Vector::Complex#tss_m(mean)Float.GSL::Vector::Complex#varianceFloat.GSL::Vector::Complex#variance_m(mean)Float.GSL::Vector::Complex#variance_fm(mean)Float.GSL::Vector::Complex#sdFloat.GSL::Vector::Complex#sd_m(mean)Float.GSL::Vector::Complex#sd_fm(mean)Float.GSL::Vector#to_complexGSL::Vector#to_complex2Create a complex vector from a real vector.
irb(main):002:0> v = Vector[1..4] => GSL::Vector [ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 ] irb(main):003:0> v.to_complex [ [1.000e+00 0.000e+00] [2.000e+00 0.000e+00] [3.000e+00 0.000e+00] [4.000e+00 0.000e+00] ] => #<GSL::Vector::Complex:0x6d7d24> irb(main):004:0> v.to_complex2 [ [1.000e+00 2.000e+00] [3.000e+00 4.000e+00] ] => #<GSL::Vector::Complex:0x6d6424>