From 6ced61b9912873af068c83bcfce4779ff4b2f79f Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Sat, 30 May 2026 16:02:27 -0700 Subject: [PATCH 1/8] feat: add `blas/ext/base/gaxpby` --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/blas/ext/base/gaxpby/README.md | 200 ++++++++ .../ext/base/gaxpby/benchmark/benchmark.js | 104 ++++ .../gaxpby/benchmark/benchmark.ndarray.js | 104 ++++ .../blas/ext/base/gaxpby/docs/repl.txt | 130 +++++ .../ext/base/gaxpby/docs/types/index.d.ts | 110 ++++ .../blas/ext/base/gaxpby/docs/types/test.ts | 313 ++++++++++++ .../blas/ext/base/gaxpby/examples/index.js | 35 ++ .../blas/ext/base/gaxpby/lib/accessors.js | 84 +++ .../@stdlib/blas/ext/base/gaxpby/lib/index.js | 59 +++ .../@stdlib/blas/ext/base/gaxpby/lib/main.js | 55 ++ .../blas/ext/base/gaxpby/lib/ndarray.js | 122 +++++ .../@stdlib/blas/ext/base/gaxpby/package.json | 73 +++ .../@stdlib/blas/ext/base/gaxpby/test/test.js | 38 ++ .../blas/ext/base/gaxpby/test/test.main.js | 384 ++++++++++++++ .../blas/ext/base/gaxpby/test/test.ndarray.js | 479 ++++++++++++++++++ 15 files changed, 2290 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/accessors.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/package.json create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.main.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md new file mode 100644 index 000000000000..3fdb08ef6be5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md @@ -0,0 +1,200 @@ + + +# gaxpby + +> Multiply a strided array `x` by a constant and add the result to a strided array `y` multiplied by a constant. + +
+ +This BLAS extension implements the operation + + + +```math +\mathbf{y} = \alpha \mathbf{x} + \beta \mathbf{y} +``` + + + +This API is complementary to the package [`@stdlib/blas/base/gaxpy`][@stdlib/blas/base/gaxpy] and is a common BLAS extension in libraries such as Intel MKL, OpenBLAS, etc. + +
+ + + +
+ +## Usage + +```javascript +var gaxpby = require( '@stdlib/blas/ext/base/gaxpby' ); +``` + +#### gaxpby( N, alpha, x, strideX, beta, y, strideY ) + +Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant. + +```javascript +var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + +gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); +// y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **alpha**: first scalar constant. +- **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array]. +- **strideX**: stride length for `x`. +- **beta**: second scalar constant. +- **y**: output [`Array`][mdn-array] or [`typed array`][mdn-typed-array]. +- **strideY**: stride length for `y`. + +The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to multiply every other element in `x` by `alpha` and add to every other element in `y` multiplied by `beta`: + +```javascript +var x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; +var y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; + +gaxpby( 3, 5.0, x, 2, 2.0, y, 2 ); +// y => [ 19.0, 8.0, 33.0, 10.0, 47.0, 12.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays... +var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); + +// Create offset views... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); // start at 3rd element + +gaxpby( 3, 5.0, x1, 1, 2.0, y1, 1 ); +// y0 => [ 7.0, 8.0, 28.0, 35.0, 42.0, 12.0 ] +``` + +#### gaxpby.ndarray( N, alpha, x, strideX, offsetX, beta, y, strideY, offsetY ) + +Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant using alternative indexing semantics. + +```javascript +var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + +gaxpby.ndarray( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); +// y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +``` + +The function has the following additional parameters: + +- **offsetX**: starting index for `x`. +- **offsetY**: starting index for `y`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to multiply the last three elements of `x` by `alpha` and add to the last three elements of `y` multiplied by `beta`: + +```javascript +var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; + +gaxpby.ndarray( 3, 5.0, x, 1, x.length-3, 2.0, y, 1, y.length-3 ); +// y => [ 6.0, 7.0, 31.0, 38.0, 45.0 ] +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, both functions return `y` unchanged. +- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]). +- For performance reasons, when `alpha = 0.0`, the function delegates to [`@stdlib/blas/base/gscal`][@stdlib/blas/base/gscal] to scale `y` by `beta`. +- For performance reasons, when `beta = 1.0`, the function delegates to [`@stdlib/blas/base/gaxpy`][@stdlib/blas/base/gaxpy] to compute `y = alpha * x + y`. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var gaxpby = require( '@stdlib/blas/ext/base/gaxpby' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +var y = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( y ); + +gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); +console.log( y ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.js new file mode 100644 index 000000000000..a95d8a175f52 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gaxpby = require( './../lib/main.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'generic' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -100, 100, options ); + var y = uniform( len, -100, 100, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = gaxpby( x.length, 5.0, x, 1, 3.0, y, 1 ); + if ( isnan( z[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..0802010a09d1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/benchmark/benchmark.ndarray.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var gaxpby = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'generic' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = uniform( len, -100, 100, options ); + var y = uniform( len, -100, 100, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = gaxpby( x.length, 5.0, x, 1, 0, 3.0, y, 1, 0 ); + if ( isnan( z[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%x.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/repl.txt new file mode 100644 index 000000000000..37a36f2ca49e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/repl.txt @@ -0,0 +1,130 @@ + +{{alias}}( N, alpha, x, strideX, beta, y, strideY ) + Multiplies a strided array `x` by a constant and adds the result to a + strided array `y` multiplied by a constant. + + The `N` and stride parameters determine which elements in the strided + arrays are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N <= 0`, the function returns `y` unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + alpha: number + Scalar constant for `x`. + + x: Array|TypedArray + Input array. + + strideX: integer + Stride length for `x`. + + beta: number + Scalar constant for `y`. + + y: Array|TypedArray + Output array. + + strideY: integer + Stride length for `y`. + + Returns + ------- + y: Array|TypedArray + Output array. + + Examples + -------- + // Standard Usage: + > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + > var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + > {{alias}}( x.length, 5.0, x, 1, 2.0, y, 1 ) + [ 9.0, 16.0, 23.0, 30.0, 37.0 ] + + // Using `N` and stride parameters: + > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; + > y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; + > {{alias}}( 3, 5.0, x, 2, 2.0, y, 2 ) + [ 19.0, 8.0, 33.0, 10.0, 47.0, 12.0 ] + + // Using view offsets: + > var bufX = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; + > var bufY = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ]; + > var x0 = new {{alias:@stdlib/array/float64}}( bufX ); + > var y0 = new {{alias:@stdlib/array/float64}}( bufY ); + > var offsetX = x0.BYTES_PER_ELEMENT * 1; + > var offsetY = y0.BYTES_PER_ELEMENT * 2; + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, offsetX ); + > var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, offsetY ); + > {{alias}}( 3, 5.0, x1, 1, 2.0, y1, 1 ) + [ 28.0, 35.0, 42.0, 12.0 ] + > y0 + [ 7.0, 8.0, 28.0, 35.0, 42.0, 12.0 ] + + +{{alias}}.ndarray( N, alpha, x, strideX, offsetX, beta, y, strideY, offsetY ) + Multiplies a strided array `x` by a constant and adds the result to a + strided array `y` multiplied by a constant using alternative indexing + semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + N: integer + Number of indexed elements. + + alpha: number + Scalar constant for `x`. + + x: Array|TypedArray + Input array. + + strideX: integer + Stride length for `x`. + + offsetX: integer + Starting index for `x`. + + beta: number + Scalar constant for `y`. + + y: Array|TypedArray + Output array. + + strideY: integer + Stride length for `y`. + + offsetY: integer + Starting index for `y`. + + Returns + ------- + y: Array|TypedArray + Output array. + + Examples + -------- + // Standard Usage: + > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + > var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + > {{alias}}.ndarray( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ) + [ 9.0, 16.0, 23.0, 30.0, 37.0 ] + + // Using index offsets: + > x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + > y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; + > {{alias}}.ndarray( 3, 5.0, x, 1, x.length-3, 2.0, y, 1, y.length-3 ) + [ 6.0, 7.0, 31.0, 38.0, 45.0 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts new file mode 100644 index 000000000000..8a530405b565 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts @@ -0,0 +1,110 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +// TypeScript Version: 4.1 + +/// + +import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array'; + +/** +* Input array. +*/ +type InputArray = NumericArray | Collection | AccessorArrayLike; + +/** +* Interface describing `gaxpby`. +*/ +interface Routine { + /** + * Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant. + * + * @param N - number of indexed elements + * @param alpha - scalar constant for `x` + * @param x - input array + * @param strideX - `x` stride length + * @param beta - scalar constant for `y` + * @param y - output array + * @param strideY - `y` stride length + * @returns `y` + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + * var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + * + * gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); + * // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] + */ + ( N: number, alpha: number, x: T, strideX: number, beta: number, y: T, strideY: number ): T; + + /** + * Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param alpha - scalar constant for `x` + * @param x - input array + * @param strideX - `x` stride length + * @param offsetX - starting index for `x` + * @param beta - scalar constant for `y` + * @param y - output array + * @param strideY - `y` stride length + * @param offsetY - starting index for `y` + * @returns `y` + * + * @example + * var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + * var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + * + * gaxpby.ndarray( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); + * // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] + */ + ndarray( N: number, alpha: number, x: T, strideX: number, offsetX: number, beta: number, y: T, strideY: number, offsetY: number ): T; +} + +/** +* Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant. +* +* @param N - number of indexed elements +* @param alpha - scalar constant for `x` +* @param x - input array +* @param strideX - `x` stride length +* @param beta - scalar constant for `y` +* @param y - output array +* @param strideY - `y` stride length +* @returns `y` +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); +* // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gaxpby.ndarray( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); +* // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +*/ +declare var gaxpby: Routine; + + +// EXPORTS // + +export = gaxpby; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/test.ts new file mode 100644 index 000000000000..14320334d517 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/test.ts @@ -0,0 +1,313 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +import AccessorArray = require( '@stdlib/array/base/accessor' ); +import gaxpby = require( './index' ); + + +// TESTS // + +// The function returns a numeric array... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby( x.length, 5.0, x, 1, 3.0, y, 1 ); // $ExpectType Float64Array + gaxpby( x.length, 5.0, new AccessorArray( x ), 1, 3.0, new AccessorArray( y ), 1 ); // $ExpectType AccessorArray +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby( '10', 5.0, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( true, 5.0, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( false, 5.0, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( null, 5.0, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( undefined, 5.0, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( [], 5.0, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( {}, 5.0, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( ( x: number ): number => x, 5.0, x, 1, 3.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby( x.length, '10', x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, true, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, false, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, null, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, undefined, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, [], x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, {}, x, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, ( x: number ): number => x, x, 1, 3.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a numeric array... +{ + const y = new Float64Array( 10 ); + + gaxpby( 10, 5.0, 10, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, '10', 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, true, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, false, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, null, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, undefined, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, [ '1' ], 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, {}, 1, 3.0, y, 1 ); // $ExpectError + gaxpby( 10, 5.0, ( x: number ): number => x, 1, 3.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby( x.length, 5.0, x, '10', 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, true, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, false, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, null, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, undefined, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, [], 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, {}, 3.0, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, ( x: number ): number => x, 3.0, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby( x.length, 5.0, x, 1, '10', y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, true, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, false, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, null, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, undefined, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, [], y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, {}, y, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a numeric array... +{ + const x = new Float64Array( 10 ); + + gaxpby( 10, 5.0, x, 1, 3.0, 10, 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, '10', 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, true, 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, false, 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, null, 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, undefined, 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, [ '1' ], 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, {}, 1 ); // $ExpectError + gaxpby( 10, 5.0, x, 1, 3.0, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby( x.length, 5.0, x, 1, 3.0, y, '10' ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, true ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, false ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, null ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, undefined ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, [] ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, {} ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby(); // $ExpectError + gaxpby( x.length ); // $ExpectError + gaxpby( x.length, 5.0 ); // $ExpectError + gaxpby( x.length, 5.0, x ); // $ExpectError + gaxpby( x.length, 5.0, x, 1 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0 ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y ); // $ExpectError + gaxpby( x.length, 5.0, x, 1, 3.0, y, 1, 10 ); // $ExpectError +} + +// Attached to the main export is an `ndarray` method which returns a numeric array... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectType Float64Array + gaxpby.ndarray( x.length, 5.0, new AccessorArray( x ), 1, 0, 3.0, new AccessorArray( y ), 1, 0 ); // $ExpectType AccessorArray +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( '10', 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( true, 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( false, 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( null, 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( undefined, 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( [], 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( {}, 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( ( x: number ): number => x, 5.0, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( x.length, '10', x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, true, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, false, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, null, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, undefined, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, [], x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, {}, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, ( x: number ): number => x, x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a numeric array... +{ + const y = new Float64Array( 10 ); + + gaxpby.ndarray( 10, 5.0, 10, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, '10', 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, true, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, false, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, null, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, undefined, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, [ '1' ], 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, {}, 1, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, ( x: number ): number => x, 1, 0, 3.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( x.length, 5.0, x, '10', 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, true, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, false, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, null, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, undefined, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, [], 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, {}, 0, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, ( x: number ): number => x, 0, 3.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( x.length, 5.0, x, 1, '10', 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, true, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, false, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, null, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, undefined, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, [], 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, {}, 3.0, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, ( x: number ): number => x, 3.0, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( x.length, 5.0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a numeric array... +{ + const x = new Float64Array( 10 ); + + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, 10, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, '10', 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, true, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, false, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, null, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, undefined, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, [ '1' ], 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, {}, 1, 0 ); // $ExpectError + gaxpby.ndarray( 10, 5.0, x, 1, 0, 3.0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, '10', 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, true, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, false, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, null, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, undefined, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, [], 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, {}, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, '10' ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, true ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, false ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, null ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, undefined ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, [] ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, {} ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x = new Float64Array( 10 ); + const y = new Float64Array( 10 ); + + gaxpby.ndarray(); // $ExpectError + gaxpby.ndarray( x.length ); // $ExpectError + gaxpby.ndarray( x.length, 5.0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1 ); // $ExpectError + gaxpby.ndarray( x.length, 5.0, x, 1, 0, 3.0, y, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js new file mode 100644 index 000000000000..b50079695048 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var gaxpby = require( './../lib' ); + +var x = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( x ); + +var y = discreteUniform( 10, -100, 100, { + 'dtype': 'float64' +}); +console.log( y ); + +gaxpby( x.length, 5.0, x, 1, 3.0, y, 1 ); +console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/accessors.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/accessors.js new file mode 100644 index 000000000000..c7852e5809f3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/accessors.js @@ -0,0 +1,84 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 // + +/** +* Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant. +* +* @private +* @param {PositiveInteger} N - number of indexed elements +* @param {number} alpha - first scalar constant +* @param {Object} x - input array object +* @param {Collection} x.data - input array data +* @param {Array} x.accessors - array element accessors +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {number} beta - second scalar constant +* @param {Object} y - output array object +* @param {Collection} y.data - output array data +* @param {Array} y.accessors - array element accessors +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @returns {Object} output array object +* +* @example +* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +* var arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +* +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gaxpby( x.length, 5.0, arraylike2object( toAccessorArray( x ) ), 1, 0, 2.0, arraylike2object( toAccessorArray( y ) ), 1, 0 ); +* // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +*/ +function gaxpby( N, alpha, x, strideX, offsetX, beta, y, strideY, offsetY ) { + var xbuf; + var ybuf; + var xget; + var yset; + var yget; + var ix; + var iy; + var i; + + // Cache references to array data: + xbuf = x.data; + ybuf = y.data; + + // Cache references to element accessors: + xget = x.accessors[ 0 ]; + yget = y.accessors[ 0 ]; + yset = y.accessors[ 1 ]; + + ix = offsetX; + iy = offsetY; + for ( i = 0; i < N; i++ ) { + yset( ybuf, iy, ( alpha * xget( xbuf, ix ) ) + ( beta * yget( ybuf, iy ) ) ); + ix += strideX; + iy += strideY; + } + return y; +} + + +// EXPORTS // + +module.exports = gaxpby; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/index.js new file mode 100644 index 000000000000..78eac0b7f336 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/index.js @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +/** +* Multiply a strided array `x` by a constant and add the result to a strided array `y` multiplied by a constant. +* +* @module @stdlib/blas/ext/base/gaxpby +* +* @example +* var gaxpby = require( '@stdlib/blas/ext/base/gaxpby' ); +* +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); +* // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +* +* @example +* var gaxpby = require( '@stdlib/blas/ext/base/gaxpby' ); +* +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gaxpby.ndarray( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); +* // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( main, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/main.js new file mode 100644 index 000000000000..2fbf2f8fd340 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/main.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {number} alpha - first scalar constant +* @param {NumericArray} x - input array +* @param {integer} strideX - `x` stride length +* @param {number} beta - second scalar constant +* @param {NumericArray} y - output array +* @param {integer} strideY - `y` stride length +* @returns {NumericArray} output array +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); +* // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +*/ +function gaxpby( N, alpha, x, strideX, beta, y, strideY ) { + return ndarray( N, alpha, x, strideX, stride2offset( N, strideX ), beta, y, strideY, stride2offset( N, strideY ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = gaxpby; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js new file mode 100644 index 000000000000..92575520ef0a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js @@ -0,0 +1,122 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 arraylike2object = require( '@stdlib/array/base/arraylike2object' ); +var gaxpy = require( '@stdlib/blas/base/gaxpy' ).ndarray; +var gscal = require( '@stdlib/blas/base/gscal' ).ndarray; +var accessors = require( './accessors.js' ); + + +// VARIABLES // + +var M = 5; + + +// MAIN // + +/** +* Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {number} alpha - first scalar constant +* @param {NumericArray} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {number} beta - second scalar constant +* @param {NumericArray} y - output array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting `y` index +* @returns {NumericArray} output array +* +* @example +* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; +* var y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; +* +* gaxpby( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); +* // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] +*/ +function gaxpby( N, alpha, x, strideX, offsetX, beta, y, strideY, offsetY ) { + var ix; + var iy; + var ox; + var oy; + var m; + var i; + + if ( N <= 0 ) { + return y; + } + // Fast path: when alpha = 0.0, delegate to gscal (y = beta * y) + if ( alpha === 0.0 ) { + return gscal( N, beta, y, strideY, offsetY ); + } + // Fast path: when beta = 1.0, delegate to gaxpy (y = alpha * x + y) + if ( beta === 1.0 ) { + return gaxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ); + } + ox = arraylike2object( x ); + oy = arraylike2object( y ); + if ( ox.accessorProtocol || oy.accessorProtocol ) { + accessors( N, alpha, ox, strideX, offsetX, beta, oy, strideY, offsetY ); + return oy.data; + } + ix = offsetX; + iy = offsetY; + + // Use loop unrolling if both strides are equal to `1`... + if ( strideX === 1 && strideY === 1 ) { + m = N % M; + + // If we have a remainder, run a clean-up loop... + if ( m > 0 ) { + for ( i = 0; i < m; i++ ) { + y[ iy ] = ( alpha * x[ ix ] ) + ( beta * y[ iy ] ); + ix += strideX; + iy += strideY; + } + } + if ( N < M ) { + return y; + } + for ( i = m; i < N; i += M ) { + y[ iy ] = ( alpha * x[ ix ] ) + ( beta * y[ iy ] ); + y[ iy+1 ] = ( alpha * x[ ix+1 ] ) + ( beta * y[ iy+1 ] ); + y[ iy+2 ] = ( alpha * x[ ix+2 ] ) + ( beta * y[ iy+2 ] ); + y[ iy+3 ] = ( alpha * x[ ix+3 ] ) + ( beta * y[ iy+3 ] ); + y[ iy+4 ] = ( alpha * x[ ix+4 ] ) + ( beta * y[ iy+4 ] ); + ix += M; + iy += M; + } + return y; + } + for ( i = 0; i < N; i++ ) { + y[ iy ] = ( alpha * x[ ix ] ) + ( beta * y[ iy ] ); + ix += strideX; + iy += strideY; + } + return y; +} + + +// EXPORTS // + +module.exports = gaxpby; diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/package.json b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/package.json new file mode 100644 index 000000000000..5da9dbacb351 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/blas/ext/base/gaxpby", + "version": "0.0.0", + "description": "Multiply a strided array `x` by a constant and add the result to a strided array `y` multiplied by a constant.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "extended", + "linear", + "algebra", + "subroutines", + "multiply", + "add", + "scale", + "transform", + "strided", + "array", + "ndarray", + "vector", + "axpby", + "gaxpby" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.js new file mode 100644 index 000000000000..631db4eea414 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 tape = require( 'tape' ); +var gaxpby = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gaxpby, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof gaxpby.ndarray, 'function', 'method is a function' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.main.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.main.js new file mode 100644 index 000000000000..4a966aec8ebe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.main.js @@ -0,0 +1,384 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gaxpby = require( './../lib/main.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gaxpby, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 7', function test( t ) { + t.strictEqual( gaxpby.length, 7, 'has expected arity' ); + t.end(); +}); + +tape( 'the function multiplies `x` by a constant and adds the result to `y` multiplied by a constant', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0, // 5.0*3.0 + 2.0*4.0 + 30.0, // 5.0*4.0 + 2.0*5.0 + 37.0 // 5.0*5.0 + 2.0*6.0 + ]; + + gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + x = [ 1.0, 2.0 ]; + y = [ 5.0, 6.0 ]; + expected = [ 15.0, 22.0 ]; + + gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function multiplies `x` by a constant and adds the result to `y` multiplied by a constant (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0, // 5.0*3.0 + 2.0*4.0 + 30.0, // 5.0*4.0 + 2.0*5.0 + 37.0 // 5.0*5.0 + 2.0*6.0 + ]; + + gaxpby( x.length, 5.0, toAccessorArray( x ), 1, 2.0, toAccessorArray( y ), 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + x = [ 1.0, 2.0 ]; + y = [ 5.0, 6.0 ]; + expected = [ 15.0, 22.0 ]; + + gaxpby( x.length, 5.0, toAccessorArray( x ), 1, 2.0, toAccessorArray( y ), 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the output array', function test( t ) { + var out; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 5.0, 6.0, 7.0, 8.0, 9.0 ]; + out = gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); + + t.strictEqual( out, y, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `y` unchanged', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ 4.0, 5.0, 6.0 ]; + expected = [ 4.0, 5.0, 6.0 ]; + + gaxpby( 0, 5.0, x, 1, 2.0, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + gaxpby( -4, 5.0, x, 1, 2.0, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `alpha` equals `0.0`, the function scales `y` by `beta`', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + expected = [ 6.0, 9.0, 12.0, 15.0, 18.0 ]; // 3.0*y + + gaxpby( x.length, 0.0, x, 1, 3.0, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'when `beta` equals `1.0`, the function multiplies `x` by a constant and adds the result to `y`', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; + expected = [ 11.0, 17.0, 23.0, 29.0, 35.0 ]; // 5.0*x + y + + gaxpby( x.length, 5.0, x, 1, 1.0, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` stride', function test( t ) { + var expected; + var x; + var y; + + x = [ + 1.0, // 0 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 2 + ]; + y = [ 2.0, 3.0, 4.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 33.0 // 5.0*5.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, x, 2, 2.0, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` stride (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ + 1.0, // 0 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 2 + ]; + y = [ 2.0, 3.0, 4.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 33.0 // 5.0*5.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, toAccessorArray( x ), 2, 2.0, toAccessorArray( y ), 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a `y` stride', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ + 2.0, // 0 + 30.0, + 3.0, // 1 + 10.0, + 4.0 // 2 + ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 30.0, + 16.0, // 5.0*2.0 + 2.0*3.0 + 10.0, + 23.0 // 5.0*3.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, x, 1, 2.0, y, 2 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a `y` stride (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ + 2.0, // 0 + 30.0, + 3.0, // 1 + 10.0, + 4.0 // 2 + ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 30.0, + 16.0, // 5.0*2.0 + 2.0*3.0 + 10.0, + 23.0 // 5.0*3.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, toAccessorArray( x ), 1, 2.0, toAccessorArray( y ), 2 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports negative strides', function test( t ) { + var expected; + var x; + var y; + + x = new Float64Array([ + 1.0, // 2 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 0 + ]); + y = new Float64Array([ + 4.0, // 2 + 3.0, // 1 + 2.0 // 0 + ]); + expected = new Float64Array([ + 13.0, // 5.0*1.0 + 2.0*4.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 29.0 // 5.0*5.0 + 2.0*2.0 + ]); + + gaxpby( 3, 5.0, x, -2, 2.0, y, -1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports negative strides (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ + 1.0, // 2 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 0 + ]; + y = new Float64Array([ + 4.0, // 2 + 3.0, // 1 + 2.0 // 0 + ]); + expected = new Float64Array([ + 13.0, // 5.0*1.0 + 2.0*4.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 29.0 // 5.0*5.0 + 2.0*2.0 + ]); + + gaxpby( 3, 5.0, toAccessorArray( x ), -2, 2.0, toAccessorArray( y ), -1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var x0; + var y0; + var x1; + var y1; + + x0 = new Float64Array([ + 10.0, + 1.0, // 0 + 2.0, // 1 + 3.0, // 2 + 4.0 + ]); + y0 = new Float64Array([ + 10.0, + 10.0, + 2.0, // 0 + 3.0, // 1 + 4.0 // 2 + ]); + + x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); + + expected = new Float64Array([ + 10.0, + 10.0, + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0 // 5.0*3.0 + 2.0*4.0 + ]); + + gaxpby( 3, 5.0, x1, 1, 2.0, y1, 1 ); + t.deepEqual( y0, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'if both strides are equal to `1`, the function efficiently multiplies `x` by a constant and adds the result to `y` multiplied by a constant', function test( t ) { + var expected; + var alpha; + var beta; + var x; + var y; + var i; + + alpha = 3.0; + beta = 5.0; + x = new Float64Array( 100 ); + y = new Float64Array( 100 ); + expected = new Float64Array( x.length ); + for ( i = 0; i < x.length; i++ ) { + x[ i ] = i; + y[ i ] = x.length - i; + expected[ i ] = ( alpha * x[ i ] ) + ( beta * y[ i ] ); + } + gaxpby( x.length, alpha, x, 1, beta, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + x = new Float64Array( 240 ); + y = new Float64Array( 240 ); + expected = new Float64Array( x.length ); + for ( i = 0; i < x.length; i++ ) { + x[ i ] = i; + y[ i ] = x.length - i; + expected[ i ] = ( alpha * x[ i ] ) + ( beta * y[ i ] ); + } + gaxpby( x.length, alpha, x, 1, beta, y, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.ndarray.js new file mode 100644 index 000000000000..e080f9c3624e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/test/test.ndarray.js @@ -0,0 +1,479 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var gaxpby = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gaxpby, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( gaxpby.length, 9, 'has expected arity' ); + t.end(); +}); + +tape( 'the function multiplies `x` by a constant and adds the result to `y` multiplied by a constant', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0, // 5.0*3.0 + 2.0*4.0 + 30.0, // 5.0*4.0 + 2.0*5.0 + 37.0 // 5.0*5.0 + 2.0*6.0 + ]; + + gaxpby( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + x = [ 1.0, 2.0 ]; + y = [ 5.0, 6.0 ]; + expected = [ 15.0, 22.0 ]; + + gaxpby( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function multiplies `x` by a constant and adds the result to `y` multiplied by a constant (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0, // 5.0*3.0 + 2.0*4.0 + 30.0, // 5.0*4.0 + 2.0*5.0 + 37.0 // 5.0*5.0 + 2.0*6.0 + ]; + + gaxpby( x.length, 5.0, toAccessorArray( x ), 1, 0, 2.0, toAccessorArray( y ), 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + x = [ 1.0, 2.0 ]; + y = [ 5.0, 6.0 ]; + expected = [ 15.0, 22.0 ]; + + gaxpby( x.length, 5.0, toAccessorArray( x ), 1, 0, 2.0, toAccessorArray( y ), 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the output array', function test( t ) { + var out; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 5.0, 6.0, 7.0, 8.0, 9.0 ]; + out = gaxpby( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); + + t.strictEqual( out, y, 'same reference' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `y` unchanged', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ 4.0, 5.0, 6.0 ]; + expected = [ 4.0, 5.0, 6.0 ]; + + gaxpby( 0, 5.0, x, 1, 0, 2.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + gaxpby( -4, 5.0, x, 1, 0, 2.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'when `alpha` equals `0.0`, the function scales `y` by `beta`', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 2.0, 3.0, 4.0, 5.0, 6.0 ]; + expected = [ 6.0, 9.0, 12.0, 15.0, 18.0 ]; // 3.0*y + + gaxpby( x.length, 0.0, x, 1, 0, 3.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'when `beta` equals `1.0`, the function multiplies `x` by a constant and adds the result to `y`', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; + y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ]; + expected = [ 11.0, 17.0, 23.0, 29.0, 35.0 ]; // 5.0*x + y + + gaxpby( x.length, 5.0, x, 1, 0, 1.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` stride', function test( t ) { + var expected; + var x; + var y; + + x = [ + 1.0, // 0 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 2 + ]; + y = [ 2.0, 3.0, 4.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 33.0 // 5.0*5.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, x, 2, 0, 2.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` stride (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ + 1.0, // 0 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 2 + ]; + y = [ 2.0, 3.0, 4.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 33.0 // 5.0*5.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, toAccessorArray( x ), 2, 0, 2.0, toAccessorArray( y ), 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a `y` stride', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ + 2.0, // 0 + 30.0, + 3.0, // 1 + 10.0, + 4.0 // 2 + ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 30.0, + 16.0, // 5.0*2.0 + 2.0*3.0 + 10.0, + 23.0 // 5.0*3.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, x, 1, 0, 2.0, y, 2, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a `y` stride (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ + 2.0, // 0 + 30.0, + 3.0, // 1 + 10.0, + 4.0 // 2 + ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 30.0, + 16.0, // 5.0*2.0 + 2.0*3.0 + 10.0, + 23.0 // 5.0*3.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, toAccessorArray( x ), 1, 0, 2.0, toAccessorArray( y ), 2, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports negative strides', function test( t ) { + var expected; + var x; + var y; + + x = new Float64Array([ + 1.0, // 2 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 0 + ]); + y = new Float64Array([ + 4.0, // 2 + 3.0, // 1 + 2.0 // 0 + ]); + expected = new Float64Array([ + 13.0, // 5.0*1.0 + 2.0*4.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 29.0 // 5.0*5.0 + 2.0*2.0 + ]); + + gaxpby( 3, 5.0, x, -2, x.length-1, 2.0, y, -1, y.length-1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports negative strides (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ + 1.0, // 2 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 0 + ]; + y = new Float64Array([ + 4.0, // 2 + 3.0, // 1 + 2.0 // 0 + ]); + expected = new Float64Array([ + 13.0, // 5.0*1.0 + 2.0*4.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 29.0 // 5.0*5.0 + 2.0*2.0 + ]); + + gaxpby( 3, 5.0, toAccessorArray( x ), -2, x.length-1, 2.0, toAccessorArray( y ), -1, y.length-1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` offset', function test( t ) { + var expected; + var x; + var y; + + x = [ + 0.0, + 1.0, // 0 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 2 + ]; + y = [ 2.0, 3.0, 4.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 33.0 // 5.0*5.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, x, 2, 1, 2.0, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` offset (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ + 0.0, + 1.0, // 0 + 2.0, + 3.0, // 1 + 4.0, + 5.0 // 2 + ]; + y = [ 2.0, 3.0, 4.0 ]; + expected = [ + 9.0, // 5.0*1.0 + 2.0*2.0 + 21.0, // 5.0*3.0 + 2.0*3.0 + 33.0 // 5.0*5.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, toAccessorArray( x ), 2, 1, 2.0, toAccessorArray( y ), 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a `y` offset', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ + 0.0, + 2.0, // 0 + 3.0, // 1 + 4.0 // 2 + ]; + expected = [ + 0.0, + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0 // 5.0*3.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, x, 1, 0, 2.0, y, 1, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a `y` offset (accessors)', function test( t ) { + var expected; + var x; + var y; + + x = [ 1.0, 2.0, 3.0 ]; + y = [ + 0.0, + 2.0, // 0 + 3.0, // 1 + 4.0 // 2 + ]; + expected = [ + 0.0, + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0 // 5.0*3.0 + 2.0*4.0 + ]; + + gaxpby( 3, 5.0, toAccessorArray( x ), 1, 0, 2.0, toAccessorArray( y ), 1, 1 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports complex access patterns', function test( t ) { + var expected; + var x; + var y; + + x = [ + 0.0, + 1.0, // 0 + 0.0, + 2.0, // 1 + 0.0, + 3.0 // 2 + ]; + y = [ + 0.0, + 0.0, + 2.0, // 0 + 3.0, // 1 + 4.0, // 2 + 0.0 + ]; + expected = [ + 0.0, + 0.0, + 9.0, // 5.0*1.0 + 2.0*2.0 + 16.0, // 5.0*2.0 + 2.0*3.0 + 23.0, // 5.0*3.0 + 2.0*4.0 + 0.0 + ]; + + gaxpby( 3, 5.0, x, 2, 1, 2.0, y, 1, 2 ); + t.deepEqual( y, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'if both strides are equal to `1`, the function efficiently multiplies `x` by a constant and adds the result to `y` multiplied by a constant', function test( t ) { + var expected; + var alpha; + var beta; + var x; + var y; + var i; + + alpha = 3.0; + beta = 5.0; + x = new Float64Array( 100 ); + y = new Float64Array( 100 ); + expected = new Float64Array( x.length ); + for ( i = 0; i < x.length; i++ ) { + x[ i ] = i; + y[ i ] = x.length - i; + expected[ i ] = ( alpha * x[ i ] ) + ( beta * y[ i ] ); + } + gaxpby( x.length, alpha, x, 1, 0, beta, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + x = new Float64Array( 240 ); + y = new Float64Array( 240 ); + expected = new Float64Array( x.length ); + for ( i = 0; i < x.length; i++ ) { + x[ i ] = i; + y[ i ] = x.length - i; + expected[ i ] = ( alpha * x[ i ] ) + ( beta * y[ i ] ); + } + gaxpby( x.length, alpha, x, 1, 0, beta, y, 1, 0 ); + t.deepEqual( y, expected, 'returns expected value' ); + + t.end(); +}); From b33b9ab78b8d4c7eb8eda7f334d53a801781a74e Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Sat, 30 May 2026 16:05:16 -0700 Subject: [PATCH 2/8] chore: use same example --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js index b50079695048..97671d29aa93 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/examples/index.js @@ -31,5 +31,5 @@ var y = discreteUniform( 10, -100, 100, { }); console.log( y ); -gaxpby( x.length, 5.0, x, 1, 3.0, y, 1 ); +gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); console.log( y ); From 0e0dc318375afef764d91b46d3f8f98939823248 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 30 May 2026 17:08:49 -0700 Subject: [PATCH 3/8] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts index 8a530405b565..f2b3b5d19b24 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/docs/types/index.d.ts @@ -50,7 +50,7 @@ interface Routine { * gaxpby( x.length, 5.0, x, 1, 2.0, y, 1 ); * // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] */ - ( N: number, alpha: number, x: T, strideX: number, beta: number, y: T, strideY: number ): T; + ( N: number, alpha: number, x: T, strideX: number, beta: number, y: U, strideY: number ): U; /** * Multiplies a strided array `x` by a constant and adds the result to a strided array `y` multiplied by a constant using alternative indexing semantics. @@ -73,7 +73,7 @@ interface Routine { * gaxpby.ndarray( x.length, 5.0, x, 1, 0, 2.0, y, 1, 0 ); * // y => [ 9.0, 16.0, 23.0, 30.0, 37.0 ] */ - ndarray( N: number, alpha: number, x: T, strideX: number, offsetX: number, beta: number, y: T, strideY: number, offsetY: number ): T; + ndarray( N: number, alpha: number, x: T, strideX: number, offsetX: number, beta: number, y: U, strideY: number, offsetY: number ): U; } /** From 9eb9ae579ad5bb006b32c9183d9a184bd7f9e820 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 30 May 2026 17:20:41 -0700 Subject: [PATCH 4/8] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js index 92575520ef0a..f12bf038f8f6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/lib/ndarray.js @@ -77,7 +77,7 @@ function gaxpby( N, alpha, x, strideX, offsetX, beta, y, strideY, offsetY ) { oy = arraylike2object( y ); if ( ox.accessorProtocol || oy.accessorProtocol ) { accessors( N, alpha, ox, strideX, offsetX, beta, oy, strideY, offsetY ); - return oy.data; + return y; } ix = offsetX; iy = offsetY; From bbe60f58b8301206363ea6e4f1113d083fb8bfdb Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 30 May 2026 17:22:33 -0700 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md index 3fdb08ef6be5..95dfc29b19d0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md @@ -26,7 +26,7 @@ limitations under the License. This BLAS extension implements the operation - + ```math \mathbf{y} = \alpha \mathbf{x} + \beta \mathbf{y} @@ -34,7 +34,7 @@ This BLAS extension implements the operation -This API is complementary to the package [`@stdlib/blas/base/gaxpy`][@stdlib/blas/base/gaxpy] and is a common BLAS extension in libraries such as Intel MKL, OpenBLAS, etc. +This API is complementary to the package [`@stdlib/blas/base/gaxpy`][@stdlib/blas/base/gaxpy] and is a common BLAS extension in libraries such as Intel MKL, OpenBLAS, and others. From 07862e297507877386cec81f0080ada6a258b5e9 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 30 May 2026 17:24:49 -0700 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md index 95dfc29b19d0..44cfef89e684 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md @@ -134,8 +134,6 @@ gaxpby.ndarray( 3, 5.0, x, 1, x.length-3, 2.0, y, 1, y.length-3 ); - If `N <= 0`, both functions return `y` unchanged. - Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]). -- For performance reasons, when `alpha = 0.0`, the function delegates to [`@stdlib/blas/base/gscal`][@stdlib/blas/base/gscal] to scale `y` by `beta`. -- For performance reasons, when `beta = 1.0`, the function delegates to [`@stdlib/blas/base/gaxpy`][@stdlib/blas/base/gaxpy] to compute `y = alpha * x + y`. From 2655ba0be477d9cb01e48bb56bfce0d5e860664d Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 30 May 2026 17:25:19 -0700 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md index 44cfef89e684..b9dcb3d9cdb2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md @@ -185,10 +185,6 @@ console.log( y ); [@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor -[@stdlib/blas/base/gaxpy]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/gaxpy - -[@stdlib/blas/base/gscal]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/gscal - From f9ca969434fe3020c2af84153a10600da1120b12 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 30 May 2026 17:26:08 -0700 Subject: [PATCH 8/8] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md index b9dcb3d9cdb2..7beb5d46011d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gaxpby/README.md @@ -185,6 +185,8 @@ console.log( y ); [@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor +[@stdlib/blas/base/gaxpy]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/gaxpy +