@stdlib/blas-base-cswap 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 CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -59,31 +59,13 @@ Interchanges two complex single-precision floating-point vectors.
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
  cswap( 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
78
-
79
- z = x.get( 0 );
80
- // returns <Complex64>
81
-
82
- re = realf( z );
83
- // returns 0.0
84
-
85
- im = imagf( z );
86
- // returns 0.0
67
+ // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
68
+ // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
87
69
  ```
88
70
 
89
71
  The function has the following parameters:
@@ -98,31 +80,13 @@ The `N` and stride parameters determine how values from `x` are interchanged wit
98
80
 
99
81
  ```javascript
100
82
  var Complex64Array = require( '@stdlib/array-complex64' );
101
- var realf = require( '@stdlib/complex-realf' );
102
- var imagf = require( '@stdlib/complex-imagf' );
103
83
 
104
84
  var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
105
85
  var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
106
86
 
107
87
  cswap( 2, x, -2, y, 1 );
108
-
109
- var z = y.get( 0 );
110
- // returns <Complex64>
111
-
112
- var re = realf( z );
113
- // returns 5.0
114
-
115
- var im = imagf( z );
116
- // returns 6.0
117
-
118
- z = x.get( 0 );
119
- // returns <Complex64>
120
-
121
- re = realf( z );
122
- // returns 0.0
123
-
124
- im = imagf( z );
125
- // returns 0.0
88
+ // x => <Complex64Array>[ 0.0, 0.0, 3.0, 4.0, 0.0, 0.0, 7.0, 8.0 ]
89
+ // y => <Complex64Array>[ 5.0, 6.0, 1.0, 2.0, 0.0, 0.0, 0.0, 0.0 ]
126
90
  ```
127
91
 
128
92
  Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
@@ -131,8 +95,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [
131
95
 
132
96
  ```javascript
133
97
  var Complex64Array = require( '@stdlib/array-complex64' );
134
- var realf = require( '@stdlib/complex-realf' );
135
- var imagf = require( '@stdlib/complex-imagf' );
136
98
 
137
99
  // Initial arrays...
138
100
  var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
@@ -144,24 +106,8 @@ var y1 = new Complex64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3r
144
106
 
145
107
  // Interchange in reverse order every other value from `x1` into `y1`...
146
108
  cswap( 2, x1, -2, y1, 1 );
147
-
148
- var z = y0.get( 2 );
149
- // returns <Complex64>
150
-
151
- var re = realf( z );
152
- // returns 7.0
153
-
154
- var im = imagf( z );
155
- // returns 8.0
156
-
157
- z = x0.get( 1 );
158
- // returns <Complex64>
159
-
160
- re = realf( z );
161
- // returns 0.0
162
-
163
- im = imagf( z );
164
- // returns 0.0
109
+ // x0 => <Complex64Array>[ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 0.0, 0.0 ]
110
+ // y0 => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 7.0, 8.0, 3.0, 4.0 ]
165
111
  ```
166
112
 
167
113
  #### cswap.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
@@ -170,31 +116,13 @@ Interchanges two complex single-precision floating-point vectors using alternati
170
116
 
171
117
  ```javascript
172
118
  var Complex64Array = require( '@stdlib/array-complex64' );
173
- var realf = require( '@stdlib/complex-realf' );
174
- var imagf = require( '@stdlib/complex-imagf' );
175
119
 
176
120
  var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
177
121
  var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
178
122
 
179
123
  cswap.ndarray( x.length, x, 1, 0, y, 1, 0 );
180
-
181
- var z = y.get( 0 );
182
- // returns <Complex64>
183
-
184
- var re = realf( z );
185
- // returns 1.0
186
-
187
- var im = imagf( z );
188
- // returns 2.0
189
-
190
- z = x.get( 0 );
191
- // returns <Complex64>
192
-
193
- re = realf( z );
194
- // returns 0.0
195
-
196
- im = imagf( z );
197
- // returns 0.0
124
+ // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
125
+ // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
198
126
  ```
199
127
 
200
128
  The function has the following additional parameters:
@@ -206,31 +134,13 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the
206
134
 
207
135
  ```javascript
208
136
  var Complex64Array = require( '@stdlib/array-complex64' );
209
- var realf = require( '@stdlib/complex-realf' );
210
- var imagf = require( '@stdlib/complex-imagf' );
211
137
 
212
138
  var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
213
139
  var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
214
140
 
215
141
  cswap.ndarray( 2, x, 2, 1, y, -1, y.length-1 );
216
-
217
- var z = y.get( y.length-1 );
218
- // returns <Complex64>
219
-
220
- var re = realf( z );
221
- // returns 3.0
222
-
223
- var im = imagf( z );
224
- // returns 4.0
225
-
226
- z = x.get( x.length-1 );
227
- // returns <Complex64>
228
-
229
- re = realf( z );
230
- // returns 0.0
231
-
232
- im = imagf( z );
233
- // returns 0.0
142
+ // x => <Complex64Array>[ 1.0, 2.0, 0.0, 0.0, 5.0, 6.0, 0.0, 0.0 ]
143
+ // y => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 7.0, 8.0, 3.0, 4.0 ]
234
144
  ```
235
145
 
236
146
  </section>
@@ -257,7 +167,7 @@ im = imagf( z );
257
167
  ```javascript
258
168
  var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
259
169
  var filledarrayBy = require( '@stdlib/array-filled-by' );
260
- var Complex64 = require( '@stdlib/complex-float32' );
170
+ var Complex64 = require( '@stdlib/complex-float32-ctor' );
261
171
  var cswap = require( '@stdlib/blas-base-cswap' );
262
172
 
263
173
  function rand() {
@@ -280,6 +190,133 @@ console.log( y.get( y.length-1 ).toString() );
280
190
 
281
191
  <!-- /.examples -->
282
192
 
193
+ <!-- C interface documentation. -->
194
+
195
+ * * *
196
+
197
+ <section class="c">
198
+
199
+ ## C APIs
200
+
201
+ <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
202
+
203
+ <section class="intro">
204
+
205
+ </section>
206
+
207
+ <!-- /.intro -->
208
+
209
+ <!-- C usage documentation. -->
210
+
211
+ <section class="usage">
212
+
213
+ ### Usage
214
+
215
+ ```c
216
+ #include "stdlib/blas/base/cswap.h"
217
+ ```
218
+
219
+ #### c_cswap( N, \*X, strideX, \*Y, strideY )
220
+
221
+ Interchanges two complex single-precision floating-point vectors.
222
+
223
+ ```c
224
+ float x[] = { 1.0f, 2.0f, 3.0f, 4.0f }; // interleaved real and imaginary components
225
+ float y[] = { 5.0f, 6.0f, 7.0f, 8.0f };
226
+
227
+ c_cswap( 2, (void *)x, 1, (void *)y, 1 );
228
+ ```
229
+
230
+ The function accepts the following arguments:
231
+
232
+ - **N**: `[in] CBLAS_INT` number of indexed elements.
233
+ - **X**: `[inout] void*` first input array.
234
+ - **strideX**: `[in] CBLAS_INT` index increment for `X`.
235
+ - **Y**: `[inout] void*` second input array.
236
+ - **strideY**: `[in] CBLAS_INT` index increment for `Y`.
237
+
238
+ ```c
239
+ void c_cswap( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
240
+ ```
241
+
242
+ #### c_cswap_ndarray( N, \*X, strideX, offsetX, \*Y, strideY, offsetY )
243
+
244
+ Interchanges two complex single-precision floating-point vectors using alternative indexing semantics.
245
+
246
+ ```c
247
+ float x[] = { 1.0f, 2.0f, 3.0f, 4.0f }; // interleaved real and imaginary components
248
+ float y[] = { 5.0f, 6.0f, 7.0f, 8.0f };
249
+
250
+ c_cswap_ndarray( 2, (void *)x, 1, 0, (void *)y, 1, 0 );
251
+ ```
252
+
253
+ The function accepts the following arguments:
254
+
255
+ - **N**: `[in] CBLAS_INT` number of indexed elements.
256
+ - **X**: `[inout] void*` first input array.
257
+ - **strideX**: `[in] CBLAS_INT` index increment for `X`.
258
+ - **offsetX**: `[in] CBLAS_INT` starting index for `X`.
259
+ - **Y**: `[inout] void*` second input array.
260
+ - **strideY**: `[in] CBLAS_INT` index increment for `Y`.
261
+ - **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
262
+
263
+ ```c
264
+ void c_cswap_ndarray( const CBLAS_INT N, void *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, void *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
265
+ ```
266
+
267
+ </section>
268
+
269
+ <!-- /.usage -->
270
+
271
+ <!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
272
+
273
+ <section class="notes">
274
+
275
+ </section>
276
+
277
+ <!-- /.notes -->
278
+
279
+ <!-- C API usage examples. -->
280
+
281
+ <section class="examples">
282
+
283
+ ### Examples
284
+
285
+ ```c
286
+ #include "stdlib/blas/base/cswap.h"
287
+ #include <stdio.h>
288
+
289
+ int main( void ) {
290
+ // Create strided arrays:
291
+ float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
292
+ float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
293
+
294
+ // Specify the number of elements:
295
+ const int N = 4;
296
+
297
+ // Specify stride lengths:
298
+ const int strideX = 1;
299
+ const int strideY = -1;
300
+
301
+ // Interchange the vectors:
302
+ c_cswap( N, (void *)x, strideX, (void *)y, strideY );
303
+
304
+ // Print the result:
305
+ for ( int i = 0; i < N; i++ ) {
306
+ printf( "x[ %i ] = %f + %fj\n", i, x[ i*2 ], x[ (i*2)+1 ] );
307
+ printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] );
308
+ }
309
+ }
310
+ ```
311
+
312
+ </section>
313
+
314
+ <!-- /.examples -->
315
+
316
+ </section>
317
+
318
+ <!-- /.c -->
319
+
283
320
  <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
284
321
 
285
322
  <section class="related">
@@ -320,7 +357,7 @@ See [LICENSE][stdlib-license].
320
357
 
321
358
  ## Copyright
322
359
 
323
- Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
360
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
324
361
 
325
362
  </section>
326
363
 
@@ -333,8 +370,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
333
370
  [npm-image]: http://img.shields.io/npm/v/@stdlib/blas-base-cswap.svg
334
371
  [npm-url]: https://npmjs.org/package/@stdlib/blas-base-cswap
335
372
 
336
- [test-image]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml/badge.svg?branch=v0.2.1
337
- [test-url]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml?query=branch:v0.2.1
373
+ [test-image]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml/badge.svg?branch=v0.4.0
374
+ [test-url]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml?query=branch:v0.4.0
338
375
 
339
376
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-base-cswap/main.svg
340
377
  [coverage-url]: https://codecov.io/github/stdlib-js/blas-base-cswap?branch=main
@@ -346,8 +383,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
346
383
 
347
384
  -->
348
385
 
349
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
350
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
386
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
387
+ [chat-url]: https://stdlib.zulipchat.com
351
388
 
352
389
  [stdlib]: https://github.com/stdlib-js/stdlib
353
390
 
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";var x=function(t,n){return function(){return n||t((n={exports:{}}).exports,n),n.exports}};var y=x(function(I,l){
2
- var j=require('@stdlib/strided-base-reinterpret-complex64/dist');function k(t,n,c,q,p){var i,v,e,o,f,u,s,r,a;if(t<=0)return q;if(i=j(n,0),v=j(q,0),c===1&&p===1){for(r=0;r<t*2;r+=2)e=i[r],i[r]=v[r],v[r]=e,a=r+1,e=i[a],i[a]=v[a],v[a]=e;return q}for(c<0?u=2*(1-t)*c:u=0,p<0?s=2*(1-t)*p:s=0,o=c*2,f=p*2,r=0;r<t;r++)e=i[u],i[u]=v[s],v[s]=e,e=i[u+1],i[u+1]=v[s+1],v[s+1]=e,u+=o,s+=f;return q}l.exports=k
3
- });var E=x(function(J,_){
4
- var R=require('@stdlib/strided-base-reinterpret-complex64/dist');function z(t,n,c,q,p,i,v){var e,o,f,u,s,r,a,w;if(t<=0)return p;for(e=R(n,0),o=R(p,0),u=c*2,s=i*2,r=q*2,a=v*2,w=0;w<t;w++)f=e[r],e[r]=o[a],o[a]=f,f=e[r+1],e[r+1]=o[a+1],o[a+1]=f,r+=u,a+=s;return p}_.exports=z
5
- });var g=x(function(K,b){
6
- var A=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),O=y(),B=E();A(O,"ndarray",B);b.exports=O
7
- });var C=require("path").join,D=require('@stdlib/utils-try-require/dist'),F=require('@stdlib/assert-is-error/dist'),G=g(),m,h=D(C(__dirname,"./native.js"));F(h)?m=G:m=h;module.exports=m;
1
+ "use strict";var f=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var x=f(function(I,j){
2
+ var m=require('@stdlib/strided-base-reinterpret-complex64/dist');function h(r,e,u,o,a,p,q){var t,s,n,y,d,i,v,c;if(r<=0)return a;for(t=m(e,0),s=m(a,0),y=u*2,d=p*2,i=o*2,v=q*2,c=0;c<r;c++)n=t[i],t[i]=s[v],s[v]=n,n=t[i+1],t[i+1]=s[v+1],s[v+1]=n,i+=y,v+=d;return a}j.exports=h
3
+ });var _=f(function(J,R){
4
+ var l=require('@stdlib/strided-base-stride2offset/dist'),k=x();function z(r,e,u,o,a){var p=l(r,u),q=l(r,a);return k(r,e,u,p,o,a,q)}R.exports=z
5
+ });var b=f(function(K,O){
6
+ var A=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),E=_(),B=x();A(E,"ndarray",B);O.exports=E
7
+ });var C=require("path").join,D=require('@stdlib/utils-try-require/dist'),F=require('@stdlib/assert-is-error/dist'),G=b(),w,g=D(C(__dirname,"./native.js"));F(g)?w=G:w=g;module.exports=w;
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/cswap.js", "../lib/ndarray.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* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns <Complex64>\n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns <Complex64>\n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\nfunction cswap( N, x, strideX, y, strideY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar tmp;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\tvar j;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tfor ( i = 0; i < N*2; i += 2 ) {\n\t\t\ttmp = viewX[ i ];\n\t\t\tviewX[ i ] = viewY[ i ];\n\t\t\tviewY[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = viewX[ j ];\n\t\t\tviewX[ j ] = viewY[ j ];\n\t\t\tviewY[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = 2 * (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = 2 * (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = viewX[ ix ];\n\t\tviewX[ ix ] = viewY[ iy ];\n\t\tviewY[ iy ] = tmp;\n\n\t\ttmp = viewX[ ix+1 ];\n\t\tviewX[ ix+1 ] = viewY[ iy+1 ];\n\t\tviewY[ iy+1 ] = tmp;\n\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\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 reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Complex64Array} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns <Complex64>\n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns <Complex64>\n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\nfunction cswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar tmp;\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\ttmp = viewX[ ix ];\n\t\tviewX[ ix ] = viewY[ iy ];\n\t\tviewY[ iy ] = tmp;\n\n\t\ttmp = viewX[ ix+1 ];\n\t\tviewX[ ix+1 ] = viewY[ iy+1 ];\n\t\tviewY[ iy+1 ] = tmp;\n\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\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 cswap = require( './cswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( cswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\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 interchange two complex single-precision floating-point vectors.\n*\n* @module @stdlib/blas-base-cswap\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n* var cswap = require( '@stdlib/blas-base-cswap' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns <Complex64>\n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns <Complex64>\n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var realf = require( '@stdlib/complex-realf' );\n* var imagf = require( '@stdlib/complex-imagf' );\n* var cswap = require( '@stdlib/blas-base-cswap' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns <Complex64>\n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns <Complex64>\n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.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 cswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tcswap = main;\n} else {\n\tcswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n\n// exports: { \"ndarray\": \"cswap.ndarray\" }\n"],
5
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,4CAA6C,EA2CxE,SAASC,EAAOC,EAAGC,EAAGC,EAASC,EAAGC,EAAU,CAC3C,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,GAAKb,GAAK,EACT,OAAOG,EAIR,GAFAE,EAAQP,EAAaG,EAAG,CAAE,EAC1BK,EAAQR,EAAaK,EAAG,CAAE,EACrBD,IAAY,GAAKE,IAAY,EAAI,CACrC,IAAMQ,EAAI,EAAGA,EAAIZ,EAAE,EAAGY,GAAK,EAC1BL,EAAMF,EAAOO,CAAE,EACfP,EAAOO,CAAE,EAAIN,EAAOM,CAAE,EACtBN,EAAOM,CAAE,EAAIL,EAEbM,EAAID,EAAI,EACRL,EAAMF,EAAOQ,CAAE,EACfR,EAAOQ,CAAE,EAAIP,EAAOO,CAAE,EACtBP,EAAOO,CAAE,EAAIN,EAEd,OAAOJ,CACR,CAaA,IAZKD,EAAU,EACdQ,EAAK,GAAK,EAAEV,GAAKE,EAEjBQ,EAAK,EAEDN,EAAU,EACdO,EAAK,GAAK,EAAEX,GAAKI,EAEjBO,EAAK,EAENH,EAAKN,EAAU,EACfO,EAAKL,EAAU,EACTQ,EAAI,EAAGA,EAAIZ,EAAGY,IACnBL,EAAMF,EAAOK,CAAG,EAChBL,EAAOK,CAAG,EAAIJ,EAAOK,CAAG,EACxBL,EAAOK,CAAG,EAAIJ,EAEdA,EAAMF,EAAOK,EAAG,CAAE,EAClBL,EAAOK,EAAG,CAAE,EAAIJ,EAAOK,EAAG,CAAE,EAC5BL,EAAOK,EAAG,CAAE,EAAIJ,EAEhBG,GAAMF,EACNG,GAAMF,EAEP,OAAON,CACR,CAKAN,EAAO,QAAUE,IC5HjB,IAAAe,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,4CAA6C,EA6CxE,SAASC,EAAOC,EAAGC,EAAGC,EAASC,EAASC,EAAGC,EAASC,EAAU,CAC7D,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,GAAKd,GAAK,EACT,OAAOI,EAQR,IANAG,EAAQT,EAAaG,EAAG,CAAE,EAC1BO,EAAQV,EAAaM,EAAG,CAAE,EAC1BM,EAAKR,EAAU,EACfS,EAAKN,EAAU,EACfO,EAAKT,EAAU,EACfU,EAAKP,EAAU,EACTQ,EAAI,EAAGA,EAAId,EAAGc,IACnBL,EAAMF,EAAOK,CAAG,EAChBL,EAAOK,CAAG,EAAIJ,EAAOK,CAAG,EACxBL,EAAOK,CAAG,EAAIJ,EAEdA,EAAMF,EAAOK,EAAG,CAAE,EAClBL,EAAOK,EAAG,CAAE,EAAIJ,EAAOK,EAAG,CAAE,EAC5BL,EAAOK,EAAG,CAAE,EAAIJ,EAEhBG,GAAMF,EACNG,GAAMF,EAEP,OAAOP,CACR,CAKAP,EAAO,QAAUE,ICxGjB,IAAAgB,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAQ,IACRC,EAAU,IAKdF,EAAaC,EAAO,UAAWC,CAAQ,EAKvCH,EAAO,QAAUE,ICoDjB,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_cswap", "__commonJSMin", "exports", "module", "reinterpret", "cswap", "N", "x", "strideX", "y", "strideY", "viewX", "viewY", "tmp", "sx", "sy", "ix", "iy", "i", "j", "require_ndarray", "__commonJSMin", "exports", "module", "reinterpret", "cswap", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "viewX", "viewY", "tmp", "sx", "sy", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "cswap", "ndarray", "join", "tryRequire", "isError", "main", "cswap", "tmp"]
3
+ "sources": ["../lib/ndarray.js", "../lib/cswap.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* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Complex64Array} `y`\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* cswap( x.length, x, 1, 0, y, 1, 0 );\n* // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]\n* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]\n*/\nfunction cswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar tmp;\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\ttmp = viewX[ ix ];\n\t\tviewX[ ix ] = viewY[ iy ];\n\t\tviewY[ iy ] = tmp;\n\n\t\ttmp = viewX[ ix+1 ];\n\t\tviewX[ ix+1 ] = viewY[ iy+1 ];\n\t\tviewY[ iy+1 ] = tmp;\n\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\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* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} `y`\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* cswap( x.length, x, 1, y, 1 );\n* // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]\n* // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]\n*/\nfunction cswap( 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 = cswap;\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 cswap = require( './cswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( cswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\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 interchange two complex single-precision floating-point vectors.\n*\n* @module @stdlib/blas-base-cswap\n*\n* @example\n* var Complex64Array = require( '@stdlib/array-complex64' );\n* var cswap = require( '@stdlib/blas-base-cswap' );\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* cswap( x.length, x, 1, y, 1 );\n* // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]\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 cswap = require( '@stdlib/blas-base-cswap' );\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* cswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.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 cswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tcswap = main;\n} else {\n\tcswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n\n// exports: { \"ndarray\": \"cswap.ndarray\" }\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,4CAA6C,EA2BxE,SAASC,EAAOC,EAAGC,EAAGC,EAASC,EAASC,EAAGC,EAASC,EAAU,CAC7D,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,GAAKd,GAAK,EACT,OAAOI,EAQR,IANAG,EAAQT,EAAaG,EAAG,CAAE,EAC1BO,EAAQV,EAAaM,EAAG,CAAE,EAC1BM,EAAKR,EAAU,EACfS,EAAKN,EAAU,EACfO,EAAKT,EAAU,EACfU,EAAKP,EAAU,EACTQ,EAAI,EAAGA,EAAId,EAAGc,IACnBL,EAAMF,EAAOK,CAAG,EAChBL,EAAOK,CAAG,EAAIJ,EAAOK,CAAG,EACxBL,EAAOK,CAAG,EAAIJ,EAEdA,EAAMF,EAAOK,EAAG,CAAE,EAClBL,EAAOK,EAAG,CAAE,EAAIJ,EAAOK,EAAG,CAAE,EAC5BL,EAAOK,EAAG,CAAE,EAAIJ,EAEhBG,GAAMF,EACNG,GAAMF,EAEP,OAAOP,CACR,CAKAP,EAAO,QAAUE,ICtFjB,IAAAgB,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,oCAAqC,EAC9DC,EAAU,IAyBd,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,ICzDjB,IAAAQ,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAQ,IACRC,EAAU,IAKdF,EAAaC,EAAO,UAAWC,CAAQ,EAKvCH,EAAO,QAAUE,ICgBjB,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", "cswap", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "viewX", "viewY", "tmp", "sx", "sy", "ix", "iy", "i", "require_cswap", "__commonJSMin", "exports", "module", "stride2offset", "ndarray", "cswap", "N", "x", "strideX", "y", "strideY", "ox", "oy", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "cswap", "ndarray", "join", "tryRequire", "isError", "main", "cswap", "tmp"]
7
7
  }
@@ -38,31 +38,13 @@ 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( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
43
+ * var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
46
44
  *
47
45
  * cswap( 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
57
- *
58
- * z = x.get( 0 );
59
- * // returns <Complex64>
60
- *
61
- * re = realf( z );
62
- * // returns 7.0
63
- *
64
- * im = imagf( z );
65
- * // returns 8.0
46
+ * // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
47
+ * // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
66
48
  */
67
49
  ( N: number, x: Complex64Array, strideX: number, y: Complex64Array, strideY: number ): Complex64Array;
68
50
 
@@ -80,31 +62,13 @@ interface Routine {
80
62
  *
81
63
  * @example
82
64
  * var Complex64Array = require( '@stdlib/array-complex64' );
83
- * var realf = require( '@stdlib/complex-realf' );
84
- * var imagf = require( '@stdlib/complex-imagf' );
85
65
  *
86
66
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
87
- * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
67
+ * var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
88
68
  *
89
69
  * cswap.ndarray( x.length, x, 1, 0, y, 1, 0 );
90
- *
91
- * var z = y.get( 0 );
92
- * // returns <Complex64>
93
- *
94
- * var re = realf( z );
95
- * // returns 1.0
96
- *
97
- * var im = imagf( z );
98
- * // returns 2.0
99
- *
100
- * z = x.get( 0 );
101
- * // returns <Complex64>
102
- *
103
- * re = realf( z );
104
- * // returns 7.0
105
- *
106
- * im = imagf( z );
107
- * // returns 8.0
70
+ * // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
71
+ * // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
108
72
  */
109
73
  ndarray( N: number, x: Complex64Array, strideX: number, offsetX: number, y: Complex64Array, strideY: number, offsetY: number ): Complex64Array;
110
74
  }
@@ -121,59 +85,23 @@ interface Routine {
121
85
  *
122
86
  * @example
123
87
  * var Complex64Array = require( '@stdlib/array-complex64' );
124
- * var realf = require( '@stdlib/complex-realf' );
125
- * var imagf = require( '@stdlib/complex-imagf' );
126
88
  *
127
89
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
128
- * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
90
+ * var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
129
91
  *
130
92
  * cswap( x.length, x, 1, y, 1 );
131
- *
132
- * var z = y.get( 0 );
133
- * // returns <Complex64>
134
- *
135
- * var re = realf( z );
136
- * // returns 1.0
137
- *
138
- * var im = imagf( z );
139
- * // returns 2.0
140
- *
141
- * z = x.get( 0 );
142
- * // returns <Complex64>
143
- *
144
- * re = realf( z );
145
- * // returns 7.0
146
- *
147
- * im = imagf( z );
148
- * // returns 8.0
93
+ * // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
94
+ * // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
149
95
  *
150
96
  * @example
151
97
  * var Complex64Array = require( '@stdlib/array-complex64' );
152
- * var realf = require( '@stdlib/complex-realf' );
153
- * var imagf = require( '@stdlib/complex-imagf' );
154
98
  *
155
99
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
156
- * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
100
+ * var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
157
101
  *
158
102
  * cswap.ndarray( x.length, x, 1, 0, y, 1, 0 );
159
- *
160
- * var z = y.get( 0 );
161
- * // returns <Complex64>
162
- *
163
- * var re = realf( z );
164
- * // returns 1.0
165
- *
166
- * var im = imagf( z );
167
- * // returns 2.0
168
- *
169
- * z = x.get( 0 );
170
- * // returns <Complex64>
171
- *
172
- * re = realf( z );
173
- * // returns 7.0
174
- *
175
- * im = imagf( z );
176
- * // returns 8.0
103
+ * // x => <Complex64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]
104
+ * // y => <Complex64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]
177
105
  */
178
106
  declare var cswap: Routine;
179
107
 
@@ -19,8 +19,10 @@
19
19
  /**
20
20
  * Header file containing function declarations for the C interface to the BLAS Level 1 routine `cswap`.
21
21
  */
22
- #ifndef CSWAP_H
23
- #define CSWAP_H
22
+ #ifndef STDLIB_BLAS_BASE_CSWAP_H
23
+ #define STDLIB_BLAS_BASE_CSWAP_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
  * Interchanges two complex single-precision floating-point vectors.
34
36
  */
35
- void c_cswap( const int N, void *X, const int strideX, void *Y, const int strideY );
37
+ void API_SUFFIX(c_cswap)( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
38
+
39
+ /**
40
+ * Interchanges two complex single-precision floating-point vectors.
41
+ */
42
+ void API_SUFFIX(c_cswap_ndarray)( const CBLAS_INT N, 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 // !CSWAP_H
48
+ #endif // !STDLIB_BLAS_BASE_CSWAP_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_cswap`.
21
21
  */
22
- #ifndef CSWAP_CBLAS_H
23
- #define CSWAP_CBLAS_H
22
+ #ifndef STDLIB_BLAS_BASE_CSWAP_CBLAS_H
23
+ #define STDLIB_BLAS_BASE_CSWAP_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
  * Interchanges two complex single-precision floating-point vectors.
34
36
  */
35
- void cblas_cswap( const int N, void *X, const int strideX, void *Y, const int strideY );
37
+ void API_SUFFIX(cblas_cswap)( const CBLAS_INT N, 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 // !CSWAP_CBLAS_H
43
+ #endif // !STDLIB_BLAS_BASE_CSWAP_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 `cswap`.
21
21
  */
22
- #ifndef CSWAP_FORTRAN_H
23
- #define CSWAP_FORTRAN_H
22
+ #ifndef STDLIB_BLAS_BASE_CSWAP_FORTRAN_H
23
+ #define STDLIB_BLAS_BASE_CSWAP_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
  * Interchanges two complex single-precision floating-point vectors.
34
34
  */
35
- void cswap( const int *, void *, const int *, void *, const int * );
35
+ void cswap( const CBLAS_INT *, void *, const CBLAS_INT *, void *, const CBLAS_INT * );
36
36
 
37
37
  #ifdef __cplusplus
38
38
  }
39
39
  #endif
40
40
 
41
- #endif // !CSWAP_FORTRAN_H
41
+ #endif // !STDLIB_BLAS_BASE_CSWAP_FORTRAN_H