8000 feat: add `lapack/base/dlacn2` by aayush0325 · Pull Request #7438 · stdlib-js/stdlib · GitHub
[go: up one dir, main page]

Skip to content

feat: add lapack/base/dlacn2 #7438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
10000
Diff view
Prev Previous commit
Next Next commit
test: add test for N = 1
---
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: na
  - task: lint_license_headers
    status: passed
---
  • Loading branch information
aayush0325 committed Jun 22, 2025
commit 966060001c3a80e916b313c23003ff1839e6549c
56 changes: 56 additions & 0 deletions lib/node_modules/@stdlib/lapack/base/dlacn2/test/test.dlacn2.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,62 @@ tape( 'the function has an arity of 7', function test( t ) {
t.end();
});

tape( 'the function returns expected values when calculating the one-norm of a square matrix for N = 1', function test( t ) {
var expectedISAVE;
var expectedKASE;
var expectedISGN;
var expectedEST;
var expectedV;
var ISAVE;
var KASE;
var ISGN;
var work;
var EST;
var X;
var V;
var A;

A = new Float64Array( [ -25.0 ] );

KASE = new Int32Array( 1 );
EST = new Float64Array( 1 );
ISGN = new Int32Array( 1 );
ISAVE = new Int32Array( 3 );
X = new Float64Array( 1 );
V = new Float64Array( 1 );

work = new Float64Array( 1 );

while ( true ) {
dlacn2( 1, V, X, ISGN, EST, KASE, ISAVE );

if ( KASE[ 0 ] === 0 ) {
break;
}
else if ( KASE[ 0 ] === 1 ) {
dgemv( 'row-major', 'no-transpose', 1, 1, 1.0, A, 1, X, 1, 0, work, 1 );
dcopy( 1, work, 1, X, 1 );
} else if ( KASE[ 0 ] === 2 ) {
dgemv( 'row-major', 'transpose', 1, 1, 1.0, A, 1, X, 1, 0, work, 1 );
dcopy( 1, work, 1, X, 1 );
}
}

expectedEST = new Float64Array( [ 25.0 ] );
expectedV = new Float64Array( [ -25.0 ] );
expectedKASE = new Int32Array( [ 0 ] );
expectedISGN = new Int32Array( [ 0 ] );
expectedISAVE = new Int32Array( [ 1, 0, 0 ] );

t.deepEqual( KASE, expectedKASE, 'returns expected value' );
t.deepEqual( ISGN, expectedISGN, 'returns expected value' );
t.deepEqual( EST, expectedEST, 'returns expected value' );
t.deepEqual( V, expectedV, 'returns expected value' );
t.deepEqual( ISAVE, expectedISAVE, 'returns expected value' );

t.end();
});

tape( 'the function returns expected values when calculating the one-norm of a square matrix', function test( t ) {
var expectedISAVE;
var expectedKASE;
Expand Down
0