From 2fdb08b9b943842258c77b9d0ce22d27f52c111b Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sat, 20 Apr 2024 01:14:31 +0000 Subject: [PATCH] Update artifacts --- blas/base/srot/coverage.ndjson | 1 + blas/base/srot/index.html | 206 +++++++++++++++ blas/base/srot/index.js.html | 301 ++++++++++++++++++++++ blas/base/srot/main.js.html | 190 ++++++++++++++ blas/base/srot/native.js.html | 190 ++++++++++++++ blas/base/srot/ndarray.js.html | 301 ++++++++++++++++++++++ blas/base/srot/ndarray.native.js.html | 298 ++++++++++++++++++++++ blas/base/srot/srot.js.html | 346 ++++++++++++++++++++++++++ blas/base/srot/srot.native.js.html | 259 +++++++++++++++++++ 9 files changed, 2092 insertions(+) create mode 100644 blas/base/srot/coverage.ndjson create mode 100644 blas/base/srot/index.html create mode 100644 blas/base/srot/index.js.html create mode 100644 blas/base/srot/main.js.html create mode 100644 blas/base/srot/native.js.html create mode 100644 blas/base/srot/ndarray.js.html create mode 100644 blas/base/srot/ndarray.native.js.html create mode 100644 blas/base/srot/srot.js.html create mode 100644 blas/base/srot/srot.native.js.html diff --git a/blas/base/srot/coverage.ndjson b/blas/base/srot/coverage.ndjson new file mode 100644 index 000000000..a82bf1cea --- /dev/null +++ b/blas/base/srot/coverage.ndjson @@ -0,0 +1 @@ +[430,430,100,31,31,100,4,4,100,430,430,100,"d1cbb0973d127cf391ecce4efefd1390d6aab0e1","2024-04-19 18:12:16 -0700"] diff --git a/blas/base/srot/index.html b/blas/base/srot/index.html new file mode 100644 index 000000000..55132ff73 --- /dev/null +++ b/blas/base/srot/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% | +72/72 | +100% | +3/3 | +100% | +0/0 | +100% | +72/72 | +
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% | +72/72 | +100% | +6/6 | +100% | +1/1 | +100% | +72/72 | +
ndarray.native.js | +
+
+ |
+ 100% | +71/71 | +100% | +2/2 | +100% | +1/1 | +100% | +71/71 | +
srot.js | +
+
+ |
+ 100% | +87/87 | +100% | +16/16 | +100% | +1/1 | +100% | +87/87 | +
srot.native.js | +
+
+ |
+ 100% | +58/58 | +100% | +2/2 | +100% | +1/1 | +100% | +58/58 | +
+ 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 | 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 apply a plane rotation. +* +* @module @stdlib/blas/base/srot +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var srot = require( '@stdlib/blas/base/srot' ); +* +* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +* +* srot( x.length, x, 1, y, 1, 0.8, 0.6 ); +* // x => <Float32Array>[ ~4.4, ~5.8, ~7.2, ~8.6, 10.0 ] +* // y => <Float32Array>[ ~4.2, ~4.4, ~4.6, ~4.8, 5.0 ] +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var srot = require( '@stdlib/blas/base/srot' ); +* +* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* srot.ndarray( 2, x, 2, 2, y, 2, 2, 0.8, 0.6 ); +* // x => <Float32Array>[ 1.0, 2.0, ~7.8, 4.0, ~10.6, 6.0 ] +* // y => <Float32Array>[ 7.0, 8.0, ~5.4, 10.0, ~5.8, 12.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 srot; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + srot = main; +} else { + srot = tmp; +} + + +// EXPORTS // + +module.exports = srot; + +// exports: { "ndarray": "srot.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 srot = require( './srot.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( srot, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = srot; + |
+ 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 srot = require( './srot.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( srot, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = srot; + |
+ 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 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +25x +25x +25x +25x +25x +25x +25x +6x +6x +19x +19x +19x +25x +48x +48x +48x +48x +48x +48x +19x +25x +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'; + +// MAIN // + +/** +* Applies a plane rotation. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Float32Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @param {number} c - cosine of the angle of rotation +* @param {number} s - sine of the angle of rotation +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* srot( 2, x, 2, 2, y, 2, 2, 0.8, 0.6 ); +* // x => <Float32Array>[ 1.0, 2.0, ~7.8, 4.0, ~10.6, 6.0 ] +* // y => <Float32Array>[ 7.0, 8.0, ~5.4, 10.0, ~5.8, 12.0 ] +*/ +function srot( N, x, strideX, offsetX, y, strideY, offsetY, c, s ) { + var tmp; + var ix; + var iy; + var i; + + if ( N <= 0 ) { + return y; + } + ix = offsetX; + iy = offsetY; + + for ( i = 0; i < N; i++ ) { + tmp = ( c * x[ ix ] ) + ( s * y[ iy ] ); + y[ iy ] = ( c * y[ iy ] ) - ( s * x[ ix ] ); + x[ ix ] = tmp; + ix += strideX; + iy += strideY; + } + return y; +} + + +// EXPORTS // + +module.exports = srot; + |
+ 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 | 2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +25x +25x +25x +25x +25x +25x +25x +25x +25x +25x +25x +25x +25x +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 minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +var offsetView = require( '@stdlib/strided/base/offset-view' ); +var addon = require( './srot.native.js' ); + + +// MAIN // + +/** +* Applies a plane rotation. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float32Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {Float32Array} y - output array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @param {number} c - cosine of the angle of rotation +* @param {number} s - sine of the angle of rotation +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +* +* srot( 4, x, 1, 1, y, 1, 1, 0.8, 0.6 ); +* // x => <Float32Array>[ 1.0, ~5.8, ~7.2, ~8.6, 10.0 ] +* // y => <Float32Array>[ 6.0, 4.4, ~4.6, ~4.8, 5.0 ] +*/ +function srot( N, x, strideX, offsetX, y, strideY, offsetY, c, s ) { + var viewX; + var viewY; + + offsetX = minViewBufferIndex( N, strideX, offsetX ); + offsetY = minViewBufferIndex( N, strideY, offsetY ); + + viewX = offsetView( x, offsetX ); + viewY = offsetView( y, offsetY ); + + addon( N, viewX, strideX, viewY, strideY, c, s ); + return y; +} + + +// EXPORTS // + +module.exports = srot; + |
+ 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 +23x +23x +23x +23x +23x +23x +23x +6x +6x +17x +23x +4x +12x +12x +12x +12x +4x +4x +13x +23x +8x +23x +5x +5x +23x +7x +23x +6x +6x +23x +32x +32x +32x +32x +32x +32x +13x +23x +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'; + +// MAIN // + +/** +* Applies a plane rotation. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {Float32Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {number} c - cosine of the angle of rotation +* @param {number} s - sine of the angle of rotation +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); +* +* srot( 3, x, 2, y, 2, 0.8, 0.6 ); +* // x => <Float32Array>[ 5.0, 2.0, ~7.8, 4.0, ~10.6, 6.0 ] +* // y => <Float32Array>[ 5.0, 8.0, ~5.4, 10.0, ~5.8, 12.0 ] +*/ +function srot( N, x, strideX, y, strideY, c, s ) { + var tmp; + var ix; + var iy; + var i; + + if ( N <= 0 ) { + return y; + } + // If both strides are equal to `1`... + if ( strideX === 1 && strideY === 1 ) { + for ( i = 0; i < N; i++ ) { + tmp = ( c * x[ i ] ) + ( s * y[ i ] ); + y[ i ] = ( c * y[ i ] ) - ( s * x[ i ] ); + x[ i ] = tmp; + } + return y; + } + // If both strides are not equal to `1`... + if ( strideX < 0 ) { + ix = ( 1 - N ) * strideX; + } else { + ix = 0; + } + if ( strideY < 0 ) { + iy = ( 1 - N ) * strideY; + } else { + iy = 0; + } + for ( i = 0; i < N; i++ ) { + tmp = ( c * x[ ix ] ) + ( s * y[ iy ] ); + y[ iy ] = ( c * y[ iy ] ) - ( s * x[ ix ] ); + x[ ix ] = tmp; + ix += strideX; + iy += strideY; + } + return y; +} + + +// EXPORTS // + +module.exports = srot; + |
+ 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 | 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 +48x +48x +48x +48x +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'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Applies a plane rotation. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float32Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {Float32Array} y - output array +* @param {integer} strideY - `y` stride length +* @param {number} c - cosine of the angle of rotation +* @param {number} s - sine of the angle of rotation +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); +* +* srot( x.length, x, 1, y, 1, 0.8, 0.6 ); +* // x => <Float32Array>[ ~4.4, ~5.8, ~7.2, ~8.6, 10.0 ] +* // y => <Float32Array>[ ~4.2, 4.4, 4.6, 4.8, 5.0 ] +*/ +function srot( N, x, strideX, y, strideY, c, s ) { + addon( N, x, strideX, y, strideY, c, s ); + return y; +} + + +// EXPORTS // + +module.exports = srot; + |