@stdlib/blas-base-cswap 0.2.0 → 0.3.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/README.md CHANGED
@@ -59,8 +59,8 @@ 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' );
62
+ var realf = require( '@stdlib/complex-float32-real' );
63
+ var imagf = require( '@stdlib/complex-float32-imag' );
64
64
 
65
65
  var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
66
66
  var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
@@ -98,8 +98,8 @@ The `N` and stride parameters determine how values from `x` are interchanged wit
98
98
 
99
99
  ```javascript
100
100
  var Complex64Array = require( '@stdlib/array-complex64' );
101
- var realf = require( '@stdlib/complex-realf' );
102
- var imagf = require( '@stdlib/complex-imagf' );
101
+ var realf = require( '@stdlib/complex-float32-real' );
102
+ var imagf = require( '@stdlib/complex-float32-imag' );
103
103
 
104
104
  var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
105
105
  var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
@@ -131,8 +131,8 @@ Note that indexing is relative to the first index. To introduce an offset, use [
131
131
 
132
132
  ```javascript
133
133
  var Complex64Array = require( '@stdlib/array-complex64' );
134
- var realf = require( '@stdlib/complex-realf' );
135
- var imagf = require( '@stdlib/complex-imagf' );
134
+ var realf = require( '@stdlib/complex-float32-real' );
135
+ var imagf = require( '@stdlib/complex-float32-imag' );
136
136
 
137
137
  // Initial arrays...
138
138
  var x0 = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
@@ -170,8 +170,8 @@ Interchanges two complex single-precision floating-point vectors using alternati
170
170
 
171
171
  ```javascript
172
172
  var Complex64Array = require( '@stdlib/array-complex64' );
173
- var realf = require( '@stdlib/complex-realf' );
174
- var imagf = require( '@stdlib/complex-imagf' );
173
+ var realf = require( '@stdlib/complex-float32-real' );
174
+ var imagf = require( '@stdlib/complex-float32-imag' );
175
175
 
176
176
  var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
177
177
  var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
@@ -206,8 +206,8 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the
206
206
 
207
207
  ```javascript
208
208
  var Complex64Array = require( '@stdlib/array-complex64' );
209
- var realf = require( '@stdlib/complex-realf' );
210
- var imagf = require( '@stdlib/complex-imagf' );
209
+ var realf = require( '@stdlib/complex-float32-real' );
210
+ var imagf = require( '@stdlib/complex-float32-imag' );
211
211
 
212
212
  var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
213
213
  var y = new Complex64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
