Skip to content
Open
Show file tree
Hide file tree
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
Diff view
Next Next commit
feat: add lib
---
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: 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
---
  • Loading branch information
DivitJain26 committed May 6, 2026
commit 907f01948dfa86cc5acb193514f293a418613f41
236 changes: 236 additions & 0 deletions lib/node_modules/@stdlib/blas/base/ztpmv/lib/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' );
var muladd = require( '@stdlib/complex/float64/base/mul-add' ).assign;


// MAIN //

/**
* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` or `x = A**H*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix, supplied in packed form.
*
* @private
* @param {string} order - storage layout
* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix
* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
* @param {string} diag - specifies whether `A` has a unit diagonal
* @param {NonNegativeInteger} N - number of elements along each dimension of `A`
* @param {Complex128Array} AP - packed form of a symmetric matrix `A`
* @param {integer} strideAP - `AP` stride length
* @param {NonNegativeInteger} offsetAP - starting index for `AP`
* @param {Complex128Array} x - input vector
* @param {integer} strideX - `x` stride length
* @param {NonNegativeInteger} offsetX - starting index for `x`
* @returns {Complex128Array} `x`
*
* @example
* var Complex128Array = require( '@stdlib/array/complex128' );
*
* var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
*
* ztpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 1, 0, x, 1, 0 );
* // x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
*/
function ztpmv( order, uplo, trans, diag, N, AP, strideAP, offsetAP, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len

Check warning on line 56 in lib/node_modules/@stdlib/blas/base/ztpmv/lib/base.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Function 'ztpmv' has too many statements (139). Maximum allowed is 100
var nonunit;
var viewAP;
var viewX;
var retmp;
var imtmp;
var isrm;
var sign;
var rex;
var imx;
var rea;
var ima;
var iap;
var ix0;
var ix1;
var sap;
var kk;
var ox;
var sx;
var i1;
var i0;

// Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop...

isrm = isRowMajor( order );
nonunit = ( diag === 'non-unit' );

// Reinterpret arrays as real-valued views of interleaved real and imaginary components:
viewAP = reinterpret( AP, 0 );
viewX = reinterpret( x, 0 );
if ( trans === 'conjugate-transpose' ) {
sign = -1;
} else {
sign = 1;
}
ox = offsetX * 2;
kk = offsetAP * 2;
sx = strideX * 2;
sap = strideAP * 2;

if (
( !isrm && uplo === 'upper' && trans === 'no-transpose' ) ||
( isrm && uplo === 'lower' && trans !== 'no-transpose' )
) {
ix1 = ox;
for ( i1 = 0; i1 < N; i1++ ) {
retmp = viewX[ ix1 ];
imtmp = viewX[ ix1+1 ];
iap = kk;
ix0 = ox;
for ( i0 = 0; i0 < i1; i0++ ) {
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
rex = viewX[ ix0 ];
imx = viewX[ ix0+1 ];
muladd( rea, ima, retmp, imtmp, rex, imx, viewX, 1, ix0 );
iap += sap;
ix0 += sx;
}
if ( nonunit ) {
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
rex = viewX[ ix0 ];
imx = viewX[ ix0+1 ];
viewX[ ix0 ] = (rea*rex) - (ima*imx);
viewX[ ix0+1 ] = (rea*imx) + (ima*rex);
}
ix1 += sx;
kk += (i1+1) * sap;
}
return x;
}
if (
( !isrm && uplo === 'lower' && trans === 'no-transpose' ) ||
( isrm && uplo === 'upper' && trans !== 'no-transpose' )
) {
kk += ((N*(N+1)/2)-1) * sap;
ox += (N-1) * sx;
ix1 = ox;
for ( i1 = N - 1; i1 >= 0; i1-- ) {
retmp = viewX[ ix1 ];
imtmp = viewX[ ix1+1 ];
iap = kk;
ix0 = ox;
for ( i0 = N - 1; i0 > i1; i0-- ) {
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
rex = viewX[ ix0 ];
imx = viewX[ ix0+1 ];
muladd( rea, ima, retmp, imtmp, rex, imx, viewX, 1, ix0 );
iap -= sap;
ix0 -= sx;
}
if ( nonunit ) {
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
rex = viewX[ ix0 ];
imx = viewX[ ix0+1 ];
viewX[ ix0 ] = (rea*rex) - (ima*imx);
viewX[ ix0+1 ] = (rea*imx) + (ima*rex);
}
ix1 -= sx;
kk -= (N-i1) * sap;
}
return x;
}
if (
( !isrm && uplo === 'upper' && trans !== 'no-transpose' ) ||
( isrm && uplo === 'lower' && trans === 'no-transpose' )
) {
kk += ((N*(N+1)/2)-1) * sap;
ix1 = ox + ((N-1)*sx);
for ( i1 = N - 1; i1 >= 0; i1-- ) {
rex = viewX[ ix1 ];
imx = viewX[ ix1+1 ];
iap = kk;
ix0 = ix1;
if ( nonunit ) {
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
retmp = (rea*rex) - (ima*imx);
imtmp = (rea*imx) + (ima*rex);
} else {
retmp = rex;
imtmp = imx;
}
for ( i0 = i1 - 1; i0 >= 0; i0-- ) {
ix0 -= sx;
iap -= sap;
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
rex = viewX[ ix0 ];
imx = viewX[ ix0+1 ];
retmp += (rea*rex) - (ima*imx);
imtmp += (rea*imx) + (ima*rex);
}
viewX[ ix1 ] = retmp;
viewX[ ix1+1 ] = imtmp;
ix1 -= sx;
kk -= (i1+1) * sap;
}
return x;
}
// ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' )

Check warning on line 199 in lib/node_modules/@stdlib/blas/base/ztpmv/lib/base.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "uplo"

Check warning on line 199 in lib/node_modules/@stdlib/blas/base/ztpmv/lib/base.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "isrm"

Check warning on line 199 in lib/node_modules/@stdlib/blas/base/ztpmv/lib/base.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "uplo"

Check warning on line 199 in lib/node_modules/@stdlib/blas/base/ztpmv/lib/base.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "isrm"
ix1 = ox;
for ( i1 = 0; i1 < N; i1++ ) {
rex = viewX[ ix1 ];
imx = viewX[ ix1+1 ];
iap = kk;
ix0 = ix1;
if ( nonunit ) {
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
retmp = (rea*rex) - (ima*imx);
imtmp = (rea*imx) + (ima*rex);
} else {
retmp = rex;
imtmp = imx;
}
for ( i0 = i1+1; i0 < N; i0++ ) {
ix0 += sx;
iap += sap;
rea = viewAP[ iap ];
ima = sign * viewAP[ iap+1 ];
rex = viewX[ ix0 ];
imx = viewX[ ix0+1 ];
retmp += (rea*rex) - (ima*imx);
imtmp += (rea*imx) + (ima*rex);
}
viewX[ ix1 ] = retmp;
viewX[ ix1+1 ] = imtmp;
ix1 += sx;
kk += (N-i1) * sap;
}
return x;
}


