forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepl.txt
124 lines (94 loc) · 3.78 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
{{alias}}( N, za, zx, strideX, zy, strideY )
Scales a double-precision complex floating-point vector by a double-
precision complex floating point constant and adds the result to a double-
precision complex floating-point vector.
The `N` and stride parameters determine how values from `zx` are scaled by
`za` and added to `zy`.
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 function returns `zy` unchanged.
Parameters
----------
N: integer
Number of indexed elements.
za: Complex128
Scalar constant.
zx: Complex128Array
First input array.
strideX: integer
Index increment for `zx`.
zy: Complex128Array
Second input array.
strideY: integer
Index increment for `zy`.
Returns
-------
zy: Complex128Array
Second input array.
Examples
--------
// Standard usage:
> var zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
> var zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
> var za = new {{alias:@stdlib/complex/float64/ctor}}( 2.0, 2.0 );
> {{alias}}( 2, za, zx, 1, zy, 1 )
<Complex128Array>[ -1.0, 7.0, -1.0, 15.0 ]
// Advanced indexing:
> zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
> zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
> {{alias}}( 2, za, zx, -2, zy, 1 )
<Complex128Array>[ -1.0, 23.0, -1.0, 7.0, 1.0, 1.0 ]
// Using typed array views:
> var zx0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
> var zy0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
> var zx1 = new {{alias:@stdlib/array/complex128}}( zx0.buffer, zx0.BYTES_PER_ELEMENT*1 );
> var zy1 = new {{alias:@stdlib/array/complex128}}( zy0.buffer, zy0.BYTES_PER_ELEMENT*1 );
> {{alias}}( 1, za, zx1, 1, zy1, 1 )
<Complex128Array>[ -1.0, 15.0 ]
> zy0
<Complex128Array>[ 1.0, 1.0, -1.0, 15.0 ]
{{alias}}.ndarray( N, za, zx, strideX, offsetX, zy, strideY, offsetY )
Scales a double-precision complex floating-point vector by a double-
precision complex floating-point constant and adds the result to a double-
precision complex floating-point vector 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.
za: Complex128
Scalar constant.
zx: Complex128Array
First input array.
strideX: integer
Index increment for `zx`.
offsetX: integer
Starting index for `zx`.
zy: Complex128Array
Second input array.
strideY: integer
Index increment for `zy`.
offsetY: integer
Starting index for `zy`.
Returns
-------
zy: Complex128Array
Second input array.
Examples
--------
// Standard usage:
> var zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] );
> var zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0 ] );
> var za = new {{alias:@stdlib/complex/float64/ctor}}( 2.0, 2.0 );
> {{alias}}.ndarray( zx.length, za, zx, 1, 0, zy, 1, 0 )
<Complex128Array>[ -1.0, 7.0, -1.0, 15.0 ]
// Advanced indexing:
> zx = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
> zy = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
> {{alias}}.ndarray( 2, za, zx, 1, 1, zy, 1, 1 )
<Complex128Array>[ 1.0, 1.0, -1.0, 15.0, -1.0, 23.0 ]
See Also
--------