Handbook
Glossary
complex-sequence
Complex virtual sequences
Next:
<complex-sequence> ( sequence -- complex-sequence )
Vocabulary
sequences
.
complex
Class description
Sequence wrapper class that transforms a sequence of
real
number values into a sequence of
complex
values, treating the underlying sequence as pairs of alternating real and imaginary values.
Examples
USING: prettyprint specialized-arrays sequences.complex sequences alien.c-types arrays ; SPECIALIZED-ARRAY: double double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } <complex-sequence> >array .
{ C{ 1.0 -1.0 } C{ -2.0 2.0 } C{ 3.0 0.0 } }
See also
<complex-sequence>
Definition
IN:
sequences.complex
TUPLE:
complex-sequence
seq
;
Methods
USING:
accessors
math
sequences
sequences.complex
;
M:
complex-sequence
length
seq>>
length
-1
shift
;
USING:
kernel
math
sequences.complex
sequences.complex.private
sequences.private
;
M:
complex-sequence
nth-unsafe
complex@
[
nth-unsafe
]
[
[
1
+
]
dip
nth-unsafe
]
2bi
rect>
;
USING:
kernel
math
sequences.complex
sequences.complex.private
sequences.private
;
M:
complex-sequence
set-nth-unsafe
complex@
[
[
real-part
]
[
]
[
]
tri*
set-nth-unsafe
]
[
[
imaginary-part
]
[
1
+
]
[
]
tri*
set-nth-unsafe
]
3bi
;