diff --git a/blas/ext/base/sapx/coverage.ndjson b/blas/ext/base/sapx/coverage.ndjson new file mode 100644 index 000000000..92b346fca --- /dev/null +++ b/blas/ext/base/sapx/coverage.ndjson @@ -0,0 +1 @@ +[432,432,100,42,42,100,4,4,100,432,432,100,"e4f0dcd53e364d25d1a598e20ed25dd73cf547e7","2024-03-20 21:53:43 -0700"] diff --git a/blas/ext/base/sapx/index.html b/blas/ext/base/sapx/index.html new file mode 100644 index 000000000..578bb9c60 --- /dev/null +++ b/blas/ext/base/sapx/index.html @@ -0,0 +1,206 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib + + + + + + + + + +
+
+

All files blas/ext/base/sapx/lib

+
+ +
+ 100% + Statements + 432/432 +
+ + +
+ 100% + Branches + 42/42 +
+ + +
+ 100% + Functions + 4/4 +
+ + +
+ 100% + Lines + 432/432 +
+ + +
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.js +
+
100%68/68100%3/3100%0/0100%68/68
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%91/91100%15/15100%1/1100%91/91
ndarray.native.js +
+
100%60/60100%2/2100%1/1100%60/60
sapx.js +
+
100%90/90100%18/18100%1/1100%90/90
sapx.native.js +
+
100%53/53100%2/2100%1/1100%53/53
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/sapx/index.js.html b/blas/ext/base/sapx/index.js.html new file mode 100644 index 000000000..62309f66d --- /dev/null +++ b/blas/ext/base/sapx/index.js.html @@ -0,0 +1,289 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib/index.js + + + + + + + + + +
+
+

All files / blas/ext/base/sapx/lib index.js

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