// EXPORTS //

module.exports = ztpmv;
70 changes: 70 additions & 0 deletions lib/node_modules/@stdlib/blas/base/ztpmv/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

/**
* BLAS level 2 routine to performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` or `x = A**H*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix, supplied in packed form.
*
* @module @stdlib/blas/base/ztpmv
*
* @example
* var Complex128Array = require( '@stdlib/array/complex128' );
* var ztpmv = require( '@stdlib/blas/base/ztpmv' );
*
* var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
*
* ztpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, x, 1 );
* // x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
*
* @example
* var Complex128Array = require( '@stdlib/array/complex128' );
* var ztpmv = require( '@stdlib/blas/base/ztpmv' );
*
* var AP = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
* var x = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
*
* ztpmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 1, 0, x, 1, 0 );
* // x => <Complex128Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.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 ztpmv;
var tmp = tryRequire( join( __dirname, './native.js' ) );
if ( isError( tmp ) ) {
ztpmv = main;
} else {
ztpmv = tmp;
}


// EXPORTS //

module.exports = ztpmv;

// exports: { "ndarray": "ztpmv.ndarray" }
35 changes: 35 additions & 0 deletions lib/node_modules/@stdlib/blas/base/ztpmv/lib/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var ztpmv = require( './ztpmv.js' );
var ndarray = require( './ndarray.js' );


// MAIN //

setReadOnly( ztpmv, 'ndarray', ndarray );


// EXPORTS //

module.exports = ztpmv;
Loading
Loading