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 @@ + + + + + + Code coverage report for blas/base/zswap/lib + + + + + + + + + +
+
+

All files blas/base/zswap/lib

+
+ +
+ 100% + Statements + 572/572 +
+ + +
+ 100% + Branches + 31/31 +
+ + +
+ 100% + Functions + 4/4 +
+ + +
+ 100% + Lines + 572/572 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.js +
+
100%108/108100%3/3100%0/0100%108/108
main.js +
+
100%35/35100%1/1100%0/0100%35/35
native.js +
+
100%35/35100%1/1100%0/0100%35/35
ndarray.js +
+
100%105/105100%6/6100%1/1100%105/105
ndarray.native.js +
+
100%87/87100%2/2100%1/1100%87/87
zswap.js +
+
100%125/125100%16/16100%1/1100%125/125
zswap.native.js +
+
100%77/77100%2/2100%1/1100%77/77
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/base/zswap/index.js.html b/blas/base/zswap/index.js.html new file mode 100644 index 000000000..27b3afe16 --- /dev/null +++ b/blas/base/zswap/index.js.html @@ -0,0 +1,409 @@ + + + + + + Code coverage report for blas/base/zswap/lib/index.js + + + + + + + + + +
+
+

All files / blas/base/zswap/lib index.js

+
+ +
+ 100% + Statements + 108/108 +
+ + +
+ 100% + Branches + 3/3 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 108/108 +
+ + +
+

+ 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 +1093x +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" }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/base/zswap/main.js.html b/blas/base/zswap/main.js.html new file mode 100644 index 000000000..8cca8801d --- /dev/null +++ b/blas/base/zswap/main.js.html @@ -0,0 +1,190 @@ + + + + + + Code coverage report for blas/base/zswap/lib/main.js + + + + + + + + + +
+
+

All files / blas/base/zswap/lib main.js

+
+ +
+ 100% + Statements + 35/35 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 35/35 +
+ + +
+

+ 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 +361x +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;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/base/zswap/native.js.html b/blas/base/zswap/native.js.html new file mode 100644 index 000000000..75bd00a71 --- /dev/null +++ b/blas/base/zswap/native.js.html @@ -0,0 +1,190 @@ + + + + + + Code coverage report for blas/base/zswap/lib/native.js + + + + + + + + + +
+
+

All files / blas/base/zswap/lib native.js

+
+ +
+ 100% + Statements + 35/35 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 35/35 +
+ + +
+

+ 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 +361x +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;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/base/zswap/ndarray.js.html b/blas/base/zswap/ndarray.js.html new file mode 100644 index 000000000..a0d0bed00 --- /dev/null +++ b/blas/base/zswap/ndarray.js.html @@ -0,0 +1,400 @@ + + + + + + Code coverage report for blas/base/zswap/lib/ndarray.js + + + + + + + + + +
+
+

All files / blas/base/zswap/lib ndarray.js

+
+ +
+ 100% + Statements + 105/105 +
+ + +
+ 100% + Branches + 6/6 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 105/105 +
+ + +
+

+ 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 +1062x +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;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/base/zswap/ndarray.native.js.html b/blas/base/zswap/ndarray.native.js.html new file mode 100644 index 000000000..3221a97ea --- /dev/null +++ b/blas/base/zswap/ndarray.native.js.html @@ -0,0 +1,346 @@ + + + + + + Code coverage report for blas/base/zswap/lib/ndarray.native.js + + + + + + + + + +
+
+

All files / blas/base/zswap/lib ndarray.native.js

+
+ +
+ 100% + Statements + 87/87 +
+ + +
+ 100% + Branches + 2/2 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 87/87 +
+ + +
+

+ 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 +882x +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;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/base/zswap/zswap.js.html b/blas/base/zswap/zswap.js.html new file mode 100644 index 000000000..d2fbca517 --- /dev/null +++ b/blas/base/zswap/zswap.js.html @@ -0,0 +1,460 @@ + + + + + + Code coverage report for blas/base/zswap/lib/zswap.js + + + + + + + + + +
+
+

All files / blas/base/zswap/lib zswap.js

+
+ +
+ 100% + Statements + 125/125 +
+ + +
+ 100% + Branches + 16/16 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 125/125 +
+ + +
+

+ 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 +1262x +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;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/base/zswap/zswap.native.js.html b/blas/base/zswap/zswap.native.js.html new file mode 100644 index 000000000..327119081 --- /dev/null +++ b/blas/base/zswap/zswap.native.js.html @@ -0,0 +1,316 @@ + + + + + + Code coverage report for blas/base/zswap/lib/zswap.native.js + + + + + + + + + +
+
+

All files / blas/base/zswap/lib zswap.native.js

+
+ +
+ 100% + Statements + 77/77 +
+ + +
+ 100% + Branches + 2/2 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 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 +782x +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;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file