@stdlib/blas-base-ccopy 0.2.1 → 0.4.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 +146 -62
- package/dist/index.js +7 -7
- package/dist/index.js.map +4 -4
- package/docs/types/index.d.ts +8 -48
- package/include/stdlib/blas/base/ccopy.h +11 -4
- package/include/stdlib/blas/base/ccopy_cblas.h +6 -4
- package/include/stdlib/blas/base/ccopy_fortran.h +4 -4
- package/lib/ccopy.js +7 -52
- package/lib/ccopy.native.js +2 -12
- package/lib/index.js +4 -24
- package/lib/ndarray.js +2 -12
- package/lib/ndarray.native.js +5 -23
- package/manifest.json +289 -9
- package/package.json +14 -13
- package/src/addon.c +23 -3
- package/src/ccopy.c +7 -35
- package/src/ccopy.f +9 -9
- package/src/ccopy_cblas.c +26 -2
- package/src/ccopy_f.c +25 -1
- package/src/ccopy_ndarray.c +56 -0
- package/include.gypi +0 -70
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -59,22 +59,12 @@ Copies values from `x` into `y`.
|
|
|
59
59
|
|
|
60
60
|
```javascript
|
|
61
61
|
var Complex64Array = require( '@stdlib/array-complex64' );
|
|
62
|
-
var realf = require( '@stdlib/complex-realf' );
|
|
63
|
-
var imagf = require( '@stdlib/complex-imagf' );
|
|
64
62
|
|
|
65
63
|
var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
|
66
64
|
var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
67
65
|
|
|
68
66
|
ccopy( x.length, x, 1, y, 1 );
|
|
69
|
-
|
|
70
|
-
var z = y.get( 0 );
|
|
71
|
-
// returns <Complex64>
|
|
72
|
-
|
|
73
|
-
var re = realf( z );
|
|
74
|
-
// returns 1.0
|
|
75
|
-
|
|
76
|
-
var im = imagf( z );
|
|
77
|
-
// returns 2.0
|
|
67
|
+
// y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
|
78
68
|
```
|
|
79
69
|
|
|
80
70
|
The function has the following parameters:
|
|
@@ -89,22 +79,12 @@ The `N` and stride parameters determine how values from `x` are copied into `y`.
|
|
|
89
79
|
|
|
90
80
|
```javascript
|
|
91
81
|
var Complex64Array = require( '@stdlib/array-complex64' );
|
|
92
|
-
var realf = require( '@stdlib/complex-realf' );
|
|
93
|
-
var imagf = require( '@stdlib/complex-imagf' );
|
|
94
82
|
|
|
95
83
|
var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
|
|
96
84
|
var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
97
85
|
|
|
98
86
|
ccopy( 2, x, -2, y, 1 );
|
|
99
|
-
|
|
100
|
-
var z = y.get( 0 );
|
|
101
|
-
// returns <Complex64>
|
|
102
|
-
|
|
103
|
-
var re = realf( z );
|
|
104
|
-
// returns 5.0
|
|
105
|
-
|
|
106
|
-
var im = imagf( z );
|
|
107
|
-
// returns 6.0
|
|
87
|
+
// y => <Complex64Array>[ 5.0, 6.0, 1.0, 2.0, 0.0, 0.0, 0.0, 0.0 ]
|
|
108
88
|
```
|
|
109
89
|
|
|
110
90
|
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
|
|
@@ -113,8 +93,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [
|
|
|
113
93
|
|
|
114
94
|
```javascript
|
|
115
95
|
var Complex64Array = require( '@stdlib/array-complex64' );
|
|
116
|
-
var realf = require( '@stdlib/complex-realf' );
|
|
117
|
-
var imagf = require( '@stdlib/complex-imagf' );
|
|
118
96
|
|
|
119
97
|
// Initial arrays...
|
|
120
98
|
var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
|
|
@@ -126,15 +104,7 @@ var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3r
|
|
|
126
104
|
|
|
127
105
|
// Copy in reverse order every other value from `x1` into `y1`...
|
|
128
106
|
ccopy( 2, x1, -2, y1, 1 );
|
|
129
|
-
|
|
130
|
-
var z = y0.get( 2 );
|
|
131
|
-
// returns <Complex64>
|
|
132
|
-
|
|
133
|
-
var re = realf( z );
|
|
134
|
-
// returns 7.0
|
|
135
|
-
|
|
136
|
-
var im = imagf( z );
|
|
137
|
-
// returns 8.0
|
|
107
|
+
// y0 => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 7.0, 8.0, 3.0, 4.0 ]
|
|
138
108
|
```
|
|
139
109
|
|
|
140
110
|
#### ccopy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
|
|
@@ -143,22 +113,12 @@ Copies values from `x` into `y` using alternative indexing semantics.
|
|
|
143
113
|
|
|
144
114
|
```javascript
|
|
145
115
|
var Complex64Array = require( '@stdlib/array-complex64' );
|
|
146
|
-
var realf = require( '@stdlib/complex-realf' );
|
|
147
|
-
var imagf = require( '@stdlib/complex-imagf' );
|
|
148
116
|
|
|
149
117
|
var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
|
150
118
|
var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
151
119
|
|
|
152
120
|
ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 );
|
|
153
|
-
|
|
154
|
-
var z = y.get( 0 );
|
|
155
|
-
// returns <Complex64>
|
|
156
|
-
|
|
157
|
-
var re = realf( z );
|
|
158
|
-
// returns 1.0
|
|
159
|
-
|
|
160
|
-
var im = imagf( z );
|
|
161
|
-
// returns 2.0
|
|
121
|
+
// y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
|
162
122
|
```
|
|
163
123
|
|
|
164
124
|
The function has the following additional parameters:
|
|
@@ -170,22 +130,12 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the
|
|
|
170
130
|
|
|
171
131
|
```javascript
|
|
172
132
|
var Complex64Array = require( '@stdlib/array-complex64' );
|
|
173
|
-
var realf = require( '@stdlib/complex-realf' );
|
|
174
|
-
var imagf = require( '@stdlib/complex-imagf' );
|
|
175
133
|
|
|
176
134
|
var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
|
|
177
135
|
var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
178
136
|
|
|
179
137
|
ccopy.ndarray( 2, x, 2, 1, y, -1, y.length-1 );
|
|
180
|
-
|
|
181
|
-
var z = y.get( y.length-1 );
|
|
182
|
-
// returns <Complex64>
|
|
183
|
-
|
|
184
|
-
var re = realf( z );
|
|
185
|
-
// returns 3.0
|
|
186
|
-
|
|
187
|
-
var im = imagf( z );
|
|
188
|
-
// returns 4.0
|
|
138
|
+
// y => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 7.0, 8.0, 3.0, 4.0 ]
|
|
189
139
|
```
|
|
190
140
|
|
|
191
141
|
</section>
|
|
@@ -212,7 +162,7 @@ var im = imagf( z );
|
|
|
212
162
|
```javascript
|
|
213
163
|
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
|
|
214
164
|
var filledarrayBy = require( '@stdlib/array-filled-by' );
|
|
215
|
-
var Complex64 = require( '@stdlib/complex-float32' );
|
|
165
|
+
var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
216
166
|
var ccopy = require( '@stdlib/blas-base-ccopy' );
|
|
217
167
|
|
|
218
168
|
function rand() {
|
|
@@ -234,6 +184,140 @@ console.log( y.get( y.length-1 ).toString() );
|
|
|
234
184
|
|
|
235
185
|
<!-- /.examples -->
|
|
236
186
|
|
|
187
|
+
<!-- C interface documentation. -->
|
|
188
|
+
|
|
189
|
+
* * *
|
|
190
|
+
|
|
191
|
+
<section class="c">
|
|
192
|
+
|
|
193
|
+
## C APIs
|
|
194
|
+
|
|
195
|
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
|
|
196
|
+
|
|
197
|
+
<section class="intro">
|
|
198
|
+
|
|
199
|
+
</section>
|
|
200
|
+
|
|
201
|
+
<!-- /.intro -->
|
|
202
|
+
|
|
203
|
+
<!-- C usage documentation. -->
|
|
204
|
+
|
|
205
|
+
<section class="usage">
|
|
206
|
+
|
|
207
|
+
### Usage
|
|
208
|
+
|
|
209
|
+
```c
|
|
210
|
+
#include "stdlib/blas/base/ccopy.h"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
#### c_ccopy( N, \*X, strideX, \*Y, strideY )
|
|
214
|
+
|
|
215
|
+
Copies values from `X` into `Y`.
|
|
216
|
+
|
|
217
|
+
```c
|
|
218
|
+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f }; // interleaved real and imaginary components
|
|
219
|
+
float y[] = { 0.0f, 0.0f, 0.0f, 0.0f };
|
|
220
|
+
|
|
221
|
+
c_ccopy( 2, (void *)x, 1, (void *)y, 1 );
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The function accepts the following arguments:
|
|
225
|
+
|
|
226
|
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
|
|
227
|
+
- **X**: `[in] void*` input array.
|
|
228
|
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
|
|
229
|
+
- **Y**: `[out] void*` output array.
|
|
230
|
+
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
|
|
231
|
+
|
|
232
|
+
```c
|
|
233
|
+
void c_ccopy( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### c_ccopy_ndarray( N, \*X, strideX, offsetX, \*Y, strideY, offsetY )
|
|
237
|
+
|
|
238
|
+
Copies values from `X` into `Y` using alternative indexing semantics.
|
|
239
|
+
|
|
240
|
+
```c
|
|
241
|
+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f }; // interleaved real and imaginary components
|
|
242
|
+
float y[] = { 0.0f, 0.0f, 0.0f, 0.0f };
|
|
243
|
+
|
|
244
|
+
c_ccopy_ndarray( 2, (void *)x, 1, 0, (void *)y, 1, 0 );
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
The function accepts the following arguments:
|
|
248
|
+
|
|
249
|
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
|
|
250
|
+
- **X**: `[in] void*` input array.
|
|
251
|
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
|
|
252
|
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
|
|
253
|
+
- **Y**: `[out] void*` output array.
|
|
254
|
+
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
|
|
255
|
+
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
|
|
256
|
+
|
|
257
|
+
```c
|
|
258
|
+
void c_ccopy_ndarray( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
</section>
|
|
262
|
+
|
|
263
|
+
<!-- /.usage -->
|
|
264
|
+
|
|
265
|
+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
266
|
+
|
|
267
|
+
<section class="notes">
|
|
268
|
+
|
|
269
|
+
</section>
|
|
270
|
+
|
|
271
|
+
<!-- /.notes -->
|
|
272
|
+
|
|
273
|
+
<!-- C API usage examples. -->
|
|
274
|
+
|
|
275
|
+
<section class="examples">
|
|
276
|
+
|
|
277
|
+
### Examples
|
|
278
|
+
|
|
279
|
+
```c
|
|
280
|
+
#include "stdlib/blas/base/ccopy.h"
|
|
281
|
+
#include <stdio.h>
|
|
282
|
+
|
|
283
|
+
int main( void ) {
|
|
284
|
+
// Create strided arrays:
|
|
285
|
+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
|
|
286
|
+
float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
|
|
287
|
+
|
|
288
|
+
// Specify the number of elements:
|
|
289
|
+
const int N = 4;
|
|
290
|
+
|
|
291
|
+
// Specify stride lengths:
|
|
292
|
+
const int strideX = 1;
|
|
293
|
+
const int strideY = -1;
|
|
294
|
+
|
|
295
|
+
// Copy elements:
|
|
296
|
+
c_ccopy( N, (void *)x, strideX, (void *)y, strideY );
|
|
297
|
+
|
|
298
|
+
// Print the result:
|
|
299
|
+
for ( int i = 0; i < N; i++ ) {
|
|
300
|
+
printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] );
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Copy elements using alternative indexing semantics:
|
|
304
|
+
c_ccopy_ndarray( N, (void *)x, -strideX, N-1, (void *)y, strideY, N-1 );
|
|
305
|
+
|
|
306
|
+
// Print the result:
|
|
307
|
+
for ( int i = 0; i < N; i++ ) {
|
|
308
|
+
printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] );
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
</section>
|
|
314
|
+
|
|
315
|
+
<!-- /.examples -->
|
|
316
|
+
|
|
317
|
+
</section>
|
|
318
|
+
|
|
319
|
+
<!-- /.c -->
|
|
320
|
+
|
|
237
321
|
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
238
322
|
|
|
239
323
|
<section class="related">
|
|
@@ -242,7 +326,7 @@ console.log( y.get( y.length-1 ).toString() );
|
|
|
242
326
|
|
|
243
327
|
## See Also
|
|
244
328
|
|
|
245
|
-
- <span class="package-name">[`@stdlib/blas-base/cswap`][@stdlib/blas/base/cswap]</span><span class="delimiter">: </span><span class="description">
|
|
329
|
+
- <span class="package-name">[`@stdlib/blas-base/cswap`][@stdlib/blas/base/cswap]</span><span class="delimiter">: </span><span class="description">interchange two complex single-precision floating-point vectors.</span>
|
|
246
330
|
|
|
247
331
|
</section>
|
|
248
332
|
|
|
@@ -274,7 +358,7 @@ See [LICENSE][stdlib-license].
|
|
|
274
358
|
|
|
275
359
|
## Copyright
|
|
276
360
|
|
|
277
|
-
Copyright © 2016-
|
|
361
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
278
362
|
|
|
279
363
|
</section>
|
|
280
364
|
|
|
@@ -287,8 +371,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
287
371
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/blas-base-ccopy.svg
|
|
288
372
|
[npm-url]: https://npmjs.org/package/@stdlib/blas-base-ccopy
|
|
289
373
|
|
|
290
|
-
[test-image]: https://github.com/stdlib-js/blas-base-ccopy/actions/workflows/test.yml/badge.svg?branch=v0.
|
|
291
|
-
[test-url]: https://github.com/stdlib-js/blas-base-ccopy/actions/workflows/test.yml?query=branch:v0.
|
|
374
|
+
[test-image]: https://github.com/stdlib-js/blas-base-ccopy/actions/workflows/test.yml/badge.svg?branch=v0.4.0
|
|
375
|
+
[test-url]: https://github.com/stdlib-js/blas-base-ccopy/actions/workflows/test.yml?query=branch:v0.4.0
|
|
292
376
|
|
|
293
377
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-base-ccopy/main.svg
|
|
294
378
|
[coverage-url]: https://codecov.io/github/stdlib-js/blas-base-ccopy?branch=main
|
|
@@ -300,8 +384,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
300
384
|
|
|
301
385
|
-->
|
|
302
386
|
|
|
303
|
-
[chat-image]: https://img.shields.io/
|
|
304
|
-
[chat-url]: https://
|
|
387
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
388
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
305
389
|
|
|
306
390
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
307
391
|
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
var
|
|
3
|
-
});var
|
|
4
|
-
var
|
|
5
|
-
});var
|
|
6
|
-
var z=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),
|
|
7
|
-
});var B=require("path").join,C=require('@stdlib/utils-try-require/dist'),D=require('@stdlib/assert-is-error/dist'),F=
|
|
1
|
+
"use strict";var p=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var y=p(function(H,m){
|
|
2
|
+
var j=require('@stdlib/strided-base-reinterpret-complex64/dist');function g(r,e,i,u,a,s,n){var o,c,x,d,v,t,q;if(r<=0)return a;for(o=j(e,0),c=j(a,0),x=i*2,d=s*2,v=u*2,t=n*2,q=0;q<r;q++)c[t]=o[v],c[t+1]=o[v+1],v+=x,t+=d;return a}m.exports=g
|
|
3
|
+
});var R=p(function(I,w){
|
|
4
|
+
var l=require('@stdlib/strided-base-stride2offset/dist'),h=y();function k(r,e,i,u,a){var s=l(r,i),n=l(r,a);return h(r,e,i,s,u,a,n)}w.exports=k
|
|
5
|
+
});var O=p(function(J,E){
|
|
6
|
+
var z=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),_=R(),A=y();z(_,"ndarray",A);E.exports=_
|
|
7
|
+
});var B=require("path").join,C=require('@stdlib/utils-try-require/dist'),D=require('@stdlib/assert-is-error/dist'),F=O(),f,b=C(B(__dirname,"./native.js"));D(b)?f=F:f=b;module.exports=f;
|
|
8
8
|
/** @license Apache-2.0 */
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../lib/
|
|
4
|
-
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} output array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n
|
|
5
|
-
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,4CAA6C,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../lib/ndarray.js", "../lib/ccopy.js", "../lib/main.js", "../lib/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Complex64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Complex64Array} output array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );\n*\n* ccopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]\n*/\nfunction ccopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tix = offsetX * 2;\n\tiy = offsetY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tviewY[ iy ] = viewX[ ix ];\n\t\tviewY[ iy+1 ] = viewX[ ix+1 ];\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided-base-stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} output array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );\n*\n* ccopy( x.length, x, 1, y, 1 );\n* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]\n*/\nfunction ccopy( N, x, strideX, y, strideY ) {\n\tvar ox = stride2offset( N, strideX );\n\tvar oy = stride2offset( N, strideY );\n\treturn ndarray( N, x, strideX, ox, y, strideY, oy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar ccopy = require( './ccopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ccopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @module @stdlib/blas-base-ccopy\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var ccopy = require( '@stdlib/blas-base-ccopy' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );\n*\n* ccopy( x.length, x, 1, y, 1 );\n* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var ccopy = require( '@stdlib/blas-base-ccopy' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );\n*\n* ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils-try-require' );\nvar isError = require( '@stdlib/assert-is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ccopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tccopy = main;\n} else {\n\tccopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n\n// exports: { \"ndarray\": \"ccopy.ndarray\" }\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,4CAA6C,EA0BxE,SAASC,EAAOC,EAAGC,EAAGC,EAASC,EAASC,EAAGC,EAASC,EAAU,CAC7D,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,GAAKb,GAAK,EACT,OAAOI,EAQR,IANAG,EAAQT,EAAaG,EAAG,CAAE,EAC1BO,EAAQV,EAAaM,EAAG,CAAE,EAC1BK,EAAKP,EAAU,EACfQ,EAAKL,EAAU,EACfM,EAAKR,EAAU,EACfS,EAAKN,EAAU,EACTO,EAAI,EAAGA,EAAIb,EAAGa,IACnBL,EAAOI,CAAG,EAAIL,EAAOI,CAAG,EACxBH,EAAOI,EAAG,CAAE,EAAIL,EAAOI,EAAG,CAAE,EAC5BA,GAAMF,EACNG,GAAMF,EAEP,OAAON,CACR,CAKAP,EAAO,QAAUE,IC9EjB,IAAAe,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,oCAAqC,EAC9DC,EAAU,IAwBd,SAASC,EAAOC,EAAGC,EAAGC,EAASC,EAAGC,EAAU,CAC3C,IAAIC,EAAKR,EAAeG,EAAGE,CAAQ,EAC/BI,EAAKT,EAAeG,EAAGI,CAAQ,EACnC,OAAON,EAASE,EAAGC,EAAGC,EAASG,EAAIF,EAAGC,EAASE,CAAG,CACnD,CAKAV,EAAO,QAAUG,ICxDjB,IAAAQ,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAQ,IACRC,EAAU,IAKdF,EAAaC,EAAO,UAAWC,CAAQ,EAKvCH,EAAO,QAAUE,ICcjB,IAAIE,EAAO,QAAS,MAAO,EAAE,KACzBC,EAAa,QAAS,2BAA4B,EAClDC,EAAU,QAAS,yBAA0B,EAC7CC,EAAO,IAKPC,EACAC,EAAMJ,EAAYD,EAAM,UAAW,aAAc,CAAE,EAClDE,EAASG,CAAI,EACjBD,EAAQD,EAERC,EAAQC,EAMT,OAAO,QAAUD",
|
|
6
|
+
"names": ["require_ndarray", "__commonJSMin", "exports", "module", "reinterpret", "ccopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "viewX", "viewY", "sx", "sy", "ix", "iy", "i", "require_ccopy", "__commonJSMin", "exports", "module", "stride2offset", "ndarray", "ccopy", "N", "x", "strideX", "y", "strideY", "ox", "oy", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ccopy", "ndarray", "join", "tryRequire", "isError", "main", "ccopy", "tmp"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -38,22 +38,12 @@ interface Routine {
|
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* var Complex64Array = require( '@stdlib/array-complex64' );
|
|
41
|
-
* var realf = require( '@stdlib/complex-realf' );
|
|
42
|
-
* var imagf = require( '@stdlib/complex-imagf' );
|
|
43
41
|
*
|
|
44
42
|
* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
|
45
|
-
* var y = new Complex64Array( [
|
|
43
|
+
* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
46
44
|
*
|
|
47
45
|
* ccopy( x.length, x, 1, y, 1 );
|
|
48
|
-
*
|
|
49
|
-
* var z = y.get( 0 );
|
|
50
|
-
* // returns <Complex64>
|
|
51
|
-
*
|
|
52
|
-
* var re = realf( z );
|
|
53
|
-
* // returns 1.0
|
|
54
|
-
*
|
|
55
|
-
* var im = imagf( z );
|
|
56
|
-
* // returns 2.0
|
|
46
|
+
* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
|
57
47
|
*/
|
|
58
48
|
( N: number, x: Complex64Array, strideX: number, y: Complex64Array, strideY: number ): Complex64Array;
|
|
59
49
|
|
|
@@ -71,22 +61,12 @@ interface Routine {
|
|
|
71
61
|
*
|
|
72
62
|
* @example
|
|
73
63
|
* var Complex64Array = require( '@stdlib/array-complex64' );
|
|
74
|
-
* var realf = require( '@stdlib/complex-realf' );
|
|
75
|
-
* var imagf = require( '@stdlib/complex-imagf' );
|
|
76
64
|
*
|
|
77
65
|
* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
|
78
|
-
* var y = new Complex64Array( [
|
|
66
|
+
* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
79
67
|
*
|
|
80
68
|
* ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 );
|
|
81
|
-
*
|
|
82
|
-
* var z = y.get( 0 );
|
|
83
|
-
* // returns <Complex64>
|
|
84
|
-
*
|
|
85
|
-
* var re = realf( z );
|
|
86
|
-
* // returns 1.0
|
|
87
|
-
*
|
|
88
|
-
* var im = imagf( z );
|
|
89
|
-
* // returns 2.0
|
|
69
|
+
* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
|
90
70
|
*/
|
|
91
71
|
ndarray( N: number, x: Complex64Array, strideX: number, offsetX: number, y: Complex64Array, strideY: number, offsetY: number ): Complex64Array;
|
|
92
72
|
}
|
|
@@ -103,41 +83,21 @@ interface Routine {
|
|
|
103
83
|
*
|
|
104
84
|
* @example
|
|
105
85
|
* var Complex64Array = require( '@stdlib/array-complex64' );
|
|
106
|
-
* var realf = require( '@stdlib/complex-realf' );
|
|
107
|
-
* var imagf = require( '@stdlib/complex-imagf' );
|
|
108
86
|
*
|
|
109
87
|
* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
|
110
|
-
* var y = new Complex64Array( [
|
|
88
|
+
* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
111
89
|
*
|
|
112
90
|
* ccopy( x.length, x, 1, y, 1 );
|
|
113
|
-
*
|
|
114
|
-
* var z = y.get( 0 );
|
|
115
|
-
* // returns <Complex64>
|
|
116
|
-
*
|
|
117
|
-
* var re = realf( z );
|
|
118
|
-
* // returns 1.0
|
|
119
|
-
*
|
|
120
|
-
* var im = imagf( z );
|
|
121
|
-
* // returns 2.0
|
|
91
|
+
* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
|
122
92
|
*
|
|
123
93
|
* @example
|
|
124
94
|
* var Complex64Array = require( '@stdlib/array-complex64' );
|
|
125
|
-
* var realf = require( '@stdlib/complex-realf' );
|
|
126
|
-
* var imagf = require( '@stdlib/complex-imagf' );
|
|
127
95
|
*
|
|
128
96
|
* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
|
129
|
-
* var y = new Complex64Array( [
|
|
97
|
+
* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
130
98
|
*
|
|
131
99
|
* ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 );
|
|
132
|
-
*
|
|
133
|
-
* var z = y.get( 0 );
|
|
134
|
-
* // returns <Complex64>
|
|
135
|
-
*
|
|
136
|
-
* var re = realf( z );
|
|
137
|
-
* // returns 1.0
|
|
138
|
-
*
|
|
139
|
-
* var im = imagf( z );
|
|
140
|
-
* // returns 2.0
|
|
100
|
+
* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
|
141
101
|
*/
|
|
142
102
|
declare var ccopy: Routine;
|
|
143
103
|
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* Header file containing function declarations for the C interface to the BLAS Level 1 routine `ccopy`.
|
|
21
21
|
*/
|
|
22
|
-
#ifndef
|
|
23
|
-
#define
|
|
22
|
+
#ifndef STDLIB_BLAS_BASE_CCOPY_H
|
|
23
|
+
#define STDLIB_BLAS_BASE_CCOPY_H
|
|
24
|
+
|
|
25
|
+
#include "stdlib/blas/base/shared.h"
|
|
24
26
|
|
|
25
27
|
/*
|
|
26
28
|
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
|
|
@@ -32,10 +34,15 @@ extern "C" {
|
|
|
32
34
|
/**
|
|
33
35
|
* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.
|
|
34
36
|
*/
|
|
35
|
-
void c_ccopy( const
|
|
37
|
+
void API_SUFFIX(c_ccopy)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector using alternative indexing semantics.
|
|
41
|
+
*/
|
|
42
|
+
void API_SUFFIX(c_ccopy_ndarray)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
|
|
36
43
|
|
|
37
44
|
#ifdef __cplusplus
|
|
38
45
|
}
|
|
39
46
|
#endif
|
|
40
47
|
|
|
41
|
-
#endif // !
|
|
48
|
+
#endif // !STDLIB_BLAS_BASE_CCOPY_H
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* Header file containing function declarations for the C interface to the CBLAS Level 1 routine `cblas_ccopy`.
|
|
21
21
|
*/
|
|
22
|
-
#ifndef
|
|
23
|
-
#define
|
|
22
|
+
#ifndef STDLIB_BLAS_BASE_CCOPY_CBLAS_H
|
|
23
|
+
#define STDLIB_BLAS_BASE_CCOPY_CBLAS_H
|
|
24
|
+
|
|
25
|
+
#include "stdlib/blas/base/shared.h"
|
|
24
26
|
|
|
25
27
|
/*
|
|
26
28
|
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
|
|
@@ -32,10 +34,10 @@ extern "C" {
|
|
|
32
34
|
/**
|
|
33
35
|
* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.
|
|
34
36
|
*/
|
|
35
|
-
void cblas_ccopy( const
|
|
37
|
+
void API_SUFFIX(cblas_ccopy)( const CBLAS_INT N, const void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
|
|
36
38
|
|
|
37
39
|
#ifdef __cplusplus
|
|
38
40
|
}
|
|
39
41
|
#endif
|
|
40
42
|
|
|
41
|
-
#endif // !
|
|
43
|
+
#endif // !STDLIB_BLAS_BASE_CCOPY_CBLAS_H
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* Header file containing function declarations for the Fortran interface to the BLAS Level 1 routine `ccopy`.
|
|
21
21
|
*/
|
|
22
|
-
#ifndef
|
|
23
|
-
#define
|
|
22
|
+
#ifndef STDLIB_BLAS_BASE_CCOPY_FORTRAN_H
|
|
23
|
+
#define STDLIB_BLAS_BASE_CCOPY_FORTRAN_H
|
|
24
24
|
|
|
25
25
|
/*
|
|
26
26
|
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C/Fortran compiler (a Fortran compiler must be configured to not attach underscores).
|
|
@@ -32,10 +32,10 @@ extern "C" {
|
|
|
32
32
|
/**
|
|
33
33
|
* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.
|
|
34
34
|
*/
|
|
35
|
-
void ccopy( const
|
|
35
|
+
void ccopy( const CBLAS_INT *, const void *, const CBLAS_INT *, void *, const CBLAS_INT * );
|
|
36
36
|
|
|
37
37
|
#ifdef __cplusplus
|
|
38
38
|
}
|
|
39
39
|
#endif
|
|
40
40
|
|
|
41
|
-
#endif // !
|
|
41
|
+
#endif // !STDLIB_BLAS_BASE_CCOPY_FORTRAN_H
|
package/lib/ccopy.js
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
// MODULES //
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var stride2offset = require( '@stdlib/strided-base-stride2offset' );
|
|
24
|
+
var ndarray = require( './ndarray.js' );
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
// MAIN //
|
|
@@ -37,63 +38,17 @@ var reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' );
|
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
39
40
|
* var Complex64Array = require( '@stdlib/array-complex64' );
|
|
40
|
-
* var realf = require( '@stdlib/complex-realf' );
|
|
41
|
-
* var imagf = require( '@stdlib/complex-imagf' );
|
|
42
41
|
*
|
|
43
42
|
* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
|
|
44
|
-
* var y = new Complex64Array( [
|
|
43
|
+
* var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
|
|
45
44
|
*
|
|
46
45
|
* ccopy( x.length, x, 1, y, 1 );
|
|
47
|
-
*
|
|
48
|
-
* var z = y.get( 0 );
|
|
49
|
-
* // returns <Complex64>
|
|
50
|
-
*
|
|
51
|
-
* var re = realf( z );
|
|
52
|
-
* // returns 1.0
|
|
53
|
-
*
|
|
54
|
-
* var im = imagf( z );
|
|
55
|
-
* // returns 2.0
|
|
46
|
+
* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
|
|
56
47
|
*/
|
|
57
48
|
function ccopy( N, x, strideX, y, strideY ) {
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
var sy;
|
|
62
|
-
var ix;
|
|
63
|
-
var iy;
|
|
64
|
-
var i;
|
|
65
|
-
|
|
66
|
-
if ( N <= 0 ) {
|
|
67
|
-
return y;
|
|
68
|
-
}
|
|
69
|
-
viewX = reinterpret( x, 0 );
|
|
70
|
-
viewY = reinterpret( y, 0 );
|
|
71
|
-
if ( strideX === 1 && strideY === 1 ) {
|
|
72
|
-
for ( i = 0; i < N*2; i += 2 ) {
|
|
73
|
-
viewY[ i ] = viewX[ i ];
|
|
74
|
-
viewY[ i+1 ] = viewX[ i+1 ];
|
|
75
|
-
}
|
|
76
|
-
return y;
|
|
77
|
-
}
|
|
78
|
-
if ( strideX < 0 ) {
|
|
79
|
-
ix = 2 * (1-N) * strideX;
|
|
80
|
-
} else {
|
|
81
|
-
ix = 0;
|
|
82
|
-
}
|
|
83
|
-
if ( strideY < 0 ) {
|
|
84
|
-
iy = 2 * (1-N) * strideY;
|
|
85
|
-
} else {
|
|
86
|
-
iy = 0;
|
|
87
|
-
}
|
|
88
|
-
sx = strideX * 2;
|
|
89
|
-
sy = strideY * 2;
|
|
90
|
-
for ( i = 0; i < N; i++ ) {
|
|
91
|
-
viewY[ iy ] = viewX[ ix ];
|
|
92
|
-
viewY[ iy+1 ] = viewX[ ix+1 ];
|
|
93
|
-
ix += sx;
|
|
94
|
-
iy += sy;
|
|
95
|
-
}
|
|
96
|
-
return y;
|
|
49
|
+
var ox = stride2offset( N, strideX );
|
|
50
|
+
var oy = stride2offset( N, strideY );
|
|
51
|
+
return ndarray( N, x, strideX, ox, y, strideY, oy );
|
|
97
52
|
}
|
|
98
53
|
|
|
99
54
|
|