Conversation

ShabiShett07

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: 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 ---

Progresses: 2039

Description

What is the purpose of this pull request?

This pull request:

  • adds package blas/base/wasm/scasum

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

---
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: 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-botstdlib-bot added BLASIssue or pull request related to Basic Linear Algebra Subprograms (BLAS).Needs ReviewA pull request which needs code review.labels Mar 22, 2025
@stdlib-bot

Coverage Report

PackageStatementsBranchesFunctionsLines
blas/base/wasm/scasum$\color{green}557/557$
$\color{green}+100.00\%$
$\color{green}17/17$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}557/557$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@ShabiShett07

/stdlib update-copyright-years

@stdlib-botstdlib-bot added the bot: In ProgressPull request is currently awaiting automation.label Mar 22, 2025
@stdlib-botstdlib-bot removed the bot: In ProgressPull request is currently awaiting automation.label Mar 22, 2025
ShabiShett07 and others added 2 commits March 22, 2025 15:26
Signed-off-by: Shabareesh Shetty <[email protected]>
---
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: 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
---
@kgrytekgryte self-requested a review April 2, 2025 00:23
@kgrytekgryte added FeatureIssue or pull request for adding a new feature.WebAssemblyIssue involves or relates to WebAssembly.labels Jun 20, 2025
@kgrytekgryte added Needs ChangesPull request which needs changes before being merged.and removed Needs ReviewA pull request which needs code review.labels Jun 20, 2025
---
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: 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
---
@ShabiShett07ShabiShett07 requested a review from kgryte June 20, 2025 12:21
@stdlib-botstdlib-bot added the Needs ReviewA pull request which needs code review.label Jun 20, 2025
@kgrytekgryte removed the Needs ChangesPull request which needs changes before being merged.label Jun 21, 2025

#### scasum.Module..main( N, xp, sx )

Computes the sum of absolute values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is incomplete. See above.


#### scasum.Module..ndarray( N, xp, sx, ox )

Computes the sum of absolute values using alternative indexing semantics.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is incomplete. See above.


// Reallocate the underlying memory to allow storing one vector:
nb = bytesPerElement( options.dtype );
mod.realloc( (N*nb)+nb );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mod.realloc( (N*nb)+nb );
mod.realloc( N*nb );


// Reallocate the underlying memory to allow storing one vector:
nb = bytesPerElement( options.dtype );
mod.realloc( (N*nb)+nb );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mod.realloc( (N*nb)+nb );
mod.realloc( N*nb );

// Define a pointer (i.e., byte offset) for storing the input vector:
xptr = 0;

x = new Complex64Array( uniform( N, -10.0, 10.0, options ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x = new Complex64Array( uniform( N, -10.0, 10.0, options ) );
// Generate an array of random complex numbers:
x = new Complex64Array( uniform( N, -10.0, 10.0, options ) );

// Define a pointer (i.e., byte offset) for storing the input vector:
xptr = 0;

x = new Complex64Array( uniform( N, -10.0, 10.0, options ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x = new Complex64Array( uniform( N, -10.0, 10.0, options ) );
// Generate an array of random complex numbers:
x = new Complex64Array( uniform( N, -10.0, 10.0, options ) );

> s = {{alias}}.main( 2, x, 2 )
7.0

// Use view offset; e.g., starting at 2nd element:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Use view offset; e.g., starting at 2nd element:
// Using typed array views:

Don't go rogue. Be consistent with other packages.

7.0

// Use view offset; e.g., starting at 2nd element:
> var x0 = new {{alias:@stdlib/array/complex64}}([1.0,-2.0,3.0,-4.0,5.0,-6.0,7.0,-8.0 ]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> var x0 = new {{alias:@stdlib/array/complex64}}([1.0,-2.0,3.0,-4.0,5.0,-6.0,7.0,-8.0 ]);
> var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );

Comment on lines +44 to +45
> s = {{alias}}.main( 2, x1, 2 )
22.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> s = {{alias}}.main( 2, x1, 2 )
22.0
> s = {{alias}}.main( 2, x1, 1 )
18.0

Comment on lines +50 to +51
components of a single-precision complex floating-point vector
using alternative indexing semantics.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text wrapping is off.

> var s = {{alias}}.ndarray( x.length, x, 1, 0 )
15.0

// Using offset parameter:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Using offset parameter:
// Advanced indexing:



{{alias}}.Module..ndarray( N, xp, sx, ox )
Computes the sum of the absolute values of the real and imaginary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your text wrapping is off here. Everything should be wrapped to 80 chars. Meaning components should be moved up and everything rewrapped. Please check the other descriptions in this file.

* // Specify a vector length:
* var N = 4;
*
* // Define pointer (i.e., byte offsets) for storing two vectors:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* // Define pointer (i.e., byte offsets) for storing two vectors:
* // Define a pointer (i.e., byte offset) for storing one vector:

* // Specify a vector length:
* var N = 4;
*
* // Define pointer (i.e., byte offsets) for storing two vectors:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.

* // Specify a vector length:
* var N = 4;
*
* // Define pointer (i.e., byte offsets) for storing the input vector:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* // Define pointer (i.e., byte offsets) for storing the input vector:
* // Define a pointer (i.e., byte offset) for storing one input vector:

This and similar changes throughout this PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left an initial comments after reviewing a few files. I suggest going back through and doing a line-by-line check to ensure that everything is cleaned up.

@kgrytekgryte added Needs ChangesPull request which needs changes before being merged.and removed Needs ReviewA pull request which needs code review.labels Jun 21, 2025
Sign up for free to join this conversation on . Already have an account? Sign in to comment
BLASIssue or pull request related to Basic Linear Algebra Subprograms (BLAS).FeatureIssue or pull request for adding a new feature.Needs ChangesPull request which needs changes before being merged.Issue involves or relates to WebAssembly.
None yet

Successfully merging this pull request may close these issues.