forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepl.txt
136 lines (104 loc) · 3.83 KB
/
repl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{{alias}}( N, cx, strideX, cy, strideY, c, s )
Applies a plane rotation.
The `N` and stride parameters determine how values in the strided arrays are
accessed at runtime.
Indexing is relative to the first index. To introduce an offset, use typed
array views.
If `N` is less than or equal to `0`, the vectors are unchanged.
Parameters
----------
N: integer
Number of indexed elements.
cx: Complex64Array
First input array.
strideX: integer
Index increment for `cx`.
cy: Complex64Array
Second input array.
strideY: integer
Index increment for `cy`.
c: number
Cosine of the angle of rotation.
s: number
Sine of the angle of rotation.
Returns
-------
cy: Complex64Array
Input array `cy`.
Examples
--------
// Standard usage:
> var cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] );
> var cy = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] );
> {{alias}}( cx.length, cx, 1, cy, 1, 0.8, 0.6 );
> cx
<Complex64Array>[ ~0.8, ~1.6, ~2.4, ~3.2 ]
> cy
<Complex64Array>[ ~-0.6, ~-1.2, ~-1.8, ~-2.4 ]
// Advanced indexing:
> cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
> cy = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
> {{alias}}( 2, cx, -2, cy, 1, 0.8, 0.6 );
> cx
<Complex64Array>[ ~0.8, ~1.6, 3.0, 4.0, 4.0, ~4.8, 7.0, 8.0 ]
> cy
<Complex64Array>[ -3.0, ~-3.6, ~-0.6, ~-1.2, 0.0, 0.0, 0.0, 0.0 ]
// Using typed array views:
> var cx0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
> var cy0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
> var cx1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 );
> var cy1 = new {{alias:@stdlib/array/complex64}}( cy0.buffer, cy0.BYTES_PER_ELEMENT*2 );
> {{alias}}( 1, cx1, 1, cy1, 1, 0.8, 0.6 );
> cx0
<Complex64Array>[ 1.0, 2.0, ~2.4, ~3.2, 5.0, 6.0 ]
> cy0
<Complex64Array>[ 0.0, 0.0, 0.0, 0.0, ~-1.8, ~-2.4 ]
{{alias}}.ndarray( N, cx, strideX, offsetX, cy, strideY, offsetY, c, s )
Applies a plane rotation using alternative indexing semantics.
While typed array views mandate a view offset based on the underlying
buffer, the offset parameters support indexing semantics based on starting
indices.
Parameters
----------
N: integer
Number of indexed elements.
cx: Complex64Array
First input array.
strideX: integer
Index increment for `cx`.
offsetX: integer
Starting index for `cx`.
cy: Complex64Array
Second input array.
strideY: integer
Index increment for `cy`.
offsetY: integer
Starting index for `cy`.
c: number
Cosine of the angle of rotation.
s: number
Sine of the angle of rotation.
Returns
-------
cy: Complex64Array
Input array `cy`.
Examples
--------
// Standard usage:
> var cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] );
> var cy = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0 ] );
> {{alias}}.ndarray( cx.length, cx, 1, 0, cy, 1, 0, 0.8, 0.6 );
> cx
<Complex64Array>[ ~0.8, ~1.6, ~2.4, ~3.2 ]
> cy
<Complex64Array>[ ~-0.6, ~-1.2, ~-1.8, ~-2.4 ]
// Advanced indexing:
> cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
> cy = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
> {{alias}}.ndarray( 1, cx, 2, 1, cy, 2, 1, 0.8, 0.6 );
> cx
<Complex64Array>[ 1.0, 2.0, ~2.4, ~3.2, 5.0, 6.0 ]
> cy
<Complex64Array>[ 0.0, 0.0, ~-1.8, ~-2.4, 0.0, 0.0 ]
See Also
--------