+ 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 +693x +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) 2020 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';
+ 
+/**
+* Add a constant to each element in a single-precision floating-point strided array.
+*
+* @module @stdlib/blas/ext/base/sapx
+*
+* @example
+* var Float32Array = require( '@stdlib/array/float32' );
+* var sapx = require( '@stdlib/blas/ext/base/sapx' );
+*
+* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
+*
+* sapx( x.length, 5.0, x, 1 );
+* // x => <Float32Array>[ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]
+*
+* @example
+* var Float32Array = require( '@stdlib/array/float32' );
+* var sapx = require( '@stdlib/blas/ext/base/sapx' );
+*
+* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
+*
+* sapx.ndarray( x.length, 5.0, x, 1, 0 );
+* // x => <Float32Array>[ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.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 sapx;
+var tmp = tryRequire( join( __dirname, './native.js' ) );
+if ( isError( tmp ) ) {
+	sapx = main;
+} else {
+	sapx = tmp;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = sapx;
+ 
+// exports: { "ndarray": "sapx.ndarray" }
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/sapx/main.js.html b/blas/ext/base/sapx/main.js.html new file mode 100644 index 000000000..e5eb68e52 --- /dev/null +++ b/blas/ext/base/sapx/main.js.html @@ -0,0 +1,190 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib/main.js + + + + + + + + + +
+
+

All files / blas/ext/base/sapx/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) 2020 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 sapx = require( './sapx.js' );
+var ndarray = require( './ndarray.js' );
+ 
+ 
+// MAIN //
+ 
+setReadOnly( sapx, 'ndarray', ndarray );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = sapx;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/sapx/native.js.html b/blas/ext/base/sapx/native.js.html new file mode 100644 index 000000000..992b40f16 --- /dev/null +++ b/blas/ext/base/sapx/native.js.html @@ -0,0 +1,190 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib/native.js + + + + + + + + + +
+
+

All files / blas/ext/base/sapx/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) 2020 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 sapx = require( './sapx.native.js' );
+var ndarray = require( './ndarray.native.js' );
+ 
+ 
+// MAIN //
+ 
+setReadOnly( sapx, 'ndarray', ndarray );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = sapx;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/sapx/ndarray.js.html b/blas/ext/base/sapx/ndarray.js.html new file mode 100644 index 000000000..56c2d1a59 --- /dev/null +++ b/blas/ext/base/sapx/ndarray.js.html @@ -0,0 +1,358 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib/ndarray.js + + + + + + + + + +
+
+

All files / blas/ext/base/sapx/lib ndarray.js

+
+ +
+ 100% + Statements + 91/91 +
+ + +
+ 100% + Branches + 15/15 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 91/91 +
+ + +
+

+ 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 +922x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +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 +3x +3x +8x +8x +8x +11x +5x +5x +5x +5x +2x +5x +5x +5x +2x +5x +1x +1x +5x +70x +70x +70x +70x +70x +70x +70x +4x +4x +11x +9x +9x +9x +3x +11x +2x +2x +2x +2x +2x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2020 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';
+ 
+// VARIABLES //
+ 
+var M = 5;
+ 
+ 
+// MAIN //
+ 
+/**
+* Adds a constant to each element in a single-precision floating-point strided array.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {number} alpha - scalar
+* @param {Float32Array} x - input array
+* @param {integer} stride - index increment
+* @param {NonNegativeInteger} offset - starting index
+* @returns {Float32Array} input array
+*
+* @example
+* var Float32Array = require( '@stdlib/array/float32' );
+*
+* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
+* var alpha = 5.0;
+*
+* sapx( 3, alpha, x, 1, x.length-3 );
+* // x => <Float32Array>[ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]
+*/
+function sapx( N, alpha, x, stride, offset ) {
+	var ix;
+	var m;
+	var i;
+ 
+	if ( N <= 0 || alpha === 0.0 ) {
+		return x;
+	}
+	ix = offset;
+ 
+	// Use loop unrolling if the stride is equal to `1`...
+	if ( stride === 1 ) {
+		m = N % M;
+ 
+		// If we have a remainder, run a clean-up loop...
+		if ( m > 0 ) {
+			for ( i = 0; i < m; i++ ) {
+				x[ ix ] += alpha;
+				ix += stride;
+			}
+		}
+		if ( N < M ) {
+			return x;
+		}
+		for ( i = m; i < N; i += M ) {
+			x[ ix ] += alpha;
+			x[ ix+1 ] += alpha;
+			x[ ix+2 ] += alpha;
+			x[ ix+3 ] += alpha;
+			x[ ix+4 ] += alpha;
+			ix += M;
+		}
+		return x;
+	}
+	for ( i = 0; i < N; i++ ) {
+		x[ ix ] += alpha;
+		ix += stride;
+	}
+	return x;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = sapx;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/sapx/ndarray.native.js.html b/blas/ext/base/sapx/ndarray.native.js.html new file mode 100644 index 000000000..0e700797f --- /dev/null +++ b/blas/ext/base/sapx/ndarray.native.js.html @@ -0,0 +1,265 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib/ndarray.native.js + + + + + + + + + +
+
+

All files / blas/ext/base/sapx/lib ndarray.native.js

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

+ 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 +612x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +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 +2x +2x +2x +2x +2x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2020 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( './sapx.native.js' );
+ 
+ 
+// MAIN //
+ 
+/**
+* Adds a constant to each element in a single-precision floating-point strided array.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {number} alpha - scalar
+* @param {Float32Array} x - input array
+* @param {integer} stride - index increment
+* @param {NonNegativeInteger} offset - starting index
+* @returns {Float32Array} input array
+*
+* @example
+* var Float32Array = require( '@stdlib/array/float32' );
+*
+* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
+* var alpha = 5.0;
+*
+* sapx( 3, alpha, x, 1, x.length-3 );
+* // x => <Float32Array>[ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]
+*/
+function sapx( N, alpha, x, stride, offset ) {
+	var view;
+	offset = minViewBufferIndex( N, stride, offset );
+	view = offsetView( x, offset );
+	addon( N, alpha, view, stride );
+	return x;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = sapx;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/sapx/sapx.js.html b/blas/ext/base/sapx/sapx.js.html new file mode 100644 index 000000000..a3ec019d0 --- /dev/null +++ b/blas/ext/base/sapx/sapx.js.html @@ -0,0 +1,355 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib/sapx.js + + + + + + + + + +
+
+

All files / blas/ext/base/sapx/lib sapx.js

+
+ +
+ 100% + Statements + 90/90 +
+ + +
+ 100% + Branches + 18/18 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 90/90 +
+ + +
+

+ 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 +912x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +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 +3x +3x +8x +11x +5x +5x +5x +5x +2x +5x +5x +2x +5x +1x +1x +5x +70x +70x +70x +70x +70x +70x +4x +4x +11x +1x +11x +2x +2x +11x +9x +9x +9x +3x +11x +2x +2x +2x +2x +2x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2020 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';
+ 
+// VARIABLES //
+ 
+var M = 5;
+ 
+ 
+// MAIN //
+ 
+/**
+* Adds a constant to each element in a single-precision floating-point strided array.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {number} alpha - scalar
+* @param {Float32Array} x - input array
+* @param {integer} stride - index increment
+* @returns {Float32Array} input array
+*
+* @example
+* var Float32Array = require( '@stdlib/array/float32' );
+*
+* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
+*
+* sapx( x.length, 5.0, x, 1 );
+* // x => <Float32Array>[ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]
+*/
+function sapx( N, alpha, x, stride ) {
+	var ix;
+	var i;
+	var m;
+ 
+	if ( N <= 0 || alpha === 0.0 ) {
+		return x;
+	}
+	// Use loop unrolling if the stride is equal to `1`...
+	if ( stride === 1 ) {
+		m = N % M;
+ 
+		// If we have a remainder, run a clean-up loop...
+		if ( m > 0 ) {
+			for ( i = 0; i < m; i++ ) {
+				x[ i ] += alpha;
+			}
+		}
+		if ( N < M ) {
+			return x;
+		}
+		for ( i = m; i < N; i += M ) {
+			x[ i ] += alpha;
+			x[ i+1 ] += alpha;
+			x[ i+2 ] += alpha;
+			x[ i+3 ] += alpha;
+			x[ i+4 ] += alpha;
+		}
+		return x;
+	}
+	if ( stride < 0 ) {
+		ix = (1-N) * stride;
+	} else {
+		ix = 0;
+	}
+	for ( i = 0; i < N; i++ ) {
+		x[ ix ] += alpha;
+		ix += stride;
+	}
+	return x;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = sapx;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/blas/ext/base/sapx/sapx.native.js.html b/blas/ext/base/sapx/sapx.native.js.html new file mode 100644 index 000000000..a0ddb6caa --- /dev/null +++ b/blas/ext/base/sapx/sapx.native.js.html @@ -0,0 +1,244 @@ + + + + + + Code coverage report for blas/ext/base/sapx/lib/sapx.native.js + + + + + + + + + +
+
+

All files / blas/ext/base/sapx/lib sapx.native.js

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

+ 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 +543x +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 +22x +22x +22x +22x +3x +3x +3x +3x +3x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2020 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 //
+ 
+/**
+* Adds a constant to each element in a single-precision floating-point strided array.
+*
+* @param {PositiveInteger} N - number of indexed elements
+* @param {number} alpha - scalar
+* @param {Float32Array} x - input array
+* @param {integer} stride - index increment
+* @returns {Float32Array} input array
+*
+* @example
+* var Float32Array = require( '@stdlib/array/float32' );
+*
+* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
+*
+* sapx( x.length, 5.0, x, 1 );
+* // x => <Float32Array>[ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]
+*/
+function sapx( N, alpha, x, stride ) {
+	addon( N, alpha, x, stride );
+	return x;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = sapx;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file