@stdlib/blas-base-cswap 0.0.7 → 0.1.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/CITATION.cff ADDED
@@ -0,0 +1,30 @@
1
+ cff-version: 1.2.0
2
+ title: stdlib
3
+ message: >-
4
+ If you use this software, please cite it using the
5
+ metadata from this file.
6
+
7
+ type: software
8
+
9
+ authors:
10
+ - name: The Stdlib Authors
11
+ url: https://github.com/stdlib-js/stdlib/graphs/contributors
12
+
13
+ repository-code: https://github.com/stdlib-js/stdlib
14
+ url: https://stdlib.io
15
+
16
+ abstract: |
17
+ Standard library for JavaScript and Node.js.
18
+
19
+ keywords:
20
+ - JavaScript
21
+ - Node.js
22
+ - TypeScript
23
+ - standard library
24
+ - scientific computing
25
+ - numerical computing
26
+ - statistical computing
27
+
28
+ license: Apache-2.0 AND BSL-1.0
29
+
30
+ date-released: 2016
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
1
+ Copyright (c) 2016-2023 The Stdlib Authors.
package/README.md CHANGED
@@ -18,6 +18,17 @@ limitations under the License.
18
18
 
19
19
  -->
20
20
 
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
21
32
  # cswap
22
33
 
23
34
  [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -77,7 +88,7 @@ im = imagf( z );
77
88
 
78
89
  The function has the following parameters:
79
90
 
80
- - **N**: number of values to swap.
91
+ - **N**: number of indexed elements.
81
92
  - **x**: input [`Complex64Array`][@stdlib/array/complex64].
82
93
  - **strideX**: index increment for `x`.
83
94
  - **y**: destination [`Complex64Array`][@stdlib/array/complex64].
@@ -283,7 +294,7 @@ console.log( y.get( y.length-1 ).toString() );
283
294
 
284
295
  ## See Also
285
296
 
286
- - <span class="package-name">[`@stdlib/blas/base/ccopy`][@stdlib/blas/base/ccopy]</span><span class="delimiter">: </span><span class="description">copy values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.</span>
297
+ - <span class="package-name">[`@stdlib/blas-base/ccopy`][@stdlib/blas/base/ccopy]</span><span class="delimiter">: </span><span class="description">copy values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.</span>
287
298
 
288
299
  </section>
289
300
 
@@ -315,7 +326,7 @@ See [LICENSE][stdlib-license].
315
326
 
316
327
  ## Copyright
317
328
 
318
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
329
+ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
319
330
 
320
331
  </section>
321
332
 
@@ -328,8 +339,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
328
339
  [npm-image]: http://img.shields.io/npm/v/@stdlib/blas-base-cswap.svg
329
340
  [npm-url]: https://npmjs.org/package/@stdlib/blas-base-cswap
330
341
 
331
- [test-image]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml/badge.svg?branch=v0.0.7
332
- [test-url]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml?query=branch:v0.0.7
342
+ [test-image]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml/badge.svg?branch=v0.1.0
343
+ [test-url]: https://github.com/stdlib-js/blas-base-cswap/actions/workflows/test.yml?query=branch:v0.1.0
333
344
 
334
345
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-base-cswap/main.svg
335
346
  [coverage-url]: https://codecov.io/github/stdlib-js/blas-base-cswap?branch=main
@@ -342,7 +353,7 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
342
353
  -->
343
354
 
344
355
  [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
345
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
356
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
346
357
 
347
358
  [stdlib]: https://github.com/stdlib-js/stdlib
348
359
 
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import cswap from '../docs/types/index';
3
+ export = cswap;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";var q=function(f,a){return function(){return a||f((a={exports:{}}).exports,a),a.exports}};var O=q(function(I,y){
2
+ var m=require('@stdlib/array-float32/dist');function _(f,a,c,o,n){var v,i,e,w,p,u,s,r,t;if(f<=0)return o;if(v=new m(a.buffer,a.byteOffset,a.length*2),i=new m(o.buffer,o.byteOffset,o.length*2),c===1&&n===1){for(r=0;r<f*2;r+=2)e=v[r],v[r]=i[r],i[r]=e,t=r+1,e=v[t],v[t]=i[t],i[t]=e;return o}for(c<0?u=2*(1-f)*c:u=0,n<0?s=2*(1-f)*n:s=0,w=c*2,p=n*2,r=0;r<f;r++)e=v[u],v[u]=i[s],i[s]=e,e=v[u+1],v[u+1]=i[s+1],i[s+1]=e,u+=w,s+=p;return o}y.exports=_
3
+ });var j=q(function(J,h){
4
+ var g=require('@stdlib/array-float32/dist');function E(f,a,c,o,n,v,i){var e,w,p,u,s,r,t,l;if(f<=0)return n;for(e=new g(a.buffer,a.byteOffset,a.length*2),w=new g(n.buffer,n.byteOffset,n.length*2),u=c*2,s=v*2,r=o*2,t=i*2,l=0;l<f;l++)p=e[r],e[r]=w[t],w[t]=p,p=e[r+1],e[r+1]=w[t+1],w[t+1]=p,r+=u,t+=s;return n}h.exports=E
5
+ });var F=q(function(K,A){
6
+ var k=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),x=O(),z=j();k(x,"ndarray",z);A.exports=x
7
+ });var B=require("path").join,C=require('@stdlib/utils-try-require/dist'),D=require('@stdlib/assert-is-error/dist'),G=F(),b,R=C(B(__dirname,"./native.js"));D(R)?b=G:b=R;module.exports=b;
8
+ /** @license Apache-2.0 */
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
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 Float32Array = require( '@stdlib/array-float32' );\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 = new Float32Array( x.buffer, x.byteOffset, x.length*2 );\n\tviewY = new Float32Array( y.buffer, y.byteOffset, y.length*2 );\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 Float32Array = require( '@stdlib/array-float32' );\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 = new Float32Array( x.buffer, x.byteOffset, x.length*2 );\n\tviewY = new Float32Array( y.buffer, y.byteOffset, y.length*2 );\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": "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",
6
+ "names": ["require_cswap", "__commonJSMin", "exports", "module", "Float32Array", "cswap", "N", "x", "strideX", "y", "strideY", "viewX", "viewY", "tmp", "sx", "sy", "ix", "iy", "i", "j", "require_ndarray", "__commonJSMin", "exports", "module", "Float32Array", "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
+ }
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /// <reference types="@stdlib/types"/>
22
22
 
