From 9cac6e28e12e4784469e2521901adae360c31452 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Wed, 3 Apr 2024 21:45:41 +0000 Subject: [PATCH] Update artifacts --- blas/base/zswap/coverage.ndjson | 1 + blas/base/zswap/index.html | 206 +++++++++++ blas/base/zswap/index.js.html | 409 ++++++++++++++++++++++ blas/base/zswap/main.js.html | 190 ++++++++++ blas/base/zswap/native.js.html | 190 ++++++++++ blas/base/zswap/ndarray.js.html | 400 +++++++++++++++++++++ blas/base/zswap/ndarray.native.js.html | 346 +++++++++++++++++++ blas/base/zswap/zswap.js.html | 460 +++++++++++++++++++++++++ blas/base/zswap/zswap.native.js.html | 316 +++++++++++++++++ 9 files changed, 2518 insertions(+) create mode 100644 blas/base/zswap/coverage.ndjson create mode 100644 blas/base/zswap/index.html create mode 100644 blas/base/zswap/index.js.html create mode 100644 blas/base/zswap/main.js.html create mode 100644 blas/base/zswap/native.js.html create mode 100644 blas/base/zswap/ndarray.js.html create mode 100644 blas/base/zswap/ndarray.native.js.html create mode 100644 blas/base/zswap/zswap.js.html create mode 100644 blas/base/zswap/zswap.native.js.html diff --git a/blas/base/zswap/coverage.ndjson b/blas/base/zswap/coverage.ndjson new file mode 100644 index 000000000..e80adb66b --- /dev/null +++ b/blas/base/zswap/coverage.ndjson @@ -0,0 +1 @@ +[572,572,100,31,31,100,4,4,100,572,572,100,"7155e52806a52b6918d0de96ea2fe5da2c19bcd0","2024-04-03 14:43:33 -0700"] diff --git a/blas/base/zswap/index.html b/blas/base/zswap/index.html new file mode 100644 index 000000000..e61ca321f --- /dev/null +++ b/blas/base/zswap/index.html @@ -0,0 +1,206 @@ + + + + +
++ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
index.js | +
+
+ |
+ 100% | +108/108 | +100% | +3/3 | +100% | +0/0 | +100% | +108/108 | +
main.js | +
+
+ |
+ 100% | +35/35 | +100% | +1/1 | +100% | +0/0 | +100% | +35/35 | +
native.js | +
+
+ |
+ 100% | +35/35 | +100% | +1/1 | +100% | +0/0 | +100% | +35/35 | +
ndarray.js | +
+
+ |
+ 100% | +105/105 | +100% | +6/6 | +100% | +1/1 | +100% | +105/105 | +
ndarray.native.js | +
+
+ |
+ 100% | +87/87 | +100% | +2/2 | +100% | +1/1 | +100% | +87/87 | +
zswap.js | +
+
+ |
+ 100% | +125/125 | +100% | +16/16 | +100% | +1/1 | +100% | +125/125 | +
zswap.native.js | +
+
+ |
+ 100% | +77/77 | +100% | +2/2 | +100% | +1/1 | +100% | +77/77 | +
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 | 3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +3x +2x +2x +3x +3x +3x +3x +3x +3x +3x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 1 routine to interchange two complex double-precision floating-point vectors. +* +* @module @stdlib/blas/base/zswap +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var real = require( '@stdlib/complex/real' ); +* var imag = require( '@stdlib/complex/imag' ); +* var zswap = require( '@stdlib/blas/base/zswap' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Complex128Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zswap( x.length, x, 1, y, 1 ); +* +* var z = y.get( 0 ); +* // returns <Complex128> +* +* var re = real( z ); +* // returns 1.0 +* +* var im = imag( z ); +* // returns 2.0 +* +* z = x.get( 0 ); +* // returns <Complex128> +* +* re = real( z ); +* // returns 7.0 +* +* im = imag( z ); +* // returns 8.0 +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var real = require( '@stdlib/complex/real' ); +* var imag = require( '@stdlib/complex/imag' ); +* var zswap = require( '@stdlib/blas/base/zswap' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Complex128Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zswap( x.length, x, 1, 0, y, 1, 0 ); +* +* var z = y.get( 0 ); +* // returns <Complex128> +* +* var re = real( z ); +* // returns 1.0 +* +* var im = imag( z ); +* // returns 2.0 +* +* z = x.get( 0 ); +* // returns <Complex128> +* +* re = real( z ); +* // returns 7.0 +* +* im = imag( z ); +* // returns 8.0 +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var zswap; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + zswap = main; +} else { + zswap = tmp; +} + + +// EXPORTS // + +module.exports = zswap; + +// exports: { "ndarray": "zswap.ndarray" } + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 | 1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var zswap = require( './zswap.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( zswap, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = zswap; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 | 1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var zswap = require( './zswap.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( zswap, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = zswap; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +2x +2x +10x +10x +10x +10x +10x +10x +12x +240x +240x +240x +240x +240x +240x +240x +240x +240x +240x +240x +10x +12x +2x +2x +2x +2x +2x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); + + +// MAIN // + +/** +* Interchanges two complex double-precision floating-point vectors. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex128Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Complex128Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @returns {Complex128Array} `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var real = require( '@stdlib/complex/real' ); +* var imag = require( '@stdlib/complex/imag' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Complex128Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zswap( x.length, x, 1, 0, y, 1, 0 ); +* +* var z = y.get( 0 ); +* // returns <Complex128> +* +* var re = real( z ); +* // returns 1.0 +* +* var im = imag( z ); +* // returns 2.0 +* +* z = x.get( 0 ); +* // returns <Complex128> +* +* re = real( z ); +* // returns 7.0 +* +* im = imag( z ); +* // returns 8.0 +*/ +function zswap( N, x, strideX, offsetX, y, strideY, offsetY ) { + var viewX; + var viewY; + var tmp; + var sx; + var sy; + var ix; + var iy; + var i; + + if ( N <= 0 ) { + return y; + } + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + sx = strideX * 2; + sy = strideY * 2; + ix = offsetX * 2; + iy = offsetY * 2; + for ( i = 0; i < N; i++ ) { + tmp = viewX[ ix ]; + viewX[ ix ] = viewY[ iy ]; + viewY[ iy ] = tmp; + + tmp = viewX[ ix+1 ]; + viewX[ ix+1 ] = viewY[ iy+1 ]; + viewY[ iy+1 ] = tmp; + + ix += sx; + iy += sy; + } + return y; +} + + +// EXPORTS // + +module.exports = zswap; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +2x +2x +2x +2x +2x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Interchanges two complex double-precision floating-point vectors. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex128Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Complex128Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @returns {Complex128Array} `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var real = require( '@stdlib/complex/real' ); +* var imag = require( '@stdlib/complex/imag' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Complex128Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zswap( x.length, x, 1, 0, y, 1, 0 ); +* +* var z = y.get( 0 ); +* // returns <Complex128> +* +* var re = real( z ); +* // returns 1.0 +* +* var im = imag( z ); +* // returns 2.0 +* +* z = x.get( 0 ); +* // returns <Complex128> +* +* re = real( z ); +* // returns 7.0 +* +* im = imag( z ); +* // returns 8.0 +*/ +function zswap( N, x, strideX, offsetX, y, strideY, offsetY ) { + var viewX; + var viewY; + + offsetX = minViewBufferIndex( N, strideX, offsetX ); + offsetY = minViewBufferIndex( N, strideY, offsetY ); + + viewX = reinterpret( x, offsetX ); + viewY = reinterpret( y, offsetY ); + + addon( N, viewX, strideX, viewY, strideY ); + return y; +} + + +// EXPORTS // + +module.exports = zswap; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +11x +11x +11x +11x +11x +11x +11x +11x +11x +11x +11x +11x +2x +2x +9x +9x +11x +4x +228x +228x +228x +228x +228x +228x +228x +228x +228x +4x +4x +11x +2x +11x +3x +3x +11x +2x +11x +3x +3x +5x +5x +11x +10x +10x +10x +10x +10x +10x +10x +10x +10x +10x +10x +5x +11x +2x +2x +2x +2x +2x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); + + +// MAIN // + +/** +* Interchanges two complex double-precision floating-point vectors. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex128Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {Complex128Array} y - second input array +* @param {integer} strideY - `y` stride length +* @returns {Complex128Array} `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var real = require( '@stdlib/complex/real' ); +* var imag = require( '@stdlib/complex/imag' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Complex128Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zswap( x.length, x, 1, y, 1 ); +* +* var z = y.get( 0 ); +* // returns <Complex128> +* +* var re = real( z ); +* // returns 1.0 +* +* var im = imag( z ); +* // returns 2.0 +* +* z = x.get( 0 ); +* // returns <Complex128> +* +* re = real( z ); +* // returns 7.0 +* +* im = imag( z ); +* // returns 8.0 +*/ +function zswap( N, x, strideX, y, strideY ) { + var viewX; + var viewY; + var tmp; + var sx; + var sy; + var ix; + var iy; + var i; + var j; + + if ( N <= 0 ) { + return y; + } + viewX = reinterpret( x, 0 ); + viewY = reinterpret( y, 0 ); + if ( strideX === 1 && strideY === 1 ) { + for ( i = 0; i < N*2; i += 2 ) { + tmp = viewX[ i ]; + viewX[ i ] = viewY[ i ]; + viewY[ i ] = tmp; + + j = i + 1; + tmp = viewX[ j ]; + viewX[ j ] = viewY[ j ]; + viewY[ j ] = tmp; + } + return y; + } + if ( strideX < 0 ) { + ix = 2 * ( 1-N ) * strideX; + } else { + ix = 0; + } + if ( strideY < 0 ) { + iy = 2 * ( 1-N ) * strideY; + } else { + iy = 0; + } + sx = strideX * 2; + sy = strideY * 2; + for ( i = 0; i < N; i++ ) { + tmp = viewX[ ix ]; + viewX[ ix ] = viewY[ iy ]; + viewY[ iy ] = tmp; + + tmp = viewX[ ix+1 ]; + viewX[ ix+1 ] = viewY[ iy+1 ]; + viewY[ iy+1 ] = tmp; + + ix += sx; + iy += sy; + } + return y; +} + + +// EXPORTS // + +module.exports = zswap; + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +11x +11x +11x +11x +11x +11x +2x +2x +2x +2x +2x + | /** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Interchanges two complex double-precision floating-point vectors. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex128Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {Complex128Array} y - second input array +* @param {integer} strideY - `y` stride length +* @returns {Complex128Array} `y` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var real = require( '@stdlib/complex/real' ); +* var imag = require( '@stdlib/complex/imag' ); +* +* var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Complex128Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* zswap( x.length, x, 1, y, 1 ); +* +* var z = y.get( 0 ); +* // returns <Complex128> +* +* var re = real( z ); +* // returns 1.0 +* +* var im = imag( z ); +* // returns 2.0 +* +* z = x.get( 0 ); +* // returns <Complex128> +* +* re = real( z ); +* // returns 7.0 +* +* im = imag( z ); +* // returns 8.0 +*/ +function zswap( N, x, strideX, y, strideY ) { + var viewX = reinterpret( x, 0 ); + var viewY = reinterpret( y, 0 ); + addon( N, viewX, strideX, viewY, strideY ); + return y; +} + + +// EXPORTS // + +module.exports = zswap; + |