From cbead2a2512f02ba68118b9aed97ab024e84f33a Mon Sep 17 00:00:00 2001 From: gururaj1512 Date: Sat, 11 Jan 2025 12:38:17 +0000 Subject: [PATCH 01/11] feat: add blas/base/dzasum --- 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 status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - 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/base/dzasum/README.md | 205 ++++++++++++++++++ .../blas/base/dzasum/benchmark/benchmark.js | 105 +++++++++ .../dzasum/benchmark/benchmark.ndarray.js | 105 +++++++++ .../blas/base/dzasum/docs/types/index.d.ts | 96 ++++++++ .../blas/base/dzasum/docs/types/test.ts | 158 ++++++++++++++ .../blas/base/dzasum/examples/index.js | 35 +++ .../@stdlib/blas/base/dzasum/lib/dzasum.js | 53 +++++ .../@stdlib/blas/base/dzasum/lib/index.js | 68 ++++++ .../@stdlib/blas/base/dzasum/lib/main.js | 35 +++ .../@stdlib/blas/base/dzasum/lib/ndarray.js | 65 ++++++ .../@stdlib/blas/base/dzasum/package.json | 83 +++++++ .../blas/base/dzasum/test/test.dzasum.js | 129 +++++++++++ .../@stdlib/blas/base/dzasum/test/test.js | 82 +++++++ .../blas/base/dzasum/test/test.ndarray.js | 128 +++++++++++ 14 files changed, 1347 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/package.json create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/test/test.dzasum.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/README.md b/lib/node_modules/@stdlib/blas/base/dzasum/README.md new file mode 100644 index 000000000000..135590fee4f0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/README.md @@ -0,0 +1,205 @@ + + +# dzasum + +> Compute the sum of the [absolute values][@stdlib/blas/base/dcab1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector. + +
+ +dzasum is defined as + + + +```math +\|\mathbf{x}\|_1 = \sum_{i=0}^{n-1} \left( |a_i| + |b_i| \right) +``` + + + + + +
+ + + +
+ +## Usage + +```javascript +var dzasum = require( '@stdlib/blas/base/dzasum' ); +``` + +#### dzasum( N, x, stride ) + +Compute the sum of the [absolute values][@stdlib/blas/base/dcab1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector. + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + +var sum = dzasum( x.length, x, 1 ); +// returns 19.0 +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **x**: input [`Complex128Array`][complex128array]. +- **stride**: index increment. + +The `N` and `stride` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value, + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + +var sum = dzasum( 2, x, 2 ); +// returns 7.0 +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); + +// Initial array... +var x0 = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); + +// Create an offset view... +var x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Sum every other value... +var sum = dzasum( 2, x1, 2 ); +// returns 22.0 +``` + +If `N` is less than or equal to `0`, the function returns `0`. + +#### dzasum.ndarray( N, x, stride, offset ) + +Compute the sum of the [absolute values][@stdlib/blas/base/dcab1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector using alternative indexing semantics. + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + +var sum = dzasum.ndarray( x.length, x, 1, 0 ); +// returns 19.0 +``` + +The function has the following additional parameters: + +- **offset**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements, + +```javascript +var Complex128Array = require( '@stdlib/array/complex128' ); + +var x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); + +var sum = dzasum.ndarray( 3, x, 1, x.length-3 ); +// returns 33.0 + +// Using a negative stride to sum from the last element: +sum = dzasum.ndarray( 3, x, -1, x.length-1 ); +// returns 33.0 +``` + +
+ + + +
+ +## Notes + +- If `N <= 0`, the sum is `0`. +- `dzasum()` corresponds to the [BLAS][blas] level 1 function dzasum. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var dzasum = require( '@stdlib/blas/base/dzasum' ); + +function rand() { + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +// Generate random input arrays: +var x = filledarrayBy( 10, 'complex128', rand ); +console.log( x.toString() ); + +var out = dzasum( x.length, x, 1 ); +console.log( out ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js new file mode 100644 index 000000000000..8cee6bfd8a5c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 Complex128Array = require( '@stdlib/array/complex128' ); +var pkg = require( './../package.json' ).name; +var dzasum = require( './../lib/dzasum.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x; + + x = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dzasum( x.length, x, 1 ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + 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( pkg+':len='+len, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..5fd95fe79ec7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 Complex128Array = require( '@stdlib/array/complex128' ); +var pkg = require( './../package.json' ).name; +var dzasum = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x; + + x = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dzasum( x.length, x, 1, 0 ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + 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( pkg+':ndarray:len='+len, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts new file mode 100644 index 000000000000..af30dd68a8ca --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts @@ -0,0 +1,96 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 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 { Complex128Array } from '@stdlib/types/array'; + +/** +* Interface describing `dzasum`. +*/ +interface Routine { + /** + * Compute the sum of the absolute values of each element in a double-precision complex floating-point vector. + * + * @param N - number of indexed elements + * @param x - input array + * @param stride - stride length + * @returns sum of absolute values + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + * + * var sum = dzasum( x.length, x, 1 ); + * // returns 19.0 + */ + ( N: number, x: Complex128Array, stride: number ): number; + + /** + * Computes the sum of the absolute values using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param x - input array + * @param stride - stride length + * @param offset - starting index + * @returns sum of absolute values + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + * + * var z = dzasum.ndarray( x.length, x, 1, 0 ); + * // returns 19.0 + */ + ndarray( N: number, x: Complex128Array, stride: number, offset: number ): number; +} + +/** +* Compute the sum of the absolute values of each element in a double-precision complex floating-point vector. +* +* @param N - number of indexed elements +* @param x - input array +* @param stride - stride length +* @returns sum of absolute values +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var sum = dzasum( x.length, x, 1 ); +* // returns 19.0 +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var z = dzasum.ndarray( x.length, x, 1, 0 ); +* // returns 19.0 +*/ +declare var dzasum: Routine; + + +// EXPORTS // + +export = dzasum; diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts new file mode 100644 index 000000000000..98c9680adc1d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts @@ -0,0 +1,158 @@ +/* +* @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. +*/ + +import Complex128Array = require( '@stdlib/array/complex128' ); +import dzasum = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const x = new Complex128Array( 10 ); + + dzasum( x.length, x, 1 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x = new Complex128Array( 10 ); + + dzasum( '10', x, 1 ); // $ExpectError + dzasum( true, x, 1 ); // $ExpectError + dzasum( false, x, 1 ); // $ExpectError + dzasum( null, x, 1 ); // $ExpectError + dzasum( undefined, x, 1 ); // $ExpectError + dzasum( [], x, 1 ); // $ExpectError + dzasum( {}, x, 1 ); // $ExpectError + dzasum( ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Complex128Array... +{ + const x = new Complex128Array( 10 ); + + dzasum( x.length, 10, 1 ); // $ExpectError + dzasum( x.length, '10', 1 ); // $ExpectError + dzasum( x.length, true, 1 ); // $ExpectError + dzasum( x.length, false, 1 ); // $ExpectError + dzasum( x.length, null, 1 ); // $ExpectError + dzasum( x.length, undefined, 1 ); // $ExpectError + dzasum( x.length, [], 1 ); // $ExpectError + dzasum( x.length, {}, 1 ); // $ExpectError + dzasum( x.length, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x = new Complex128Array( 10 ); + + dzasum( x.length, x, '10' ); // $ExpectError + dzasum( x.length, x, true ); // $ExpectError + dzasum( x.length, x, false ); // $ExpectError + dzasum( x.length, x, null ); // $ExpectError + dzasum( x.length, x, undefined ); // $ExpectError + dzasum( x.length, x, [] ); // $ExpectError + dzasum( x.length, x, {} ); // $ExpectError + dzasum( x.length, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Complex128Array( 10 ); + + dzasum(); // $ExpectError + dzasum( x.length ); // $ExpectError + dzasum( x.length, x ); // $ExpectError + dzasum( x.length, x, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a number... +{ + const x = new Complex128Array( 10 ); + + dzasum.ndarray( x.length, x, 1, 0 ); // $ExpectType number +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x = new Complex128Array( 10 ); + + dzasum.ndarray( '10', x, 1, 0 ); // $ExpectError + dzasum.ndarray( true, x, 1, 0 ); // $ExpectError + dzasum.ndarray( false, x, 1, 0 ); // $ExpectError + dzasum.ndarray( null, x, 1, 0 ); // $ExpectError + dzasum.ndarray( undefined, x, 1, 0 ); // $ExpectError + dzasum.ndarray( [], x, 1, 0 ); // $ExpectError + dzasum.ndarray( {}, x, 1, 0 ); // $ExpectError + dzasum.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Complex128Array... +{ + const x = new Complex128Array( 10 ); + + dzasum.ndarray( x.length, 10, 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, '10', 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, true, 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, false, 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, null, 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, [], 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, {}, 1, 0 ); // $ExpectError + dzasum.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const x = new Complex128Array( 10 ); + + dzasum.ndarray( x.length, x, '10', 0 ); // $ExpectError + dzasum.ndarray( x.length, x, true, 0 ); // $ExpectError + dzasum.ndarray( x.length, x, false, 0 ); // $ExpectError + dzasum.ndarray( x.length, x, null, 0 ); // $ExpectError + dzasum.ndarray( x.length, x, undefined, 0 ); // $ExpectError + dzasum.ndarray( x.length, x, [], 0 ); // $ExpectError + dzasum.ndarray( x.length, x, {}, 0 ); // $ExpectError + dzasum.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x = new Complex128Array( 10 ); + + dzasum.ndarray( x.length, x, 1, '10' ); // $ExpectError + dzasum.ndarray( x.length, x, 1, true ); // $ExpectError + dzasum.ndarray( x.length, x, 1, false ); // $ExpectError + dzasum.ndarray( x.length, x, 1, null ); // $ExpectError + dzasum.ndarray( x.length, x, 1, undefined ); // $ExpectError + dzasum.ndarray( x.length, x, 1, [] ); // $ExpectError + dzasum.ndarray( x.length, x, 1, {} ); // $ExpectError + dzasum.ndarray( x.length, x, 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 Complex128Array( 10 ); + + dzasum.ndarray(); // $ExpectError + dzasum.ndarray( x.length ); // $ExpectError + dzasum.ndarray( x.length, x ); // $ExpectError + dzasum.ndarray( x.length, x, 1 ); // $ExpectError + dzasum.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js b/lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js new file mode 100644 index 000000000000..55e808dac0f2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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/base/discrete-uniform' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var dzasum = require( '@stdlib/blas/base/dzasum' ); + +function rand() { + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +// Generate random input arrays: +var x = filledarrayBy( 10, 'complex128', rand ); +console.log( x.toString() ); + +var out = dzasum( x.length, x, 1 ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js b/lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js new file mode 100644 index 000000000000..f7be49fde4ce --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 // + +/** +* Computes the sum of the absolute values of each element in a double-precision complex floating-point vector. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} stride - `x` stride length +* @returns {number} sum +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var sum = dzasum( x.length, x, 1 ); +* // returns 19.0 +*/ +function dzasum( N, x, stride ) { + var ox = stride2offset( N, stride ); + return ndarray( N, x, stride, ox ); +} + + +// EXPORTS // + +module.exports = dzasum; diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/lib/index.js b/lib/node_modules/@stdlib/blas/base/dzasum/lib/index.js new file mode 100644 index 000000000000..44a78a24abea --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/lib/index.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 1 routine to compute the sum of absolute values of each element in a double-precision complex floating-point vector. +* +* @module @stdlib/blas/base/dzasum +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var dzasum = require( '@stdlib/blas/base/dzasum' ); +* +* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var sum = dzasum( x.length, x, 1 ); +* // returns 19.0 +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var dzasum = require( '@stdlib/blas/base/dzasum' ); +* +* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var sum = dzasum.ndarray( x.length, x, 1, 0 ); +* // returns 19.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 dzasum; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dzasum = main; +} else { + dzasum = tmp; +} + + +// EXPORTS // + +module.exports = dzasum; + +// exports: { "ndarray": "dzasum.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/lib/main.js b/lib/node_modules/@stdlib/blas/base/dzasum/lib/main.js new file mode 100644 index 000000000000..02691681c914 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 dzasum = require( './dzasum.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dzasum, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dzasum; diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js new file mode 100644 index 000000000000..e59053675ede --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js @@ -0,0 +1,65 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 dcabs1 = require( '@stdlib/blas/base/dcabs1' ); + + +// MAIN // + +/** +* Computes the sum of the absolute values of each element in a double-precision complex floating-point vector. +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} x - input array +* @param {integer} stride - `x` stride length +* @param {NonNegativeInteger} offset - starting index for `x` +* @returns {number} sum +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var sum = dzasum( x.length, x, 1, 0 ); +* // returns 19.0 +*/ +function dzasum( N, x, stride, offset ) { + var sum; + var ix; + var i; + + sum = 0.0; + if ( N <= 0 ) { + return sum; + } + ix = offset; + for ( i = 0; i < N; i++ ) { + sum += dcabs1( x.get( ix ) ); + ix += stride; + } + return sum; +} + + +// EXPORTS // + +module.exports = dzasum; diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/package.json b/lib/node_modules/@stdlib/blas/base/dzasum/package.json new file mode 100644 index 000000000000..693df0d5e522 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/package.json @@ -0,0 +1,83 @@ +{ + "name": "@stdlib/blas/base/dzasum", + "version": "0.0.0", + "description": "Compute the sum of the absolute values of each element in a double-precision complex floating-point vector.", + "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", + "browser": "./lib/main.js", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "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", + "level 1", + "linear", + "algebra", + "subroutines", + "dcabs1", + "absolute", + "value", + "sum", + "l1norm", + "norm", + "taxicab", + "manhattan", + "vector", + "array", + "ndarray", + "double", + "complex128", + "complex128array" + ], + "__stdlib__": { + "wasm": false + } +} diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/test/test.dzasum.js b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.dzasum.js new file mode 100644 index 000000000000..181c7a728d82 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.dzasum.js @@ -0,0 +1,129 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 Complex128Array = require( '@stdlib/array/complex128' ); +var dzasum = require( './../lib/dzasum.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzasum, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( dzasum.length, 3, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the sum of absolute values', function test( t ) { + var x; + var y; + + x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + y = dzasum( x.length, x, 1 ); + + t.strictEqual( y, 21.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` stride', function test( t ) { + var x; + var y; + var N; + + x = new Complex128Array([ + 1.0, // 1 + -2.0, // 1 + 3.0, + -4.0, + 5.0, // 2 + -6.0 // 2 + ]); + N = 2; + + y = dzasum( N, x, 2 ); + + t.strictEqual( y, 14.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0`', function test( t ) { + var x; + var y; + + x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + y = dzasum( 0, x, 1 ); + + t.strictEqual( y, 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var x; + var y; + var N; + + x = new Complex128Array([ + 1.0, // 2 + -2.0, // 2 + 3.0, + -4.0, + 5.0, // 1 + -6.0 // 1 + ]); + N = 2; + + y = dzasum( N, x, -2 ); + + t.strictEqual( y, 14.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var x0; + var x1; + var y; + var N; + + // Initial array... + x0 = new Complex128Array([ + 1.0, + -2.0, + 3.0, // 1 + -4.0, // 1 + 5.0, // 2 + -6.0 // 2 + ]); + + // Create an offset view... + x1 = new Complex128Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // begin at 2nd element + + N = 2; + y = dzasum( N, x1, 1 ); + + t.strictEqual( y, 18.0, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/test/test.js b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.js new file mode 100644 index 000000000000..c7c4ac04005a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var dzasum = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzasum, '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 dzasum.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var dzasum = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dzasum, mock, 'returns expected value' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var dzasum; + var main; + + main = require( './../lib/dzasum.js' ); + + dzasum = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dzasum, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js new file mode 100644 index 000000000000..e94b718f7c75 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js @@ -0,0 +1,128 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 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 Complex128Array = require( '@stdlib/array/complex128' ); +var dzasum = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dzasum, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( dzasum.length, 4, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the sum of absolute values', function test( t ) { + var x; + var y; + + x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + y = dzasum( x.length, x, 1, 0 ); + + t.strictEqual( y, 21.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` stride', function test( t ) { + var x; + var y; + var N; + + x = new Complex128Array([ + 1.0, // 1 + -2.0, // 1 + 3.0, + -4.0, + 5.0, // 2 + -6.0 // 2 + ]); + N = 2; + + y = dzasum( N, x, 2, 0 ); + + t.strictEqual( y, 14.0, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports an `x` offset', function test( t ) { + var x; + var y; + var N; + + x = new Complex128Array([ + 1.0, + -2.0, + 3.0, // 1 + -4.0, // 1 + 5.0, // 2 + -6.0 // 2 + ]); + N = 2; + + y = dzasum( N, x, 1, 1 ); + + t.strictEqual( y, 18.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0`', function test( t ) { + var x; + var y; + + x = new Complex128Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + + y = dzasum( -1, x, 1, 0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = dzasum( 0, x, 1, 0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var x; + var y; + var N; + + x = new Complex128Array([ + 1.0, // 2 + -2.0, // 2 + 3.0, + -4.0, + 5.0, // 1 + -6.0 // 1 + ]); + N = 2; + + y = dzasum( N, x, -2, x.length-1 ); + + t.strictEqual( y, 14.0, 'returns expected value' ); + t.end(); +}); From 9ef0e0ed5c5192719643710584ccb9e9346fcc8e Mon Sep 17 00:00:00 2001 From: gururaj1512 Date: Sat, 11 Jan 2025 12:45:54 +0000 Subject: [PATCH 02/11] add repl.txt --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/blas/base/dzasum/docs/repl.txt | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt new file mode 100644 index 000000000000..d7a062f681a6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt @@ -0,0 +1,90 @@ + +{{alias}}( N, x, stride ) + Compute the sum of the absolute values of each element in a + double-precision complex floating-point vector + + The `N` and `stride` parameters determine which elements in `x` are used + to compute the sum. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N` is less than or equal to `0`, the function returns `0`. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Complex128Array + Input array. + + stride: integer + Index increment. + + Returns + ------- + sum: number + Sum of absolute values. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex128}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var s = {{alias}}( x.length, x, 1 ) + 15.0 + + // Sum every other value: + > s = {{alias}}( 2, x, 2 ) + 7.0 + + // Use view offset; e.g., starting at 2nd element: + > var x0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > s = {{alias}}( 2, x1, 2 ) + 22.0 + + +{{alias}}.ndarray( N, x, stride, offset ) + Compute the sum of the absolute values of each element in a + double-precision complex floating-point vector using alternative indexing + semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the `offset` parameter supports indexing semantics based on a + starting index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + x: Complex128Array + Input array. + + stride: integer + Index increment. + + offset: integer + Starting index. + + Returns + ------- + sum: number + Sum of absolute values. + + Examples + -------- + // Standard usage: + > var x = new {{alias:@stdlib/array/complex128}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + > var s = {{alias}}.ndarray( x.length, x, 1, 0 ) + 19.0 + + // Sum the last three elements: + > x = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); + > s = {{alias}}.ndarray( 3, x, -1, x.length-1 ) + 33.0 + + See Also + -------- + From cb2094fdfd56f44d88cd91125e4f87a57ec64c70 Mon Sep 17 00:00:00 2001 From: gururaj1512 Date: Sat, 11 Jan 2025 12:56:41 +0000 Subject: [PATCH 03/11] fix: copyright years --- 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 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: na - task: lint_javascript_tests status: passed - 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: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts | 2 +- lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts index 98c9680adc1d..16f905048756 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js index e94b718f7c75..ac1ca0fa4b91 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dzasum/test/test.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* Copyright (c) 2025 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. From 114b390533cd208b1da508bf571461c2e62ff958 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 7 Jul 2025 13:30:36 +0530 Subject: [PATCH 04/11] bench: update variable naming --- 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 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: na - task: lint_javascript_tests status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/dzasum/benchmark/benchmark.js | 14 +++++++------- .../base/dzasum/benchmark/benchmark.ndarray.js | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js index 8cee6bfd8a5c..14a79ecdb1d7 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.js @@ -42,13 +42,13 @@ var options = { * Creates a benchmark function. * * @private -* @param {PositiveInteger} len - array length +* @param {PositiveInteger} N - array length * @returns {Function} benchmark function */ -function createBenchmark( len ) { +function createBenchmark( N ) { var x; - x = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) ); + x = new Complex128Array( uniform( N*2, -100.0, 100.0, options ) ); return benchmark; /** @@ -86,9 +86,9 @@ function createBenchmark( len ) { * @private */ function main() { - var len; var min; var max; + var N; var f; var i; @@ -96,9 +96,9 @@ function main() { max = 6; // 10^max for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + N = pow( 10, i ); + f = createBenchmark( N ); + bench( pkg+':size='+N, f ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js index 5fd95fe79ec7..ad9098469294 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dzasum/benchmark/benchmark.ndarray.js @@ -42,13 +42,13 @@ var options = { * Creates a benchmark function. * * @private -* @param {PositiveInteger} len - array length +* @param {PositiveInteger} N - array length * @returns {Function} benchmark function */ -function createBenchmark( len ) { +function createBenchmark( N ) { var x; - x = new Complex128Array( uniform( len*2, -100.0, 100.0, options ) ); + x = new Complex128Array( uniform( N*2, -100.0, 100.0, options ) ); return benchmark; /** @@ -86,9 +86,9 @@ function createBenchmark( len ) { * @private */ function main() { - var len; var min; var max; + var N; var f; var i; @@ -96,9 +96,9 @@ function main() { max = 6; // 10^max for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':ndarray:len='+len, f ); + N = pow( 10, i ); + f = createBenchmark( N ); + bench( pkg+':ndarray:size='+N, f ); } } From 9860165c3da0399af4bc2c54d939892f0df3f2fe Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 7 Jul 2025 13:45:06 +0530 Subject: [PATCH 05/11] docs: update variable naming and jsdoc --- 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 status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - 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 --- --- .../@stdlib/blas/base/dzasum/docs/repl.txt | 41 ++++++++++--------- .../blas/base/dzasum/docs/types/index.d.ts | 10 ++--- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt index d7a062f681a6..1f38f8eba558 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dzasum/docs/repl.txt @@ -1,9 +1,9 @@ -{{alias}}( N, x, stride ) - Compute the sum of the absolute values of each element in a - double-precision complex floating-point vector +{{alias}}( N, x, strideX ) + Computes the sum of the absolute values of each element in a + double-precision complex floating-point vector. - The `N` and `stride` parameters determine which elements in `x` are used + The `N` and `strideX` parameters determine which elements in `x` are used to compute the sum. Indexing is relative to the first index. To introduce an offset, use typed @@ -19,7 +19,7 @@ x: Complex128Array Input array. - stride: integer + strideX: integer Index increment. Returns @@ -30,28 +30,29 @@ Examples -------- // Standard usage: - > var x = new {{alias:@stdlib/array/complex128}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var x = new {{alias:@stdlib/array/complex128}}( [ -2.0, 1.0, 3.0, -5.0 ]); > var s = {{alias}}( x.length, x, 1 ) - 15.0 + 11.0 - // Sum every other value: + // Advanced indexing: + > var x = new {{alias:@stdlib/array/complex128}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); > s = {{alias}}( 2, x, 2 ) 7.0 - // Use view offset; e.g., starting at 2nd element: - > var x0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); + // Using typed array views: + > var x0 = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); > var x1 = new {{alias:@stdlib/array/complex128}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - > s = {{alias}}( 2, x1, 2 ) - 22.0 + > s = {{alias}}( 2, x1, 1 ) + 18.0 -{{alias}}.ndarray( N, x, stride, offset ) - Compute the sum of the absolute values of each element in a +{{alias}}.ndarray( N, x, strideX, offsetX ) + Computes the sum of the absolute values of each element in a double-precision complex floating-point vector using alternative indexing semantics. While typed array views mandate a view offset based on the underlying - buffer, the `offset` parameter supports indexing semantics based on a + buffer, the `offsetX` parameter supports indexing semantics based on a starting index. Parameters @@ -62,10 +63,10 @@ x: Complex128Array Input array. - stride: integer + strideX: integer Index increment. - offset: integer + offsetX: integer Starting index. Returns @@ -76,11 +77,11 @@ Examples -------- // Standard usage: - > var x = new {{alias:@stdlib/array/complex128}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + > var x = new {{alias:@stdlib/array/complex128}}( [ -2.0, 1.0, 3.0, -5.0 ] ); > var s = {{alias}}.ndarray( x.length, x, 1, 0 ) - 19.0 + 11.0 - // Sum the last three elements: + // Advanced indexing: > x = new {{alias:@stdlib/array/complex128}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); > s = {{alias}}.ndarray( 3, x, -1, x.length-1 ) 33.0 diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts index af30dd68a8ca..f5679e6c8f85 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dzasum/docs/types/index.d.ts @@ -27,7 +27,7 @@ import { Complex128Array } from '@stdlib/types/array'; */ interface Routine { /** - * Compute the sum of the absolute values of each element in a double-precision complex floating-point vector. + * Computes the sum of the absolute values of each element in a double-precision complex floating-point vector. * * @param N - number of indexed elements * @param x - input array @@ -45,12 +45,12 @@ interface Routine { ( N: number, x: Complex128Array, stride: number ): number; /** - * Computes the sum of the absolute values using alternative indexing semantics. + * Computes the sum of the absolute values of each element in a double-precision complex floating-point vector using alternative indexing semantics. * * @param N - number of indexed elements * @param x - input array * @param stride - stride length - * @param offset - starting index + * @param offsetX - starting index * @returns sum of absolute values * * @example @@ -61,11 +61,11 @@ interface Routine { * var z = dzasum.ndarray( x.length, x, 1, 0 ); * // returns 19.0 */ - ndarray( N: number, x: Complex128Array, stride: number, offset: number ): number; + ndarray( N: number, x: Complex128Array, stride: number, offsetX: number ): number; } /** -* Compute the sum of the absolute values of each element in a double-precision complex floating-point vector. +* Computes the sum of the absolute values of each element in a double-precision complex floating-point vector. * * @param N - number of indexed elements * @param x - input array From 10ba7b3e895e9b6a4f1f715675e3c467d8a4f048 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 7 Jul 2025 13:49:50 +0530 Subject: [PATCH 06/11] chore: add ndarray 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 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dzasum/examples/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js b/lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js index 55e808dac0f2..2f0a93e5c503 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dzasum/examples/index.js @@ -21,7 +21,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var Complex128 = require( '@stdlib/complex/float64/ctor' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); -var dzasum = require( '@stdlib/blas/base/dzasum' ); +var dzasum = require( './../lib' ); function rand() { return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); @@ -31,5 +31,10 @@ function rand() { var x = filledarrayBy( 10, 'complex128', rand ); console.log( x.toString() ); +// Compute the sum of the absolute values of each element: var out = dzasum( x.length, x, 1 ); console.log( out ); + +// Compute the sum of the absolute values of each element using alternative indexing semantics: +out = dzasum.ndarray( x.length, x, 1, 0 ); +console.log( out ); From 2a604f9fc2a8dee4721a8481a6109a978f260f51 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 7 Jul 2025 13:51:30 +0530 Subject: [PATCH 07/11] docs: update jsdoc and variable naming --- 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 status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dzasum/lib/dzasum.js | 8 ++++---- .../@stdlib/blas/base/dzasum/lib/ndarray.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js b/lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js index f7be49fde4ce..bcfea6022966 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js +++ b/lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js @@ -31,7 +31,7 @@ var ndarray = require( './ndarray.js' ); * * @param {PositiveInteger} N - number of indexed elements * @param {Complex64Array} x - input array -* @param {integer} stride - `x` stride length +* @param {integer} strideX - `x` stride length * @returns {number} sum * * @example @@ -42,9 +42,9 @@ var ndarray = require( './ndarray.js' ); * var sum = dzasum( x.length, x, 1 ); * // returns 19.0 */ -function dzasum( N, x, stride ) { - var ox = stride2offset( N, stride ); - return ndarray( N, x, stride, ox ); +function dzasum( N, x, strideX ) { + var ox = stride2offset( N, strideX ); + return ndarray( N, x, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js index e59053675ede..864d39527722 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js @@ -30,8 +30,8 @@ var dcabs1 = require( '@stdlib/blas/base/dcabs1' ); * * @param {PositiveInteger} N - number of indexed elements * @param {Complex64Array} x - input array -* @param {integer} stride - `x` stride length -* @param {NonNegativeInteger} offset - starting index for `x` +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` * @returns {number} sum * * @example @@ -42,7 +42,7 @@ var dcabs1 = require( '@stdlib/blas/base/dcabs1' ); * var sum = dzasum( x.length, x, 1, 0 ); * // returns 19.0 */ -function dzasum( N, x, stride, offset ) { +function dzasum( N, x, strideX, offsetX ) { var sum; var ix; var i; @@ -51,10 +51,10 @@ function dzasum( N, x, stride, offset ) { if ( N <= 0 ) { return sum; } - ix = offset; + ix = offsetX; for ( i = 0; i < N; i++ ) { sum += dcabs1( x.get( ix ) ); - ix += stride; + ix += strideX; } return sum; } From 5a3cb83683f43a897482ab0c17a54d08cc6dafe6 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 7 Jul 2025 13:56:16 +0530 Subject: [PATCH 08/11] chore: update markdown --- 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 status: passed - 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dzasum/README.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/README.md b/lib/node_modules/@stdlib/blas/base/dzasum/README.md index 135590fee4f0..4f8d84cda15c 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/dzasum/README.md @@ -20,7 +20,7 @@ limitations under the License. # dzasum -> Compute the sum of the [absolute values][@stdlib/blas/base/dcab1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector. +> Computes the sum of the [absolute values][@stdlib/blas/base/dcabs1] of each element.
@@ -51,9 +51,9 @@ dzasum is defined as var dzasum = require( '@stdlib/blas/base/dzasum' ); ``` -#### dzasum( N, x, stride ) +#### dzasum( N, x, strideX ) -Compute the sum of the [absolute values][@stdlib/blas/base/dcab1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector. +Compute the sum of the [absolute values][@stdlib/blas/base/dcabs1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector. ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); @@ -68,9 +68,9 @@ The function has the following parameters: - **N**: number of indexed elements. - **x**: input [`Complex128Array`][complex128array]. -- **stride**: index increment. +- **strideX**: stride length for `x`. -The `N` and `stride` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value, +The `N` and `strideX` parameters determine which elements in `x` are used to compute the sum. For example, to sum every other value, ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); @@ -97,11 +97,9 @@ var sum = dzasum( 2, x1, 2 ); // returns 22.0 ``` -If `N` is less than or equal to `0`, the function returns `0`. +#### dzasum.ndarray( N, x, strideX, offsetX ) -#### dzasum.ndarray( N, x, stride, offset ) - -Compute the sum of the [absolute values][@stdlib/blas/base/dcab1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector using alternative indexing semantics. +Compute the sum of the [absolute values][@stdlib/blas/base/dcabs1] of each element in a double-precision [complex][@stdlib/complex/float64/ctor] floating-point vector using alternative indexing semantics. ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); @@ -114,9 +112,9 @@ var sum = dzasum.ndarray( x.length, x, 1, 0 ); The function has the following additional parameters: -- **offset**: starting index. +- **offsetX**: starting index. -While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements, +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offsetX` parameter supports indexing semantics based on a starting index. For example, to sum the last three elements, ```javascript var Complex128Array = require( '@stdlib/array/complex128' ); @@ -140,7 +138,7 @@ sum = dzasum.ndarray( 3, x, -1, x.length-1 ); ## Notes - If `N <= 0`, the sum is `0`. -- `dzasum()` corresponds to the [BLAS][blas] level 1 function dzasum. +- `dzasum()` corresponds to the [BLAS][blas] level 1 function [`dzasum`][blas-dzasum].
@@ -190,7 +188,9 @@ console.log( out ); [mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray -[@stdlib/blas/base/dcab1]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/dcab1 +[blas-dzasum]: https://www.netlib.org/lapack/explore-html-3.6.1/de/da4/group__double__blas__level1_ga60d5c8001b317c929778670a15013eb4.html + +[@stdlib/blas/base/dcabs1]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/dcabs1 [complex128array]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex128 From 88559fbdb434613492ce0a804846f68c89fecc07 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 7 Jul 2025 14:02:46 +0530 Subject: [PATCH 09/11] fix: linting in package.json --- 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 status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dzasum/package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/package.json b/lib/node_modules/@stdlib/blas/base/dzasum/package.json index 693df0d5e522..3294b7b49a19 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/package.json +++ b/lib/node_modules/@stdlib/blas/base/dzasum/package.json @@ -14,15 +14,11 @@ } ], "main": "./lib", - "browser": "./lib/main.js", - "gypfile": true, "directories": { "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", - "include": "./include", "lib": "./lib", - "src": "./src", "test": "./test" }, "types": "./docs/types", From 1a3dc71856620b75646ab84fff88f2a073e3de9a Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Mon, 7 Jul 2025 17:59:31 +0530 Subject: [PATCH 10/11] chore: update markdown example Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dzasum/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/README.md b/lib/node_modules/@stdlib/blas/base/dzasum/README.md index 4f8d84cda15c..cab604cc7933 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/dzasum/README.md @@ -157,15 +157,20 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var dzasum = require( '@stdlib/blas/base/dzasum' ); function rand() { - return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } // Generate random input arrays: var x = filledarrayBy( 10, 'complex128', rand ); console.log( x.toString() ); +// Compute the sum of the absolute values of each element: var out = dzasum( x.length, x, 1 ); console.log( out ); + +// Compute the sum of the absolute values of each element using alternative indexing semantics: +out = dzasum.ndarray( x.length, x, 1, 0 ); +console.log( out ); ``` From f4c25fecb4a36a7e35ce6da94590e44b41e1219a Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Tue, 8 Jul 2025 21:46:05 +0530 Subject: [PATCH 11/11] chore: convert tabs to spaces --- 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 status: passed - 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: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dzasum/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dzasum/README.md b/lib/node_modules/@stdlib/blas/base/dzasum/README.md index cab604cc7933..8665ab73f8f8 100644 --- a/lib/node_modules/@stdlib/blas/base/dzasum/README.md +++ b/lib/node_modules/@stdlib/blas/base/dzasum/README.md @@ -157,7 +157,7 @@ var filledarrayBy = require( '@stdlib/array/filled-by' ); var dzasum = require( '@stdlib/blas/base/dzasum' ); function rand() { - return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } // Generate random input arrays: