@stdlib/blas-base-cswap 0.0.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +34 -26
- package/SECURITY.md +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +7 -0
- package/docs/types/index.d.ts +18 -18
- package/include.gypi +1 -1
- package/lib/cswap.js +4 -4
- package/lib/cswap.native.js +4 -4
- package/lib/ndarray.js +4 -4
- package/lib/ndarray.native.js +10 -10
- package/manifest.json +167 -116
- package/package.json +30 -19
- package/src/addon.c +45 -0
- package/src/cswap.c +1 -1
- package/src/cswap.f +1 -1
- package/src/cswap_cblas.c +1 -1
- package/src/cswap_f.c +1 -1
- package/docs/repl.txt +0 -158
- package/docs/types/test.ts +0 -249
- package/src/addon.cpp +0 -151
package/manifest.json
CHANGED
|
@@ -1,118 +1,169 @@
|
|
|
1
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
|
-
|
|
2
|
+
"options": {
|
|
3
|
+
"os": "linux",
|
|
4
|
+
"blas": "",
|
|
5
|
+
"wasm": false
|
|
6
|
+
},
|
|
7
|
+
"fields": [
|
|
8
|
+
{
|
|
9
|
+
"field": "src",
|
|
10
|
+
"resolve": true,
|
|
11
|
+
"relative": true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"field": "include",
|
|
15
|
+
"resolve": true,
|
|
16
|
+
"relative": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"field": "libraries",
|
|
20
|
+
"resolve": false,
|
|
21
|
+
"relative": false
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"field": "libpath",
|
|
25
|
+
"resolve": true,
|
|
26
|
+
"relative": false
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"confs": [
|
|
30
|
+
{
|
|
31
|
+
"os": "linux",
|
|
32
|
+
"blas": "",
|
|
33
|
+
"wasm": false,
|
|
34
|
+
"src": [
|
|
35
|
+
"./src/cswap.f",
|
|
36
|
+
"./src/cswap_f.c"
|
|
37
|
+
],
|
|
38
|
+
"include": [
|
|
39
|
+
"./include"
|
|
40
|
+
],
|
|
41
|
+
"libraries": [],
|
|
42
|
+
"libpath": [],
|
|
43
|
+
"dependencies": [
|
|
44
|
+
"@stdlib/napi-export",
|
|
45
|
+
"@stdlib/napi-argv",
|
|
46
|
+
"@stdlib/napi-argv-int64",
|
|
47
|
+
"@stdlib/napi-argv-strided-complex64array"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"os": "linux",
|
|
52
|
+
"blas": "openblas",
|
|
53
|
+
"wasm": false,
|
|
54
|
+
"src": [
|
|
55
|
+
"./src/cswap_cblas.c"
|
|
56
|
+
],
|
|
57
|
+
"include": [
|
|
58
|
+
"./include"
|
|
59
|
+
],
|
|
60
|
+
"libraries": [
|
|
61
|
+
"-lopenblas",
|
|
62
|
+
"-lpthread"
|
|
63
|
+
],
|
|
64
|
+
"libpath": [],
|
|
65
|
+
"dependencies": [
|
|
66
|
+
"@stdlib/napi-export",
|
|
67
|
+
"@stdlib/napi-argv",
|
|
68
|
+
"@stdlib/napi-argv-int64",
|
|
69
|
+
"@stdlib/napi-argv-strided-complex64array"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"os": "mac",
|
|
74
|
+
"blas": "",
|
|
75
|
+
"wasm": false,
|
|
76
|
+
"src": [
|
|
77
|
+
"./src/cswap.f",
|
|
78
|
+
"./src/cswap_f.c"
|
|
79
|
+
],
|
|
80
|
+
"include": [
|
|
81
|
+
"./include"
|
|
82
|
+
],
|
|
83
|
+
"libraries": [],
|
|
84
|
+
"libpath": [],
|
|
85
|
+
"dependencies": [
|
|
86
|
+
"@stdlib/napi-export",
|
|
87
|
+
"@stdlib/napi-argv",
|
|
88
|
+
"@stdlib/napi-argv-int64",
|
|
89
|
+
"@stdlib/napi-argv-strided-complex64array"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"os": "mac",
|
|
94
|
+
"blas": "apple_accelerate_framework",
|
|
95
|
+
"wasm": false,
|
|
96
|
+
"src": [
|
|
97
|
+
"./src/cswap_cblas.c"
|
|
98
|
+
],
|
|
99
|
+
"include": [
|
|
100
|
+
"./include"
|
|
101
|
+
],
|
|
102
|
+
"libraries": [
|
|
103
|
+
"-lblas"
|
|
104
|
+
],
|
|
105
|
+
"libpath": [],
|
|
106
|
+
"dependencies": [
|
|
107
|
+
"@stdlib/napi-export",
|
|
108
|
+
"@stdlib/napi-argv",
|
|
109
|
+
"@stdlib/napi-argv-int64",
|
|
110
|
+
"@stdlib/napi-argv-strided-complex64array"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"os": "mac",
|
|
115
|
+
"blas": "openblas",
|
|
116
|
+
"wasm": false,
|
|
117
|
+
"src": [
|
|
118
|
+
"./src/cswap_cblas.c"
|
|
119
|
+
],
|
|
120
|
+
"include": [
|
|
121
|
+
"./include"
|
|
122
|
+
],
|
|
123
|
+
"libraries": [
|
|
124
|
+
"-lopenblas",
|
|
125
|
+
"-lpthread"
|
|
126
|
+
],
|
|
127
|
+
"libpath": [],
|
|
128
|
+
"dependencies": [
|
|
129
|
+
"@stdlib/napi-export",
|
|
130
|
+
"@stdlib/napi-argv",
|
|
131
|
+
"@stdlib/napi-argv-int64",
|
|
132
|
+
"@stdlib/napi-argv-strided-complex64array"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"os": "win",
|
|
137
|
+
"blas": "",
|
|
138
|
+
"wasm": false,
|
|
139
|
+
"src": [
|
|
140
|
+
"./src/cswap.c"
|
|
141
|
+
],
|
|
142
|
+
"include": [
|
|
143
|
+
"./include"
|
|
144
|
+
],
|
|
145
|
+
"libraries": [],
|
|
146
|
+
"libpath": [],
|
|
147
|
+
"dependencies": [
|
|
148
|
+
"@stdlib/napi-export",
|
|
149
|
+
"@stdlib/napi-argv",
|
|
150
|
+
"@stdlib/napi-argv-int64",
|
|
151
|
+
"@stdlib/napi-argv-strided-complex64array"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"os": "",
|
|
156
|
+
"blas": "",
|
|
157
|
+
"wasm": true,
|
|
158
|
+
"src": [
|
|
159
|
+
"./src/cswap.c"
|
|
160
|
+
],
|
|
161
|
+
"include": [
|
|
162
|
+
"./include"
|
|
163
|
+
],
|
|
164
|
+
"libraries": [],
|
|
165
|
+
"libpath": [],
|
|
166
|
+
"dependencies": []
|
|
167
|
+
}
|
|
168
|
+
]
|
|
118
169
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/blas-base-cswap",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Interchanges two complex single-precision floating-point vectors.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -41,27 +41,35 @@
|
|
|
41
41
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@stdlib/
|
|
45
|
-
"@stdlib/
|
|
46
|
-
"@stdlib/
|
|
47
|
-
"@stdlib/
|
|
48
|
-
"@stdlib/
|
|
49
|
-
"@stdlib/
|
|
44
|
+
"@stdlib/assert-is-error": "^0.2.0",
|
|
45
|
+
"@stdlib/napi-argv": "^0.2.0",
|
|
46
|
+
"@stdlib/napi-argv-int64": "^0.2.0",
|
|
47
|
+
"@stdlib/napi-argv-strided-complex64array": "^0.2.0",
|
|
48
|
+
"@stdlib/napi-export": "^0.2.0",
|
|
49
|
+
"@stdlib/strided-base-reinterpret-complex64": "^0.2.0",
|
|
50
|
+
"@stdlib/types": "^0.3.1",
|
|
51
|
+
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0",
|
|
52
|
+
"@stdlib/utils-library-manifest": "^0.2.0",
|
|
53
|
+
"@stdlib/utils-try-require": "^0.2.0"
|
|
50
54
|
},
|
|
51
55
|
"devDependencies": {
|
|
52
|
-
"@stdlib/array-complex64": "^0.0
|
|
53
|
-
"@stdlib/
|
|
54
|
-
"@stdlib/
|
|
55
|
-
"@stdlib/
|
|
56
|
-
"@stdlib/
|
|
57
|
-
"@stdlib/
|
|
58
|
-
"@stdlib/math-base-
|
|
59
|
-
"@stdlib/
|
|
60
|
-
"@stdlib/random-
|
|
56
|
+
"@stdlib/array-complex64": "^0.1.0",
|
|
57
|
+
"@stdlib/array-filled-by": "^0.1.0",
|
|
58
|
+
"@stdlib/array-float32": "^0.1.1",
|
|
59
|
+
"@stdlib/assert-is-browser": "^0.1.1",
|
|
60
|
+
"@stdlib/blas-base-scopy": "^0.1.1",
|
|
61
|
+
"@stdlib/complex-float32": "^0.1.1",
|
|
62
|
+
"@stdlib/math-base-assert-is-nan": "^0.1.1",
|
|
63
|
+
"@stdlib/math-base-special-pow": "^0.1.0",
|
|
64
|
+
"@stdlib/random-array-uniform": "^0.1.0",
|
|
65
|
+
"@stdlib/random-base-discrete-uniform": "^0.1.0",
|
|
66
|
+
"@stdlib/strided-base-min-view-buffer-index": "^0.2.0",
|
|
61
67
|
"proxyquire": "^2.0.0",
|
|
62
68
|
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
63
69
|
"istanbul": "^0.4.1",
|
|
64
|
-
"tap-
|
|
70
|
+
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",
|
|
71
|
+
"@stdlib/bench-harness": "^0.1.2",
|
|
72
|
+
"@stdlib/bench": "^0.3.1"
|
|
65
73
|
},
|
|
66
74
|
"engines": {
|
|
67
75
|
"node": ">=0.10.0",
|
|
@@ -103,8 +111,11 @@
|
|
|
103
111
|
"single",
|
|
104
112
|
"float32array"
|
|
105
113
|
],
|
|
114
|
+
"__stdlib__": {
|
|
115
|
+
"wasm": false
|
|
116
|
+
},
|
|
106
117
|
"funding": {
|
|
107
|
-
"type": "
|
|
108
|
-
"url": "https://
|
|
118
|
+
"type": "opencollective",
|
|
119
|
+
"url": "https://opencollective.com/stdlib"
|
|
109
120
|
}
|
|
110
121
|
}
|
package/src/addon.c
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#include "stdlib/blas/base/cswap.h"
|
|
20
|
+
#include "stdlib/napi/export.h"
|
|
21
|
+
#include "stdlib/napi/argv.h"
|
|
22
|
+
#include "stdlib/napi/argv_int64.h"
|
|
23
|
+
#include "stdlib/napi/argv_strided_complex64array.h"
|
|
24
|
+
#include <node_api.h>
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Receives JavaScript callback invocation data.
|
|
28
|
+
*
|
|
29
|
+
* @private
|
|
30
|
+
* @param env environment under which the function is invoked
|
|
31
|
+
* @param info callback data
|
|
32
|
+
* @return Node-API value
|
|
33
|
+
*/
|
|
34
|
+
static napi_value addon( napi_env env, napi_callback_info info ) {
|
|
35
|
+
STDLIB_NAPI_ARGV( env, info, argv, argc, 5 );
|
|
36
|
+
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
|
|
37
|
+
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
|
|
38
|
+
STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 4 );
|
|
39
|
+
STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 );
|
|
40
|
+
STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, Y, N, strideY, argv, 3 );
|
|
41
|
+
c_cswap( N, (void *)X, strideX, (void *)Y, strideY );
|
|
42
|
+
return NULL;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
STDLIB_NAPI_MODULE_EXPORT_FCN( addon )
|
package/src/cswap.c
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
/**
|
|
22
22
|
* Interchanges two complex single-precision floating-point vectors.
|
|
23
23
|
*
|
|
24
|
-
* @param N number of elements
|
|
24
|
+
* @param N number of indexed elements
|
|
25
25
|
* @param X first input array
|
|
26
26
|
* @param strideX X stride length
|
|
27
27
|
* @param Y second input array
|
package/src/cswap.f
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
! >
|
|
48
48
|
! > * We will gladly answer any questions regarding the software. If a modification is done, however, it is the responsibility of the person who modified the routine to provide support.
|
|
49
49
|
!
|
|
50
|
-
! @param {integer} N - number of
|
|
50
|
+
! @param {integer} N - number of indexed elements
|
|
51
51
|
! @param {Array<complex>} cx - first input array
|
|
52
52
|
! @param {integer} strideX - `cx` stride length
|
|
53
53
|
! @param {Array<complex>} cy - second input array
|
package/src/cswap_cblas.c
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/**
|
|
23
23
|
* Interchanges two complex single-precision floating-point vectors.
|
|
24
24
|
*
|
|
25
|
-
* @param N number of elements
|
|
25
|
+
* @param N number of indexed elements
|
|
26
26
|
* @param X first input array
|
|
27
27
|
* @param strideX X stride length
|
|
28
28
|
* @param Y second input array
|
package/src/cswap_f.c
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/**
|
|
23
23
|
* Interchanges two complex single-precision floating-point vectors.
|
|
24
24
|
*
|
|
25
|
-
* @param N number of elements
|
|
25
|
+
* @param N number of indexed elements
|
|
26
26
|
* @param X first input array
|
|
27
27
|
* @param strideX X stride length
|
|
28
28
|
* @param Y second input array
|
package/docs/repl.txt
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
{{alias}}( N, x, strideX, y, strideY )
|
|
3
|
-
Interchanges two complex single-precision floating-point vectors.
|
|
4
|
-
|
|
5
|
-
The `N` and `stride` parameters determine how values from `x` are swapped
|
|
6
|
-
with values from `y`.
|
|
7
|
-
|
|
8
|
-
Indexing is relative to the first index. To introduce an offset, use typed
|
|
9
|
-
array views.
|
|
10
|
-
|
|
11
|
-
If `N` is less than or equal to `0`, the vectors are unchanged.
|
|
12
|
-
|
|
13
|
-
Parameters
|
|
14
|
-
----------
|
|
15
|
-
N: integer
|
|
16
|
-
Number of values to swap.
|
|
17
|
-
|
|
18
|
-
x: Complex64Array
|
|
19
|
-
First input array.
|
|
20
|
-
|
|
21
|
-
strideX: integer
|
|
22
|
-
Index increment for `x`.
|
|
23
|
-
|
|
24
|
-
y: Complex64Array
|
|
25
|
-
Second input array.
|
|
26
|
-
|
|
27
|
-
strideY: integer
|
|
28
|
-
Index increment for `y`.
|
|
29
|
-
|
|
30
|
-
Returns
|
|
31
|
-
-------
|
|
32
|
-
y: Complex64Array
|
|
33
|
-
Input array `y`.
|
|
34
|
-
|
|
35
|
-
Examples
|
|
36
|
-
--------
|
|
37
|
-
// Standard usage:
|
|
38
|
-
> var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] );
|
|
39
|
-
> var y = new {{alias:@stdlib/array/complex64}}( [ 6.0, 7.0, 8.0, 9.0 ] );
|
|
40
|
-
> {{alias}}( x.length, x, 1, y, 1 );
|
|
41
|
-
> var z = y.get( 0 );
|
|
42
|
-
> var re = {{alias:@stdlib/complex/realf}}( z )
|
|
43
|
-
1.0
|
|
44
|
-
> var im = {{alias:@stdlib/complex/imagf}}( z )
|
|
45
|
-
2.0
|
|
46
|
-
> z = x.get( 0 );
|
|
47
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
48
|
-
6.0
|
|
49
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
50
|
-
7.0
|
|
51
|
-
|
|
52
|
-
// Advanced indexing:
|
|
53
|
-
> x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
|
|
54
|
-
> y = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
55
|
-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
|
|
56
|
-
> {{alias}}( N, x, -2, y, 1 );
|
|
57
|
-
> z = y.get( 0 );
|
|
58
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
59
|
-
5.0
|
|
60
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
61
|
-
6.0
|
|
62
|
-
> z = x.get( 0 );
|
|
63
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
64
|
-
0.0
|
|
65
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
66
|
-
0.0
|
|
67
|
-
|
|
68
|
-
// Using typed array views:
|
|
69
|
-
> var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
|
|
70
|
-
> var y0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
71
|
-
> var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
|
|
72
|
-
> var y1 = new {{alias:@stdlib/array/complex64}}( y0.buffer, y0.BYTES_PER_ELEMENT*2 );
|
|
73
|
-
> N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
|
|
74
|
-
> {{alias}}( N, x1, -2, y1, 1 );
|
|
75
|
-
> z = y0.get( 2 );
|
|
76
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
77
|
-
7.0
|
|
78
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
79
|
-
8.0
|
|
80
|
-
> z = x0.get( 1 );
|
|
81
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
82
|
-
0.0
|
|
83
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
84
|
-
0.0
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
|
|
88
|
-
Interchanges two complex single-precision floating-point vectors using
|
|
89
|
-
alternative indexing semantics.
|
|
90
|
-
|
|
91
|
-
While typed array views mandate a view offset based on the underlying
|
|
92
|
-
buffer, the `offset` parameters support indexing semantics based on starting
|
|
93
|
-
indices.
|
|
94
|
-
|
|
95
|
-
Parameters
|
|
96
|
-
----------
|
|
97
|
-
N: integer
|
|
98
|
-
Number of values to swap.
|
|
99
|
-
|
|
100
|
-
x: Complex64Array
|
|
101
|
-
First input array.
|
|
102
|
-
|
|
103
|
-
strideX: integer
|
|
104
|
-
Index increment for `x`.
|
|
105
|
-
|
|
106
|
-
offsetX: integer
|
|
107
|
-
Starting index for `x`.
|
|
108
|
-
|
|
109
|
-
y: Complex64Array
|
|
110
|
-
Second input array.
|
|
111
|
-
|
|
112
|
-
strideY: integer
|
|
113
|
-
Index increment for `y`.
|
|
114
|
-
|
|
115
|
-
offsetY: integer
|
|
116
|
-
Starting index for `y`.
|
|
117
|
-
|
|
118
|
-
Returns
|
|
119
|
-
-------
|
|
120
|
-
y: Complex64Array
|
|
121
|
-
Input array `y`.
|
|
122
|
-
|
|
123
|
-
Examples
|
|
124
|
-
--------
|
|
125
|
-
// Standard usage:
|
|
126
|
-
> var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] );
|
|
127
|
-
> var y = new {{alias:@stdlib/array/complex64}}( [ 6.0, 7.0, 8.0, 9.0 ] );
|
|
128
|
-
> {{alias}}.ndarray( x.length, x, 1, 0, y, 1, 0 );
|
|
129
|
-
> var z = y.get( 0 );
|
|
130
|
-
> var re = {{alias:@stdlib/complex/realf}}( z )
|
|
131
|
-
1.0
|
|
132
|
-
> var im = {{alias:@stdlib/complex/imagf}}( z )
|
|
133
|
-
2.0
|
|
134
|
-
> z = x.get( 0 );
|
|
135
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
136
|
-
6.0
|
|
137
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
138
|
-
7.0
|
|
139
|
-
|
|
140
|
-
// Advanced indexing:
|
|
141
|
-
> x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
|
|
142
|
-
> y = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
143
|
-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
|
|
144
|
-
> {{alias}}.ndarray( N, x, 2, 1, y, -1, y.length-1 );
|
|
145
|
-
> z = y.get( y.length-1 );
|
|
146
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
147
|
-
3.0
|
|
148
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
149
|
-
4.0
|
|
150
|
-
> z = x.get( 1 );
|
|
151
|
-
> re = {{alias:@stdlib/complex/realf}}( z )
|
|
152
|
-
0.0
|
|
153
|
-
> im = {{alias:@stdlib/complex/imagf}}( z )
|
|
154
|
-
0.0
|
|
155
|
-
|
|
156
|
-
See Also
|
|
157
|
-
--------
|
|
158
|
-
|