Skip to content

Commit 840afdc

Browse files
committed
chore: update and cleanup for lib files
--- 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: 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 64cb6e5 commit 840afdc

4 files changed

Lines changed: 28 additions & 23 deletions

File tree

lib/node_modules/@stdlib/blas/base/dzasum/lib/dzasum.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -27,19 +27,19 @@ var ndarray = require( './ndarray.js' );
2727
// MAIN //
2828

2929
/**
30-
* Computes the sum of the absolute values of each element in a double-precision complex floating-point vector.
30+
* Computes the sum of the absolute values of the real and imaginary components of a double-precision complex floating-point vector.
3131
*
3232
* @param {PositiveInteger} N - number of indexed elements
33-
* @param {Complex64Array} x - input array
33+
* @param {Complex128Array} x - input array
3434
* @param {integer} strideX - `x` stride length
35-
* @returns {number} sum
35+
* @returns {number} result
3636
*
3737
* @example
3838
* var Complex128Array = require( '@stdlib/array/complex128' );
3939
*
4040
* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
4141
*
42-
* var sum = dzasum( x.length, x, 1 );
42+
* var out = dzasum( x.length, x, 1 );
4343
* // returns 19.0
4444
*/
4545
function dzasum( N, x, strideX ) {

lib/node_modules/@stdlib/blas/base/dzasum/lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* BLAS level 1 routine to compute the sum of absolute values of each element in a double-precision complex floating-point vector.
22+
* BLAS level 1 routine to compute the sum of the absolute values of the real and imaginary components of a double-precision complex floating-point vector.
2323
*
2424
* @module @stdlib/blas/base/dzasum
2525
*
@@ -29,7 +29,7 @@
2929
*
3030
* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
3131
*
32-
* var sum = dzasum( x.length, x, 1 );
32+
* var out = dzasum( x.length, x, 1 );
3333
* // returns 19.0
3434
*
3535
* @example
@@ -38,7 +38,7 @@
3838
*
3939
* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
4040
*
41-
* var sum = dzasum.ndarray( x.length, x, 1, 0 );
41+
* var out = dzasum.ndarray( x.length, x, 1, 0 );
4242
* // returns 19.0
4343
*/
4444

lib/node_modules/@stdlib/blas/base/dzasum/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

lib/node_modules/@stdlib/blas/base/dzasum/lib/ndarray.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -20,43 +20,48 @@
2020

2121
// MODULES //
2222

23-
var dcabs1 = require( '@stdlib/blas/base/dcabs1' );
23+
var abs = require( '@stdlib/math/base/special/abs' );
24+
var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' );
2425

2526

2627
// MAIN //
2728

2829
/**
29-
* Computes the sum of the absolute values of each element in a double-precision complex floating-point vector.
30+
* Computes the sum of the absolute values of the real and imaginary components of a double-precision complex floating-point vector.
3031
*
3132
* @param {PositiveInteger} N - number of indexed elements
32-
* @param {Complex64Array} x - input array
33+
* @param {Complex128Array} x - input array
3334
* @param {integer} strideX - `x` stride length
3435
* @param {NonNegativeInteger} offsetX - starting index for `x`
35-
* @returns {number} sum
36+
* @returns {number} result
3637
*
3738
* @example
3839
* var Complex128Array = require( '@stdlib/array/complex128' );
3940
*
4041
* var x = new Complex128Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
4142
*
42-
* var sum = dzasum( x.length, x, 1, 0 );
43+
* var out = dzasum( x.length, x, 1, 0 );
4344
* // returns 19.0
4445
*/
4546
function dzasum( N, x, strideX, offsetX ) {
46-
var sum;
47+
var viewX;
48+
var stemp;
4749
var ix;
50+
var sx;
4851
var i;
4952

50-
sum = 0.0;
53+
stemp = 0.0;
5154
if ( N <= 0 ) {
52-
return sum;
55+
return stemp;
5356
}
54-
ix = offsetX;
57+
viewX = reinterpret( x, 0 );
58+
sx = strideX * 2;
59+
ix = offsetX * 2;
5560
for ( i = 0; i < N; i++ ) {
56-
sum += dcabs1( x.get( ix ) );
57-
ix += strideX;
61+
stemp += abs( viewX[ ix ] ) + abs( viewX[ ix+1 ] );
62+
ix += sx;
5863
}
59-
return sum;
64+
return stemp;
6065
}
6166

6267

0 commit comments

Comments
 (0)