@@ -257,7 +257,7 @@ im = imagf( z );
257
257
  ```javascript
258
258
  var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
259
259
  var filledarrayBy = require( '@stdlib/array-filled-by' );
260
- var Complex64 = require( '@stdlib/complex-float32' );
260
+ var Complex64 = require( '@stdlib/complex-float32-ctor' );
261
261
  var cswap = require( '@stdlib/blas-base-cswap' );
262
262
 
263
263
  function rand() {
@@ -280,6 +280,108 @@ console.log( y.get( y.length-1 ).toString() );
280
280
 
281
281
  <!-- /.examples -->
282
282
 
283
+ <!-- C interface documentation. -->
284
+
285
+ * * *
286
+
287
+ <section class="c">
288
+
289
+ ## C APIs
290
+
291
+ <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
292
+
293
+ <section class="intro">
294
+
295
+ </section>
296
+
297
+ <!-- /.intro -->
298
+
299
+ <!-- C usage documentation. -->
300
+
301
+ <section class="usage">
302
+
303
+ ### Usage
304
+
305
+ ```c
306
+ #include "stdlib/blas/base/cswap.h"
307
+ ```
308
+
309
+ #### c_cswap( N, \*X, strideX, \*Y, strideY )
310
+
311
+ Interchanges two complex single-precision floating-point vectors.
312
+
313
+ ```c
314
+ float x[] = { 1.0f, 2.0f, 3.0f, 4.0f }; // interleaved real and imaginary components
315
+ float y[] = { 5.0f, 6.0f, 7.0f, 8.0f };
316
+
317
+ c_cswap( 2, (void *)x, 1, (void *)Y, 1 );
318
+ ```
319
+
320
+ The function accepts the following arguments:
321
+
322
+ - **N**: `[in] CBLAS_INT` number of indexed elements.
323
+ - **X**: `[inout] void*` first input array.
324
+ - **strideX**: `[in] CBLAS_INT` index increment for `X`.
325
+ - **Y**: `[inout] void*` first input array.
326
+ - **strideY**: `[in] CBLAS_INT` index increment for `Y`.
327
+
328
+ ```c
329
+ void c_cswap( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY );
330
+ ```
331
+
332
+ </section>
333
+
334
+ <!-- /.usage -->
335
+
336
+ <!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
337
+
338
+ <section class="notes">
339
+
340
+ </section>
341
+
342
+ <!-- /.notes -->
343
+
344
+ <!-- C API usage examples. -->
345
+
346
+ <section class="examples">
347
+
348
+ ### Examples
349
+
350
+ ```c
351
+ #include "stdlib/blas/base/cswap.h"
352
+ #include <stdio.h>
353
+
354
+ int main( void ) {
355
+ // Create strided arrays:
356
+ float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
357
+ float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
358
+
359
+ // Specify the number of elements:
360
+ const int N = 4;
361
+
362
+ // Specify stride lengths:
363
+ const int strideX = 1;
364
+ const int strideY = -1;
365
+
366
+ // Copy elements:
367
+ c_cswap( N, (void *)x, strideX, (void *)y, strideY );
368
+
369
+ // Print the result:
370
+ for ( int i = 0; i < N; i++ ) {
371
+ printf( "x[ %i ] = %f + %fj\n", i, x[ i*2 ], x[ (i*2)+1 ] );
372
+ printf( "y[ %i ] = %f + %fj\n", i, y[ i*2 ], y[ (i*2)+1 ] );
373
+ }
374
+ }
375
+ ```
376
+
377
+ </section>
378
+
379
+ <!-- /.examples -->
380
+
381
+ </section>
382
+
383
+ <!-- /.c -->
384
+
283
385
  <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
284
386
 
285
387
  <section class="related">
@@ -333,8 +435,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
333
435
  [npm-image]: http://img.shields.io/npm/v/@stdlib/blas-base-cswap.svg
334
436
  [npm-url]: https://npmjs.org/package/@stdlib/blas-base-cswap
335
437
 
336
- [test-image]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml/badge.svg?branch=v0.2.0
337
- [test-url]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml?query=branch:v0.2.0
438
+ [test-image]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml/badge.svg?branch=v0.3.0
439
+ [test-url]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml?query=branch:v0.3.0
338
440
 
339
441
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-base-cswap/main.svg
340
442
  [coverage-url]: https://codecov.io/github/stdlib-js/blas-base-cswap?branch=main
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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"],
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-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\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-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\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-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\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-float32-real' );\n* var imagf = require( '@stdlib/complex-float32-imag' );\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
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
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"]
7
7
  }
@@ -38,8 +38,8 @@ 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' );
41
+ * var realf = require( '@stdlib/complex-float32-real' );
42
+ * var imagf = require( '@stdlib/complex-float32-imag' );
43
43
  *
44
44
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
45
45
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
@@ -80,8 +80,8 @@ interface Routine {
80
80
  *
81
81
  * @example
82
82
  * var Complex64Array = require( '@stdlib/array-complex64' );
83
- * var realf = require( '@stdlib/complex-realf' );
84
- * var imagf = require( '@stdlib/complex-imagf' );
83
+ * var realf = require( '@stdlib/complex-float32-real' );
84
+ * var imagf = require( '@stdlib/complex-float32-imag' );
85
85
  *
86
86
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
87
87
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
@@ -121,8 +121,8 @@ interface Routine {
121
121
  *
122
122
  * @example
123
123
  * var Complex64Array = require( '@stdlib/array-complex64' );
124
- * var realf = require( '@stdlib/complex-realf' );
125
- * var imagf = require( '@stdlib/complex-imagf' );
124
+ * var realf = require( '@stdlib/complex-float32-real' );
125
+ * var imagf = require( '@stdlib/complex-float32-imag' );
126
126
  *
127
127
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
128
128
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
@@ -149,8 +149,8 @@ interface Routine {
149
149
  *
150
150
  * @example
151
151
  * var Complex64Array = require( '@stdlib/array-complex64' );
152
- * var realf = require( '@stdlib/complex-realf' );
153
- * var imagf = require( '@stdlib/complex-imagf' );
152
+ * var realf = require( '@stdlib/complex-float32-real' );
153
+ * var imagf = require( '@stdlib/complex-float32-imag' );
154
154
  *
155
155
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
156
156
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
@@ -22,6 +22,8 @@
22
22
  #ifndef CSWAP_H
23
23
  #define CSWAP_H
24
24
 
25
+ #include "stdlib/blas/base/shared.h"
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.
27
29
  */
@@ -32,7 +34,7 @@ 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 );
36
38
 
37
39
  #ifdef __cplusplus
38
40
  }
@@ -22,6 +22,8 @@
22
22
  #ifndef CSWAP_CBLAS_H
23
23
  #define CSWAP_CBLAS_H
24
24
 
25
+ #include "stdlib/blas/base/shared.h"
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.
27
29
  */
@@ -32,7 +34,7 @@ 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
  }
@@ -32,7 +32,7 @@ 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
  }
package/lib/cswap.js CHANGED
@@ -37,8 +37,8 @@ var reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' );
37
37
  *
38
38
  * @example
39
39
  * var Complex64Array = require( '@stdlib/array-complex64' );
40
- * var realf = require( '@stdlib/complex-realf' );
41
- * var imagf = require( '@stdlib/complex-imagf' );
40
+ * var realf = require( '@stdlib/complex-float32-real' );
41
+ * var imagf = require( '@stdlib/complex-float32-imag' );
42
42
  *
43
43
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
44
44
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
@@ -38,8 +38,8 @@ var addon = require( './../src/addon.node' );
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' );
41
+ * var realf = require( '@stdlib/complex-float32-real' );
42
+ * var imagf = require( '@stdlib/complex-float32-imag' );
43
43
  *
44
44
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
45
45
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
package/lib/index.js CHANGED
@@ -25,8 +25,8 @@
25
25
  *
26
26
  * @example
27
27
  * var Complex64Array = require( '@stdlib/array-complex64' );
28
- * var realf = require( '@stdlib/complex-realf' );
29
- * var imagf = require( '@stdlib/complex-imagf' );
28
+ * var realf = require( '@stdlib/complex-float32-real' );
29
+ * var imagf = require( '@stdlib/complex-float32-imag' );
30
30
  * var cswap = require( '@stdlib/blas-base-cswap' );
31
31
  *
32
32
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
@@ -54,8 +54,8 @@
54
54
  *
55
55
  * @example
56
56
  * var Complex64Array = require( '@stdlib/array-complex64' );
57
- * var realf = require( '@stdlib/complex-realf' );
58
- * var imagf = require( '@stdlib/complex-imagf' );
57
+ * var realf = require( '@stdlib/complex-float32-real' );
58
+ * var imagf = require( '@stdlib/complex-float32-imag' );
59
59
  * var cswap = require( '@stdlib/blas-base-cswap' );
60
60
  *
61
61
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
package/lib/ndarray.js CHANGED
@@ -39,8 +39,8 @@ var reinterpret = require( '@stdlib/strided-base-reinterpret-complex64' );
39
39
  *
40
40
  * @example
41
41
  * var Complex64Array = require( '@stdlib/array-complex64' );
42
- * var realf = require( '@stdlib/complex-realf' );
43
- * var imagf = require( '@stdlib/complex-imagf' );
42
+ * var realf = require( '@stdlib/complex-float32-real' );
43
+ * var imagf = require( '@stdlib/complex-float32-imag' );
44
44
  *
45
45
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
46
46
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
@@ -41,8 +41,8 @@ var addon = require( './../src/addon.node' );
41
41
  *
42
42
  * @example
43
43
  * var Complex64Array = require( '@stdlib/array-complex64' );
44
- * var realf = require( '@stdlib/complex-realf' );
45
- * var imagf = require( '@stdlib/complex-imagf' );
44
+ * var realf = require( '@stdlib/complex-float32-real' );
45
+ * var imagf = require( '@stdlib/complex-float32-imag' );
46
46
  *
47
47
  * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
48
48
  * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
package/manifest.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "options": {
3
+ "task": "build",
3
4
  "os": "linux",
4
5
  "blas": "",
5
6
  "wasm": false
@@ -28,6 +29,7 @@
28
29
  ],
29
30
  "confs": [
30
31
  {
32
+ "task": "build",
31
33
  "os": "linux",
32
34
  "blas": "",
33
35
  "wasm": false,
@@ -44,10 +46,47 @@
44
46
  "@stdlib/napi-export",
45
47
  "@stdlib/napi-argv",
46
48
  "@stdlib/napi-argv-int64",
47
- "@stdlib/napi-argv-strided-complex64array"
49
+ "@stdlib/napi-argv-strided-complex64array",
50
+ "@stdlib/blas-base-shared"
48
51
  ]
49
52
  },
50
53
  {
54
+ "task": "benchmark",
55
+ "os": "linux",
56
+ "blas": "",
57
+ "wasm": false,
58
+ "src": [
59
+ "./src/cswap.c"
60
+ ],
61
+ "include": [
62
+ "./include"
63
+ ],
64
+ "libraries": [],
65
+ "libpath": [],
66
+ "dependencies": [
67
+ "@stdlib/blas-base-shared"
68
+ ]
69
+ },
70
+ {
71
+ "task": "examples",
72
+ "os": "linux",
73
+ "blas": "",
74
+ "wasm": false,
75
+ "src": [
76
+ "./src/cswap.c"
77
+ ],
78
+ "include": [
79
+ "./include"
80
+ ],
81
+ "libraries": [],
82
+ "libpath": [],
83
+ "dependencies": [
84
+ "@stdlib/blas-base-shared"
85
+ ]
86
+ },
87
+
88
+ {
89
+ "task": "build",
51
90
  "os": "linux",
52
91
  "blas": "openblas",
53
92
  "wasm": false,
@@ -66,10 +105,53 @@
66
105
  "@stdlib/napi-export",
67
106
  "@stdlib/napi-argv",
68
107
  "@stdlib/napi-argv-int64",
69
- "@stdlib/napi-argv-strided-complex64array"
108
+ "@stdlib/napi-argv-strided-complex64array",
109
+ "@stdlib/blas-base-shared"
70
110
  ]
71
111
  },
72
112
  {
113
+ "task": "benchmark",
114
+ "os": "linux",
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/blas-base-shared"
130
+ ]
131
+ },
132
+ {
133
+ "task": "examples",
134
+ "os": "linux",
135
+ "blas": "openblas",
136
+ "wasm": false,
137
+ "src": [
138
+ "./src/cswap_cblas.c"
139
+ ],
140
+ "include": [
141
+ "./include"
142
+ ],
143
+ "libraries": [
144
+ "-lopenblas",
145
+ "-lpthread"
146
+ ],
147
+ "libpath": [],
148
+ "dependencies": [
149
+ "@stdlib/blas-base-shared"
150
+ ]
151
+ },
152
+
153
+ {
154
+ "task": "build",
73
155
  "os": "mac",
74
156
  "blas": "",
75
157
  "wasm": false,
@@ -86,10 +168,47 @@
86
168
  "@stdlib/napi-export",
87
169
  "@stdlib/napi-argv",
88
170
  "@stdlib/napi-argv-int64",
89
- "@stdlib/napi-argv-strided-complex64array"
171
+ "@stdlib/napi-argv-strided-complex64array",
172
+ "@stdlib/blas-base-shared"
90
173
  ]
91
174
  },
92
175
  {
176
+ "task": "benchmark",
177
+ "os": "mac",
178
+ "blas": "",
179
+ "wasm": false,
180
+ "src": [
181
+ "./src/cswap.c"
182
+ ],
183
+ "include": [
184
+ "./include"
185
+ ],
186
+ "libraries": [],
187
+ "libpath": [],
188
+ "dependencies": [
189
+ "@stdlib/blas-base-shared"
190
+ ]
191
+ },
192
+ {
193
+ "task": "examples",
194
+ "os": "mac",
195
+ "blas": "",
196
+ "wasm": false,
197
+ "src": [
198
+ "./src/cswap.c"
199
+ ],
200
+ "include": [
201
+ "./include"
202
+ ],
203
+ "libraries": [],
204
+ "libpath": [],
205
+ "dependencies": [
206
+ "@stdlib/blas-base-shared"
207
+ ]
208
+ },
209
+
210
+ {
211
+ "task": "build",
93
212
  "os": "mac",
94
213
  "blas": "apple_accelerate_framework",
95
214
  "wasm": false,
@@ -107,10 +226,51 @@
107
226
  "@stdlib/napi-export",
108
227
  "@stdlib/napi-argv",
109
228
  "@stdlib/napi-argv-int64",
110
- "@stdlib/napi-argv-strided-complex64array"
229
+ "@stdlib/napi-argv-strided-complex64array",
230
+ "@stdlib/blas-base-shared"
231
+ ]
232
+ },
233
+ {
234
+ "task": "benchmark",
235
+ "os": "mac",
236
+ "blas": "apple_accelerate_framework",
237
+ "wasm": false,
238
+ "src": [
239
+ "./src/cswap_cblas.c"
240
+ ],
241
+ "include": [
242
+ "./include"
243
+ ],
244
+ "libraries": [
245
+ "-lblas"
246
+ ],
247
+ "libpath": [],
248
+ "dependencies": [
249
+ "@stdlib/blas-base-shared"
250
+ ]
251
+ },
252
+ {
253
+ "task": "examples",
254
+ "os": "mac",
255
+ "blas": "apple_accelerate_framework",
256
+ "wasm": false,
257
+ "src": [
258
+ "./src/cswap_cblas.c"
259
+ ],
260
+ "include": [
261
+ "./include"
262
+ ],
263
+ "libraries": [
264
+ "-lblas"
265
+ ],
266
+ "libpath": [],
267
+ "dependencies": [
268
+ "@stdlib/blas-base-shared"
111
269
  ]
112
270
  },
271
+
113
272
  {
273
+ "task": "build",
114
274
  "os": "mac",
115
275
  "blas": "openblas",
116
276
  "wasm": false,
@@ -129,10 +289,53 @@
129
289
  "@stdlib/napi-export",
130
290
  "@stdlib/napi-argv",
131
291
  "@stdlib/napi-argv-int64",
132
- "@stdlib/napi-argv-strided-complex64array"
292
+ "@stdlib/napi-argv-strided-complex64array",
293
+ "@stdlib/blas-base-shared"
133
294
  ]
134
295
  },
135
296
  {
297
+ "task": "benchmark",
298
+ "os": "mac",
299
+ "blas": "openblas",
300
+ "wasm": false,
301
+ "src": [
302
+ "./src/cswap_cblas.c"
303
+ ],
304
+ "include": [
305
+ "./include"
306
+ ],
307
+ "libraries": [
308
+ "-lopenblas",
309
+ "-lpthread"
310
+ ],
311
+ "libpath": [],
312
+ "dependencies": [
313
+ "@stdlib/blas-base-shared"
314
+ ]
315
+ },
316
+ {
317
+ "task": "examples",
318
+ "os": "mac",
319
+ "blas": "openblas",
320
+ "wasm": false,
321
+ "src": [
322
+ "./src/cswap_cblas.c"
323
+ ],
324
+ "include": [
325
+ "./include"
326
+ ],
327
+ "libraries": [
328
+ "-lopenblas",
329
+ "-lpthread"
330
+ ],
331
+ "libpath": [],
332
+ "dependencies": [
333
+ "@stdlib/blas-base-shared"
334
+ ]
335
+ },
336
+
337
+ {
338
+ "task": "build",
136
339
  "os": "win",
137
340
  "blas": "",
138
341
  "wasm": false,
@@ -148,10 +351,47 @@
148
351
  "@stdlib/napi-export",
149
352
  "@stdlib/napi-argv",
150
353
  "@stdlib/napi-argv-int64",
151
- "@stdlib/napi-argv-strided-complex64array"
354
+ "@stdlib/napi-argv-strided-complex64array",
355
+ "@stdlib/blas-base-shared"
152
356
  ]
153
357
  },
154
358
  {
359
+ "task": "benchmark",
360
+ "os": "win",
361
+ "blas": "",
362
+ "wasm": false,
363
+ "src": [
364
+ "./src/cswap.c"
365
+ ],
366
+ "include": [
367
+ "./include"
368
+ ],
369
+ "libraries": [],
370
+ "libpath": [],
371
+ "dependencies": [
372
+ "@stdlib/blas-base-shared"
373
+ ]
374
+ },
375
+ {
376
+ "task": "examples",
377
+ "os": "win",
378
+ "blas": "",
379
+ "wasm": false,
380
+ "src": [
381
+ "./src/cswap.c"
382
+ ],
383
+ "include": [
384
+ "./include"
385
+ ],
386
+ "libraries": [],
387
+ "libpath": [],
388
+ "dependencies": [
389
+ "@stdlib/blas-base-shared"
390
+ ]
391
+ },
392
+
393
+ {
394
+ "task": "build",
155
395
  "os": "",
156
396
  "blas": "",
157
397
  "wasm": true,
@@ -163,7 +403,9 @@
163
403
  ],
164
404
  "libraries": [],
165
405
  "libpath": [],
166
- "dependencies": []
406
+ "dependencies": [
407
+ "@stdlib/blas-base-shared"
408
+ ]
167
409
  }
168
410
  ]
169
411
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/blas-base-cswap",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Interchanges two complex single-precision floating-point vectors.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -17,21 +17,14 @@
17
17
  "browser": "./lib/main.js",
18
18
  "gypfile": false,
19
19
  "directories": {
20
- "benchmark": "./benchmark",
21
20
  "doc": "./docs",
22
- "example": "./examples",
23
21
  "include": "./include",
24
22
  "lib": "./lib",
25
23
  "src": "./src",
26
- "test": "./test"
24
+ "dist": "./dist"
27
25
  },
28
26
  "types": "./docs/types",
29
- "scripts": {
30
- "test": "make test",
31
- "test-cov": "make test-cov",
32
- "examples": "make examples",
33
- "benchmark": "make benchmark"
34
- },
27
+ "scripts": {},
35
28
  "homepage": "https://stdlib.io",
36
29
  "repository": {
37
30
  "type": "git",
@@ -41,36 +34,18 @@
41
34
  "url": "https://github.com/stdlib-js/stdlib/issues"
42
35
  },
43
36
  "dependencies": {
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",
37
+ "@stdlib/assert-is-error": "^0.2.2",
38
+ "@stdlib/blas-base-shared": "^0.1.0",
39
+ "@stdlib/napi-argv": "^0.2.2",
40
+ "@stdlib/napi-argv-int64": "^0.2.2",
41
+ "@stdlib/napi-argv-strided-complex64array": "^0.2.2",
42
+ "@stdlib/napi-export": "^0.2.2",
49
43
  "@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"
54
- },
55
- "devDependencies": {
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",
67
- "proxyquire": "^2.0.0",
68
- "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
69
- "istanbul": "^0.4.1",
70
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
71
- "@stdlib/bench-harness": "^0.1.2",
72
- "@stdlib/bench": "^0.3.1"
44
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
45
+ "@stdlib/utils-library-manifest": "^0.2.2",
46
+ "@stdlib/utils-try-require": "^0.2.2"
73
47
  },
48
+ "devDependencies": {},
74
49
  "engines": {
75
50
  "node": ">=0.10.0",
76
51
  "npm": ">2.7.0"
package/src/addon.c CHANGED
@@ -17,6 +17,7 @@
17
17
  */
18
18
 
19
19
  #include "stdlib/blas/base/cswap.h"
20
+ #include "stdlib/blas/base/shared.h"
20
21
  #include "stdlib/napi/export.h"
21
22
  #include "stdlib/napi/argv.h"
22
23
  #include "stdlib/napi/argv_int64.h"
@@ -26,7 +27,6 @@
26
27
  /**
27
28
  * Receives JavaScript callback invocation data.
28
29
  *
29
- * @private
30
30
  * @param env environment under which the function is invoked
31
31
  * @param info callback data
32
32
  * @return Node-API value
@@ -38,7 +38,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
38
38
  STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 4 );
39
39
  STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, X, N, strideX, argv, 1 );
40
40
  STDLIB_NAPI_ARGV_STRIDED_COMPLEX64ARRAY( env, Y, N, strideY, argv, 3 );
41
- c_cswap( N, (void *)X, strideX, (void *)Y, strideY );
41
+ API_SUFFIX(c_cswap)( N, (void *)X, strideX, (void *)Y, strideY );
42
42
  return NULL;
43
43
  }
44
44
 
package/src/cswap.c CHANGED
@@ -17,6 +17,7 @@
17
17
  */
18
18
 
19
19
  #include "stdlib/blas/base/cswap.h"
20
+ #include "stdlib/blas/base/shared.h"
20
21
 
21
22
  /**
22
23
  * Interchanges two complex single-precision floating-point vectors.
@@ -27,14 +28,14 @@
27
28
  * @param Y second input array
28
29
  * @param strideY Y stride length
29
30
  */
30
- void c_cswap( const int N, void *X, const int strideX, void *Y, const int strideY ) {
31
+ void API_SUFFIX(c_cswap)( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ) {
31
32
  float *x = (float *)X;
32
33
  float *y = (float *)Y;
33
34
  float tmp;
34
- int ix;
35
- int iy;
36
- int i;
37
- int j;
35
+ CBLAS_INT ix;
36
+ CBLAS_INT iy;
37
+ CBLAS_INT i;
38
+ CBLAS_INT j;
38
39
 
39
40
  if ( N <= 0 ) {
40
41
  return;
package/src/cswap.f CHANGED
@@ -96,4 +96,4 @@ subroutine cswap( N, cx, strideX, cy, strideY )
96
96
  end do
97
97
  end if
98
98
  return
99
- end subroutine cswap
99
+ end subroutine cswap
package/src/cswap_cblas.c CHANGED
@@ -18,6 +18,7 @@
18
18
 
19
19
  #include "stdlib/blas/base/cswap.h"
20
20
  #include "stdlib/blas/base/cswap_cblas.h"
21
+ #include "stdlib/blas/base/shared.h"
21
22
 
22
23
  /**
23
24
  * Interchanges two complex single-precision floating-point vectors.
@@ -28,6 +29,6 @@
28
29
  * @param Y second input array
29
30
  * @param strideY Y stride length
30
31
  */
31
- void c_cswap( const int N, void *X, const int strideX, void *Y, const int strideY ) {
32
- cblas_cswap( N, X, strideX, Y, strideY );
32
+ void API_SUFFIX(c_cswap)( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ) {
33
+ API_SUFFIX(cblas_cswap)( N, X, strideX, Y, strideY );
33
34
  }
package/src/cswap_f.c CHANGED
@@ -18,6 +18,7 @@
18
18
 
19
19
  #include "stdlib/blas/base/cswap.h"
20
20
  #include "stdlib/blas/base/cswap_fortran.h"
21
+ #include "stdlib/blas/base/shared.h"
21
22
 
22
23
  /**
23
24
  * Interchanges two complex single-precision floating-point vectors.
@@ -28,6 +29,6 @@
28
29
  * @param Y second input array
29
30
  * @param strideY Y stride length
30
31
  */
31
- void c_cswap( const int N, void *X, const int strideX, void *Y, const int strideY ) {
32
+ void API_SUFFIX(c_cswap)( const CBLAS_INT N, void *X, const CBLAS_INT strideX, void *Y, const CBLAS_INT strideY ) {
32
33
  cswap( &N, X, &strideX, Y, &strideY );
33
34
  }
package/include.gypi DELETED
@@ -1,70 +0,0 @@
1
- # @license Apache-2.0
2
- #
3
- # Copyright (c) 2020 The Stdlib Authors.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # A GYP include file for building a Node.js native add-on.
18
- #
19
- # Note that nesting variables is required due to how GYP processes a configuration. Any variables defined within a nested 'variables' section is defined in the outer scope. Thus, conditions in the outer variable scope are free to use these variables without running into "variable undefined" errors.
20
- #
21
- # Main documentation:
22
- #
23
- # [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
24
- # [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
25
- #
26
- # Variable nesting hacks:
27
- #
28
- # [3]: https://chromium.googlesource.com/external/skia/gyp/+/master/common_variables.gypi
29
- # [4]: https://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?revision=127004
30
- {
31
- # Define variables to be used throughout the configuration for all targets:
32
- 'variables': {
33
- 'variables': {
34
- # Host BLAS library (to override -Dblas=<blas>):
35
- 'blas%': '',
36
-
37
- # Path to BLAS library (to override -Dblas_dir=<path>):
38
- 'blas_dir%': '',
39
- }, # end variables
40
-
41
- # Source directory:
42
- 'src_dir': './src',
43
-
44
- # Include directories:
45
- 'include_dirs': [
46
- '<@(blas_dir)',
47
- '<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{\'os\':\'<(OS)\',\'blas\':\'<(blas)\'},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).include; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
48
- ],
49
-
50
- # Add-on destination directory:
51
- 'addon_output_dir': './src',
52
-
53
- # Source files:
54
- 'src_files': [
55
- '<(src_dir)/addon.c',
56
- '<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{\'os\':\'<(OS)\',\'blas\':\'<(blas)\'},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).src; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
57
- ],
58
-
59
- # Library dependencies:
60
- 'libraries': [
61
- '<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{\'os\':\'<(OS)\',\'blas\':\'<(blas)\'},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).libraries; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
62
- ],
63
-
64
- # Library directories:
65
- 'library_dirs': [
66
- '<@(blas_dir)',
67
- '<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{\'os\':\'<(OS)\',\'blas\':\'<(blas)\'},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).libpath; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
68
- ],
69
- }, # end variables
70
- }