@@ -29,7 +29,7 @@ interface Routine {
29
29
  /**
30
30
  * Interchanges two complex single-precision floating-point vectors.
31
31
  *
32
- * @param N - number of values to copy
32
+ * @param N - number of indexed elements
33
33
  * @param x - first input array
34
34
  * @param strideX - `x` stride length
35
35
  * @param y - second input array
@@ -69,7 +69,7 @@ interface Routine {
69
69
  /**
70
70
  * Interchanges two complex single-precision floating-point vectors using alternative indexing semantics.
71
71
  *
72
- * @param N - number of values to copy
72
+ * @param N - number of indexed elements
73
73
  * @param x - first input array
74
74
  * @param strideX - `x` stride length
75
75
  * @param offsetX - starting index for `x`
@@ -112,7 +112,7 @@ interface Routine {
112
112
  /**
113
113
  * Interchanges two complex single-precision floating-point vectors.
114
114
  *
115
- * @param N - number of values to copy
115
+ * @param N - number of indexed elements
116
116
  * @param x - first input array
117
117
  * @param strideX - `x` stride length
118
118
  * @param y - second input array
package/lib/cswap.js CHANGED
@@ -28,7 +28,7 @@ var Float32Array = require( '@stdlib/array-float32' );
28
28
  /**
29
29
  * Interchanges two complex single-precision floating-point vectors.
30
30
  *
31
- * @param {PositiveInteger} N - number of values to swap
31
+ * @param {PositiveInteger} N - number of indexed elements
32
32
  * @param {Complex64Array} x - first input array
33
33
  * @param {integer} strideX - `x` stride length
34
34
  * @param {Complex64Array} y - second input array
@@ -29,7 +29,7 @@ var addon = require( './../src/addon.node' );
29
29
  /**
30
30
  * Interchanges two complex single-precision floating-point vectors.
31
31
  *
32
- * @param {PositiveInteger} N - number of values to swap
32
+ * @param {PositiveInteger} N - number of indexed elements
33
33
  * @param {Complex64Array} x - first input array
34
34
  * @param {integer} strideX - `x` stride length
35
35
  * @param {Complex64Array} y - second input array
package/lib/index.js CHANGED
@@ -104,3 +104,5 @@ if ( isError( tmp ) ) {
104
104
  // EXPORTS //
105
105
 
106
106
  module.exports = cswap;
107
+
108
+ // exports: { "ndarray": "cswap.ndarray" }
package/lib/ndarray.js CHANGED
@@ -28,7 +28,7 @@ var Float32Array = require( '@stdlib/array-float32' );
28
28
  /**
29
29
  * Interchanges two complex single-precision floating-point vectors.
30
30
  *
31
- * @param {PositiveInteger} N - number of values to swap
31
+ * @param {PositiveInteger} N - number of indexed elements
32
32
  * @param {Complex64Array} x - first input array
33
33
  * @param {integer} strideX - `x` stride length
34
34
  * @param {NonNegativeInteger} offsetX - starting `x` index
@@ -29,7 +29,7 @@ var addon = require( './../src/addon.node' );
29
29
  /**
30
30
  * Interchanges two complex single-precision floating-point vectors.
31
31
  *
32
- * @param {PositiveInteger} N - number of values to swap
32
+ * @param {PositiveInteger} N - number of indexed elements
33
33
  * @param {Complex64Array} x - first input array
34
34
  * @param {integer} strideX - `x` stride length
35
35
  * @param {NonNegativeInteger} offsetX - starting `x` index
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/blas-base-cswap",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "description": "Interchanges two complex single-precision floating-point vectors.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -41,27 +41,27 @@
41
41
  "url": "https://github.com/stdlib-js/stdlib/issues"
42
42
  },
43
43
  "dependencies": {
44
- "@stdlib/array-float32": "^0.0.x",
45
- "@stdlib/assert-is-error": "^0.0.x",
46
- "@stdlib/types": "^0.0.x",
47
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x",
48
- "@stdlib/utils-library-manifest": "^0.0.x",
49
- "@stdlib/utils-try-require": "^0.0.x"
44
+ "@stdlib/array-float32": "^0.1.0",
45
+ "@stdlib/assert-is-error": "^0.1.0",
46
+ "@stdlib/types": "^0.1.0",
47
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0",
48
+ "@stdlib/utils-library-manifest": "^0.1.0",
49
+ "@stdlib/utils-try-require": "^0.1.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@stdlib/array-complex64": "^0.0.x",
53
- "@stdlib/assert-is-browser": "^0.0.x",
54
- "@stdlib/bench": "^0.0.x",
55
- "@stdlib/blas-base-scopy": "^0.0.x",
56
- "@stdlib/math-base-assert-is-nan": "^0.0.x",
57
- "@stdlib/math-base-special-floor": "^0.0.x",
58
- "@stdlib/math-base-special-pow": "^0.0.x",
59
- "@stdlib/random-base-discrete-uniform": "^0.0.x",
60
- "@stdlib/random-base-randu": "^0.0.x",
52
+ "@stdlib/array-complex64": "^0.0.6",
53
+ "@stdlib/assert-is-browser": "^0.1.0",
54
+ "@stdlib/bench": "^0.1.0",
55
+ "@stdlib/blas-base-scopy": "^0.1.0",
56
+ "@stdlib/math-base-assert-is-nan": "^0.1.0",
57
+ "@stdlib/math-base-special-floor": "^0.1.0",
58
+ "@stdlib/math-base-special-pow": "^0.1.0",
59
+ "@stdlib/random-base-discrete-uniform": "^0.0.6",
60
+ "@stdlib/random-base-randu": "^0.0.8",
61
61
  "proxyquire": "^2.0.0",
62
62
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
63
63
  "istanbul": "^0.4.1",
64
- "tap-spec": "5.x.x"
64
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
65
65
  },
66
66
  "engines": {
67
67
  "node": ">=0.10.0",
@@ -104,7 +104,7 @@
104
104
  "float32array"
105
105
  ],
106
106
  "funding": {
107
- "type": "patreon",
108
- "url": "https://www.patreon.com/athan"
107
+ "type": "opencollective",
108
+ "url": "https://opencollective.com/stdlib"
109
109
  }
110
110
  }
package/src/cswap.c CHANGED
@@ -21,7 +21,7 @@
21
21
  /**
22
22
  * Interchanges two complex single-precision floating-point vectors.
23
23
  *
24
- * @param N number of elements to swap
24
+ * @param N number of indexed elements
25
25
  * @param X first input array
26
26
  * @param strideX X stride length
27
27
  * @param Y second input array
package/src/cswap.f CHANGED
@@ -47,7 +47,7 @@
47
47
  ! >
48
48
  ! > * We will gladly answer any questions regarding the software. If a modification is done, however, it is the responsibility of the person who modified the routine to provide support.
49
49
  !
50
- ! @param {integer} N - number of values to swap
50
+ ! @param {integer} N - number of indexed elements
51
51
  ! @param {Array<complex>} cx - first input array
52
52
  ! @param {integer} strideX - `cx` stride length
53
53
  ! @param {Array<complex>} cy - second input array
package/src/cswap_cblas.c CHANGED
@@ -22,7 +22,7 @@
22
22
  /**
23
23
  * Interchanges two complex single-precision floating-point vectors.
24
24
  *
25
- * @param N number of elements to swap
25
+ * @param N number of indexed elements
26
26
  * @param X first input array
27
27
  * @param strideX X stride length
28
28
  * @param Y second input array
package/src/cswap_f.c CHANGED
@@ -22,7 +22,7 @@
22
22
  /**
23
23
  * Interchanges two complex single-precision floating-point vectors.
24
24
  *
25
- * @param N number of elements to swap
25
+ * @param N number of indexed elements
26
26
  * @param X first input array
27
27
  * @param strideX X stride length
28
28
  * @param Y second input array
package/docs/repl.txt DELETED
@@ -1,158 +0,0 @@
1
-
2
- {{alias}}( N, x, strideX, y, strideY )
3
- Interchanges two complex single-precision floating-point vectors.
4
-
5
- The `N` and `stride` parameters determine how values from `x` are swapped
6
- with values from `y`.
7
-
8
- Indexing is relative to the first index. To introduce an offset, use typed
9
- array views.
10
-
11
- If `N` is less than or equal to `0`, the vectors are unchanged.
12
-
13
- Parameters
14
- ----------
15
- N: integer
16
- Number of values to swap.
17
-
18
- x: Complex64Array
19
- First input array.
20
-
21
- strideX: integer
22
- Index increment for `x`.
23
-
24
- y: Complex64Array
25
- Second input array.
26
-
27
- strideY: integer
28
- Index increment for `y`.
29
-
30
- Returns
31
- -------
32
- y: Complex64Array
33
- Input array `y`.
34
-
35
- Examples
36
- --------
37
- // Standard usage:
38
- > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] );
39
- > var y = new {{alias:@stdlib/array/complex64}}( [ 6.0, 7.0, 8.0, 9.0 ] );
40
- > {{alias}}( x.length, x, 1, y, 1 );
41
- > var z = y.get( 0 );
42
- > var re = {{alias:@stdlib/complex/realf}}( z )
43
- 1.0
44
- > var im = {{alias:@stdlib/complex/imagf}}( z )
45
- 2.0
46
- > z = x.get( 0 );
47
- > re = {{alias:@stdlib/complex/realf}}( z )
48
- 6.0
49
- > im = {{alias:@stdlib/complex/imagf}}( z )
50
- 7.0
51
-
52
- // Advanced indexing:
53
- > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
54
- > y = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
55
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
56
- > {{alias}}( N, x, -2, y, 1 );
57
- > z = y.get( 0 );
58
- > re = {{alias:@stdlib/complex/realf}}( z )
59
- 5.0
60
- > im = {{alias:@stdlib/complex/imagf}}( z )
61
- 6.0
62
- > z = x.get( 0 );
63
- > re = {{alias:@stdlib/complex/realf}}( z )
64
- 0.0
65
- > im = {{alias:@stdlib/complex/imagf}}( z )
66
- 0.0
67
-
68
- // Using typed array views:
69
- > var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
70
- > var y0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
71
- > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
72
- > var y1 = new {{alias:@stdlib/array/complex64}}( y0.buffer, y0.BYTES_PER_ELEMENT*2 );
73
- > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
74
- > {{alias}}( N, x1, -2, y1, 1 );
75
- > z = y0.get( 2 );
76
- > re = {{alias:@stdlib/complex/realf}}( z )
77
- 7.0
78
- > im = {{alias:@stdlib/complex/imagf}}( z )
79
- 8.0
80
- > z = x0.get( 1 );
81
- > re = {{alias:@stdlib/complex/realf}}( z )
82
- 0.0
83
- > im = {{alias:@stdlib/complex/imagf}}( z )
84
- 0.0
85
-
86
-
87
- {{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
88
- Interchanges two complex single-precision floating-point vectors using
89
- alternative indexing semantics.
90
-
91
- While typed array views mandate a view offset based on the underlying
92
- buffer, the `offset` parameters support indexing semantics based on starting
93
- indices.
94
-
95
- Parameters
96
- ----------
97
- N: integer
98
- Number of values to swap.
99
-
100
- x: Complex64Array
101
- First input array.
102
-
103
- strideX: integer
104
- Index increment for `x`.
105
-
106
- offsetX: integer
107
- Starting index for `x`.
108
-
109
- y: Complex64Array
110
- Second input array.
111
-
112
- strideY: integer
113
- Index increment for `y`.
114
-
115
- offsetY: integer
116
- Starting index for `y`.
117
-
118
- Returns
119
- -------
120
- y: Complex64Array
121
- Input array `y`.
122
-
123
- Examples
124
- --------
125
- // Standard usage:
126
- > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] );
127
- > var y = new {{alias:@stdlib/array/complex64}}( [ 6.0, 7.0, 8.0, 9.0 ] );
128
- > {{alias}}.ndarray( x.length, x, 1, 0, y, 1, 0 );
129
- > var z = y.get( 0 );
130
- > var re = {{alias:@stdlib/complex/realf}}( z )
131
- 1.0
132
- > var im = {{alias:@stdlib/complex/imagf}}( z )
133
- 2.0
134
- > z = x.get( 0 );
135
- > re = {{alias:@stdlib/complex/realf}}( z )
136
- 6.0
137
- > im = {{alias:@stdlib/complex/imagf}}( z )
138
- 7.0
139
-
140
- // Advanced indexing:
141
- > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
142
- > y = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
143
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
144
- > {{alias}}.ndarray( N, x, 2, 1, y, -1, y.length-1 );
145
- > z = y.get( y.length-1 );
146
- > re = {{alias:@stdlib/complex/realf}}( z )
147
- 3.0
148
- > im = {{alias:@stdlib/complex/imagf}}( z )
149
- 4.0
150
- > z = x.get( 1 );
151
- > re = {{alias:@stdlib/complex/realf}}( z )
152
- 0.0
153
- > im = {{alias:@stdlib/complex/imagf}}( z )
154
- 0.0
155
-
156
- See Also
157
- --------
158
-
@@ -1,249 +0,0 @@
1
- /*
2
- * @license Apache-2.0
3
- *
4
- * Copyright (c) 2020 The Stdlib Authors.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import Complex64Array = require( '@stdlib/array-complex64' );
20
- import cswap = require( './index' );
21
-
22
-
23
- // TESTS //
24
-
25
- // The function returns a Complex64Array...
26
- {
27
- const x = new Complex64Array( 10 );
28
- const y = new Complex64Array( 10 );
29
-
30
- cswap( x.length, x, 1, y, 1 ); // $ExpectType Complex64Array
31
- }
32
-
33
- // The compiler throws an error if the function is provided a first argument which is not a number...
34
- {
35
- const x = new Complex64Array( 10 );
36
- const y = new Complex64Array( 10 );
37
-
38
- cswap( '10', x, 1, y, 1 ); // $ExpectError
39
- cswap( true, x, 1, y, 1 ); // $ExpectError
40
- cswap( false, x, 1, y, 1 ); // $ExpectError
41
- cswap( null, x, 1, y, 1 ); // $ExpectError
42
- cswap( undefined, x, 1, y, 1 ); // $ExpectError
43
- cswap( [], x, 1, y, 1 ); // $ExpectError
44
- cswap( {}, x, 1, y, 1 ); // $ExpectError
45
- cswap( ( x: number ): number => x, x, 1, y, 1 ); // $ExpectError
46
- }
47
-
48
- // The compiler throws an error if the function is provided a second argument which is not a Complex64Array...
49
- {
50
- const x = new Complex64Array( 10 );
51
- const y = new Complex64Array( 10 );
52
-
53
- cswap( x.length, 10, 1, y, 1 ); // $ExpectError
54
- cswap( x.length, '10', 1, y, 1 ); // $ExpectError
55
- cswap( x.length, true, 1, y, 1 ); // $ExpectError
56
- cswap( x.length, false, 1, y, 1 ); // $ExpectError
57
- cswap( x.length, null, 1, y, 1 ); // $ExpectError
58
- cswap( x.length, undefined, 1, y, 1 ); // $ExpectError
59
- cswap( x.length, [ '1' ], 1, y, 1 ); // $ExpectError
60
- cswap( x.length, {}, 1, y, 1 ); // $ExpectError
61
- cswap( x.length, ( x: number ): number => x, 1, y, 1 ); // $ExpectError
62
- }
63
-
64
- // The compiler throws an error if the function is provided a third argument which is not a number...
65
- {
66
- const x = new Complex64Array( 10 );
67
- const y = new Complex64Array( 10 );
68
-
69
- cswap( x.length, x, '10', y, 1 ); // $ExpectError
70
- cswap( x.length, x, true, y, 1 ); // $ExpectError
71
- cswap( x.length, x, false, y, 1 ); // $ExpectError
72
- cswap( x.length, x, null, y, 1 ); // $ExpectError
73
- cswap( x.length, x, undefined, y, 1 ); // $ExpectError
74
- cswap( x.length, x, [], y, 1 ); // $ExpectError
75
- cswap( x.length, x, {}, y, 1 ); // $ExpectError
76
- cswap( x.length, x, ( x: number ): number => x, y, 1 ); // $ExpectError
77
- }
78
-
79
- // The compiler throws an error if the function is provided a fourth argument which is not a Complex64Array...
80
- {
81
- const x = new Complex64Array( 10 );
82
-
83
- cswap( x.length, x, 1, 10, 1 ); // $ExpectError
84
- cswap( x.length, x, 1, '10', 1 ); // $ExpectError
85
- cswap( x.length, x, 1, true, 1 ); // $ExpectError
86
- cswap( x.length, x, 1, false, 1 ); // $ExpectError
87
- cswap( x.length, x, 1, null, 1 ); // $ExpectError
88
- cswap( x.length, x, 1, undefined, 1 ); // $ExpectError
89
- cswap( x.length, x, 1, [ '1' ], 1 ); // $ExpectError
90
- cswap( x.length, x, 1, {}, 1 ); // $ExpectError
91
- cswap( x.length, x, 1, ( x: number ): number => x, 1 ); // $ExpectError
92
- }
93
-
94
- // The compiler throws an error if the function is provided a fifth argument which is not a number...
95
- {
96
- const x = new Complex64Array( 10 );
97
- const y = new Complex64Array( 10 );
98
-
99
- cswap( x.length, x, 1, y, '10' ); // $ExpectError
100
- cswap( x.length, x, 1, y, true ); // $ExpectError
101
- cswap( x.length, x, 1, y, false ); // $ExpectError
102
- cswap( x.length, x, 1, y, null ); // $ExpectError
103
- cswap( x.length, x, 1, y, undefined ); // $ExpectError
104
- cswap( x.length, x, 1, y, [] ); // $ExpectError
105
- cswap( x.length, x, 1, y, {} ); // $ExpectError
106
- cswap( x.length, x, 1, y, ( x: number ): number => x ); // $ExpectError
107
- }
108
-
109
- // The compiler throws an error if the function is provided an unsupported number of arguments...
110
- {
111
- const x = new Complex64Array( 10 );
112
- const y = new Complex64Array( 10 );
113
-
114
- cswap(); // $ExpectError
115
- cswap( x.length ); // $ExpectError
116
- cswap( x.length, x ); // $ExpectError
117
- cswap( x.length, x, 1 ); // $ExpectError
118
- cswap( x.length, x, 1, y ); // $ExpectError
119
- cswap( x.length, x, 1, y, 1, 10 ); // $ExpectError
120
- }
121
-
122
- // Attached to main export is an `ndarray` method which returns a Complex64Array...
123
- {
124
- const x = new Complex64Array( 10 );
125
- const y = new Complex64Array( 10 );
126
-
127
- cswap.ndarray( x.length, x, 1, 0, y, 1, 0 ); // $ExpectType Complex64Array
128
- }
129
-
130
- // The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
131
- {
132
- const x = new Complex64Array( 10 );
133
- const y = new Complex64Array( 10 );
134
-
135
- cswap.ndarray( '10', x, 1, 0, y, 1, 0 ); // $ExpectError
136
- cswap.ndarray( true, x, 1, 0, y, 1, 0 ); // $ExpectError
137
- cswap.ndarray( false, x, 1, 0, y, 1, 0 ); // $ExpectError
138
- cswap.ndarray( null, x, 1, 0, y, 1, 0 ); // $ExpectError
139
- cswap.ndarray( undefined, x, 1, 0, y, 1, 0 ); // $ExpectError
140
- cswap.ndarray( [], x, 1, 0, y, 1, 0 ); // $ExpectError
141
- cswap.ndarray( {}, x, 1, 0, y, 1, 0 ); // $ExpectError
142
- cswap.ndarray( ( x: number ): number => x, x, 1, 0, y, 1, 0 ); // $ExpectError
143
- }
144
-
145
- // The compiler throws an error if the `ndarray` method is provided a second argument which is not a Complex64Array...
146
- {
147
- const x = new Complex64Array( 10 );
148
- const y = new Complex64Array( 10 );
149
-
150
- cswap.ndarray( x.length, 10, 1, 0, y, 1, 0 ); // $ExpectError
151
- cswap.ndarray( x.length, '10', 1, 0, y, 1, 0 ); // $ExpectError
152
- cswap.ndarray( x.length, true, 1, 0, y, 1, 0 ); // $ExpectError
153
- cswap.ndarray( x.length, false, 1, 0, y, 1, 0 ); // $ExpectError
154
- cswap.ndarray( x.length, null, 1, 0, y, 1, 0 ); // $ExpectError
155
- cswap.ndarray( x.length, undefined, 1, 0, y, 1, 0 ); // $ExpectError
156
- cswap.ndarray( x.length, [ '1' ], 1, 0, y, 1, 0 ); // $ExpectError
157
- cswap.ndarray( x.length, {}, 1, 0, y, 1, 0 ); // $ExpectError
158
- cswap.ndarray( x.length, ( x: number ): number => x, 1, 0, y, 1, 0 ); // $ExpectError
159
- }
160
-
161
- // The compiler throws an error if the `ndarray` method is provided a third argument which is not a number...
162
- {
163
- const x = new Complex64Array( 10 );
164
- const y = new Complex64Array( 10 );
165
-
166
- cswap.ndarray( x.length, x, '10', 0, y, 1, 0 ); // $ExpectError
167
- cswap.ndarray( x.length, x, true, 0, y, 1, 0 ); // $ExpectError
168
- cswap.ndarray( x.length, x, false, 0, y, 1, 0 ); // $ExpectError
169
- cswap.ndarray( x.length, x, null, 0, y, 1, 0 ); // $ExpectError
170
- cswap.ndarray( x.length, x, undefined, 0, y, 1, 0 ); // $ExpectError
171
- cswap.ndarray( x.length, x, [], 0, y, 1, 0 ); // $ExpectError
172
- cswap.ndarray( x.length, x, {}, 0, y, 1, 0 ); // $ExpectError
173
- cswap.ndarray( x.length, x, ( x: number ): number => x, 0, y, 1, 0 ); // $ExpectError
174
- }
175
-
176
- // The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
177
- {
178
- const x = new Complex64Array( 10 );
179
- const y = new Complex64Array( 10 );
180
-
181
- cswap.ndarray( x.length, x, 1, '10', y, 1, 0 ); // $ExpectError
182
- cswap.ndarray( x.length, x, 1, true, y, 1, 0 ); // $ExpectError
183
- cswap.ndarray( x.length, x, 1, false, y, 1, 0 ); // $ExpectError
184
- cswap.ndarray( x.length, x, 1, null, y, 1, 0 ); // $ExpectError
185
- cswap.ndarray( x.length, x, 1, undefined, y, 1, 0 ); // $ExpectError
186
- cswap.ndarray( x.length, x, 1, [], y, 1, 0 ); // $ExpectError
187
- cswap.ndarray( x.length, x, 1, {}, y, 1, 0 ); // $ExpectError
188
- cswap.ndarray( x.length, x, 1, ( x: number ): number => x, y, 1, 0 ); // $ExpectError
189
- }
190
-
191
- // The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a Complex64Array...
192
- {
193
- const x = new Complex64Array( 10 );
194
-
195
- cswap.ndarray( x.length, x, 1, 0, 10, 1, 0 ); // $ExpectError
196
- cswap.ndarray( x.length, x, 1, 0, '10', 1, 0 ); // $ExpectError
197
- cswap.ndarray( x.length, x, 1, 0, true, 1, 0 ); // $ExpectError
198
- cswap.ndarray( x.length, x, 1, 0, false, 1, 0 ); // $ExpectError
199
- cswap.ndarray( x.length, x, 1, 0, null, 1, 0 ); // $ExpectError
200
- cswap.ndarray( x.length, x, 1, 0, undefined, 1, 0 ); // $ExpectError
201
- cswap.ndarray( x.length, x, 1, 0, [ '1' ], 1, 0 ); // $ExpectError
202
- cswap.ndarray( x.length, x, 1, 0, {}, 1, 0 ); // $ExpectError
203
- cswap.ndarray( x.length, x, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError
204
- }
205
-
206
- // The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number...
207
- {
208
- const x = new Complex64Array( 10 );
209
- const y = new Complex64Array( 10 );
210
-
211
- cswap.ndarray( x.length, x, 1, 0, y, '10', 0 ); // $ExpectError
212
- cswap.ndarray( x.length, x, 1, 0, y, true, 0 ); // $ExpectError
213
- cswap.ndarray( x.length, x, 1, 0, y, false, 0 ); // $ExpectError
214
- cswap.ndarray( x.length, x, 1, 0, y, null, 0 ); // $ExpectError
215
- cswap.ndarray( x.length, x, 1, 0, y, undefined, 0 ); // $ExpectError
216
- cswap.ndarray( x.length, x, 1, 0, y, [], 0 ); // $ExpectError
217
- cswap.ndarray( x.length, x, 1, 0, y, {}, 0 ); // $ExpectError
218
- cswap.ndarray( x.length, x, 1, 0, y, ( x: number ): number => x, 0 ); // $ExpectError
219
- }
220
-
221
- // The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number...
222
- {
223
- const x = new Complex64Array( 10 );
224
- const y = new Complex64Array( 10 );
225
-
226
- cswap.ndarray( x.length, x, 1, 0, y, 1, '10' ); // $ExpectError
227
- cswap.ndarray( x.length, x, 1, 0, y, 1, true ); // $ExpectError
228
- cswap.ndarray( x.length, x, 1, 0, y, 1, false ); // $ExpectError
229
- cswap.ndarray( x.length, x, 1, 0, y, 1, null ); // $ExpectError
230
- cswap.ndarray( x.length, x, 1, 0, y, 1, undefined ); // $ExpectError
231
- cswap.ndarray( x.length, x, 1, 0, y, 1, [] ); // $ExpectError
232
- cswap.ndarray( x.length, x, 1, 0, y, 1, {} ); // $ExpectError
233
- cswap.ndarray( x.length, x, 1, 0, y, 1, ( x: number ): number => x ); // $ExpectError
234
- }
235
-
236
- // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
237
- {
238
- const x = new Complex64Array( 10 );
239
- const y = new Complex64Array( 10 );
240
-
241
- cswap.ndarray(); // $ExpectError
242
- cswap.ndarray( x.length ); // $ExpectError
243
- cswap.ndarray( x.length, x ); // $ExpectError
244
- cswap.ndarray( x.length, x, 1 ); // $ExpectError
245
- cswap.ndarray( x.length, x, 1, 0 ); // $ExpectError
246
- cswap.ndarray( x.length, x, 1, 0, y ); // $ExpectError
247
- cswap.ndarray( x.length, x, 1, 0, y, 1 ); // $ExpectError
248
- cswap.ndarray( x.length, x, 1, 0, y, 1, 0, 10 ); // $ExpectError
249
- }