Skip to content

Commit 8171fe9

Browse files
committed
feat: add exports
--- 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 ---
1 parent 78cd7b1 commit 8171fe9

File tree

5 files changed

+335
-2
lines changed

5 files changed

+335
-2
lines changed

lib/node_modules/@stdlib/lapack/base/dlaqr5/lib/base.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function shuffleShifts( nshifts, SR, strideSR, offsetSR, SI, strideSI, offsetSI
8989
/**
9090
* Performs a single, small shift multiline QR sweep.
9191
*
92+
* @private
9293
* @param {boolean} wantT - boolean value indicating whether the quasi triangular Schur factor is being computed
9394
* @param {boolean} wantZ - boolean value indicating whether the orthogonal Schur factor is being computed
9495
* @param {integer} kacc22 - integer value ranging from 0 to 2 (inclusive), specifies the computation mode for far-from-diagonal updates
@@ -132,6 +133,7 @@ function shuffleShifts( nshifts, SR, strideSR, offsetSR, SI, strideSI, offsetSI
132133
* @param {NonNegativeInteger} offsetWV - starting index of `WV`
133134
* @returns {void}
134135
*
136+
* @example
135137
* var Float64Array = require( '@stdlib/array/float64' );
136138
*
137139
* var H = new Float64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ] );
@@ -144,8 +146,8 @@ function shuffleShifts( nshifts, SR, strideSR, offsetSR, SI, strideSI, offsetSI
144146
* var SI = new Float64Array( [ 0.0, 0.0 ] );
145147
*
146148
* dlaqr5( true, true, 0, 4, 1, 4, 2, SR, 1, 0, SI, 1, 0, H, 4, 1, 0, 1, 4, Z, 4, 1, 0, V, 2, 1, 0, U, 2, 1, 0, 4, WH, 4, 1, 0, 4, WV, 4, 1, 0 );
147-
* H => <Float64Array>[ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ]
148-
* Z => <Float64Array>[ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]
149+
* // H => <Float64Array>[ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ]
150+
* // Z => <Float64Array>[ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]
149151
*/
150152
function dlaqr5( wantT, wantZ, kacc22, N, KTOP, KBOT, nshifts, SR, strideSR, offsetSR, SI, strideSI, offsetSI, H, strideH1, strideH2, offsetH, iloZ, ihiZ, Z, strideZ1, strideZ2, offsetZ, V, strideV1, strideV2, offsetV, U, strideU1, strideU2, offsetU, NH, WH, strideWH1, strideWH2, offsetWH, NV, WV, strideWV1, strideWV2, offsetWV ) {
151153
var dlarfgOut;
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* eslint-disable max-len, max-params */
20+
21+
'use strict';
22+
23+
// MODULES //
24+
25+
var isLayout = require( '@stdlib/blas/base/assert/is-layout' );
26+
var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
27+
var format = require( '@stdlib/string/format' );
28+
var base = require( './base.js' );
29+
30+
31+
// MAIN //
32+
33+
/**
34+
* Performs a single, small shift multiline QR sweep.
35+
*
36+
* @param {string} order - storage layout
37+
* @param {boolean} wantT - boolean value indicating whether the quasi triangular Schur factor is being computed
38+
* @param {boolean} wantZ - boolean value indicating whether the orthogonal Schur factor is being computed
39+
* @param {integer} kacc22 - integer value ranging from 0 to 2 (inclusive), specifies the computation mode for far-from-diagonal updates
40+
* @param {integer} N - number of rows/columns in `H`
41+
* @param {integer} KTOP - first row and column of the submatrix of `H` where the QR sweep will be applied
42+
* @param {integer} KBOT - last row and column of the submatrix of `H` where the QR sweep will be applied
43+
* @param {integer} nshifts - number of simultaneous shifts, must be even and positive
44+
* @param {Float64Array} SR - real parts of the shifts of origin that define the QR sweep
45+
* @param {Float64Array} SI - imaginary parts of the shifts of origin that define the QR sweep
46+
* @param {Float64Array} H - input upper hessenberg matrix
47+
* @param {PositiveInteger} LDH - stride of the first dimension of `H` (a.k.a., leading dimension of the matrix `H`)
48+
* @param {integer} iloZ - starting row from where the transformation must be applied if `wantZ` is true
49+
* @param {integer} ihiZ - ending row from where the transformation must be applied if `wantZ` is true
50+
* @param {Float64Array} Z - the QR sweep orthogonal similarity transformation is accumulated into `Z` between the rows and columns `iloZ` and `ihiZ` if `wantZ` is true, otherwise `Z` is not referenced
51+
* @param {PositiveInteger} LDZ - stride of the first dimension of `Z` (a.k.a., leading dimension of the matrix `Z`)
52+
* @param {Float64Array} V - householder vectors are stored column-wise, used in forming bulges for the multi shift QR algorithm
53+
* @param {PositiveInteger} LDV - stride of the first dimension of `V` (a.k.a., leading dimension of the matrix `V`)
54+
* @param {Float64Array} U - used to hold the product of householder reflector that represent accumulated orthogonal transformations from the bulge-chasing process
55+
* @param {PositiveInteger} LDU - stride of the first dimension of `U` (a.k.a., leading dimension of the matrix `U`)
56+
* @param {integer} NH - number of columns in `WH` available for workspace
57+
* @param {Float64Array} WH - workspace array
58+
* @param {PositiveInteger} LDWH - stride of the first dimension of `WH` (a.k.a., leading dimension of the matrix `WH`)
59+
* @param {integer} NV - number of rows in `WV` available for workspace
60+
* @param {Float64Array} WV - workspace array
61+
* @param {PositiveInteger} LDWV - stride of the first dimension of `WV` (a.k.a., leading dimension of the matrix `WV`)
62+
* @throws {TypeError} first argument must be a valid order
63+
* @throws {RangeError} fourth argument must be greater than or equal to max(1,N)
64+
* @returns {void} permuted matrix `A`
65+
*
66+
* @example
67+
* var Float64Array = require( '@stdlib/array/float64' );
68+
*
69+
* var H = new Float64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ] );
70+
* var Z = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] );
71+
* var V = new Float64Array( 6 );
72+
* var U = new Float64Array( 10 );
73+
* var WH = new Float64Array( 16 );
74+
* var WV = new Float64Array( 16 );
75+
* var SR = new Float64Array( [ 1.1, 2.2 ] );
76+
* var SI = new Float64Array( [ 0.0, 0.0 ] );
77+
*
78+
* dlaqr5( 'row-major', true, true, 0, 4, 1, 4, 2, SR, SI, H, 4, 1, 4, Z, 4, V, 2, U, 2, 4, WH, 4, 4, WV, 4 );
79+
* // H => <Float64Array>[ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ]
80+
* // Z => <Float64Array>[ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]
81+
*/
82+
function dlaqr5( order, wantT, wantZ, kacc22, N, KTOP, KBOT, nshifts, SR, SI, H, LDH, iloZ, ihiZ, Z, LDZ, V, LDV, U, LDU, NH, WH, LDWH, NV, WV, LDWV ) {
83+
var swh1;
84+
var swh2;
85+
var swv1;
86+
var swv2;
87+
var sh1;
88+
var sh2;
89+
var sz1;
90+
var sz2;
91+
var sv1;
92+
var sv2;
93+
var su1;
94+
var su2;
95+
96+
if ( !isLayout( order ) ) {
97+
throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
98+
}
99+
if ( isRowMajor( order ) ) {
100+
sh1 = LDH;
101+
sh2 = 1;
102+
sz1 = LDZ;
103+
sz2 = 1;
104+
sv1 = LDV;
105+
sv2 = 1;
106+
su1 = LDU;
107+
su2 = 1;
108+
swh1 = LDWH;
109+
swh2 = 1;
110+
swv1 = LDWV;
111+
swv2 = 1;
112+
} else { // order === 'col-major'
113+
sh1 = 1;
114+
sh2 = LDH;
115+
sz1 = 1;
116+
sz2 = LDZ;
117+
sv1 = 1;
118+
sv2 = LDV;
119+
su1 = 1;
120+
su2 = LDU;
121+
swh1 = 1;
122+
swh2 = LDWH;
123+
swv1 = 1;
124+
swv2 = LDWV;
125+
}
126+
base( wantT, wantZ, kacc22, N, KTOP, KBOT, nshifts, SR, 1, 0, SI, 1, 0, H, sh1, sh2, 0, iloZ, ihiZ, Z, sz1, sz2, 0, V, sv1, sv2, 0, U, su1, su2, 0, NH, WH, swh1, swh2, 0, NV, WV, swv1, swv2, 0 );
127+
}
128+
129+
130+
// EXPORTS //
131+
132+
module.exports = dlaqr5;
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
/**
22+
* LAPACK routine to perform a single, small shift multiline QR sweep.
23+
*
24+
* @module @stdlib/lapack/base/dlaqr5
25+
*
26+
* @example
27+
* var Float64Array = require( '@stdlib/array/float64' );
28+
* var dlaqr5 = require( '@stdlib/lapack/base/dlaqr5' );
29+
*
30+
* var H = new Float64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ] );
31+
* var Z = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] );
32+
* var V = new Float64Array( 6 );
33+
* var U = new Float64Array( 10 );
34+
* var WH = new Float64Array( 16 );
35+
* var WV = new Float64Array( 16 );
36+
* var SR = new Float64Array( [ 1.1, 2.2 ] );
37+
* var SI = new Float64Array( [ 0.0, 0.0 ] );
38+
*
39+
* dlaqr5( 'row-major', true, true, 0, 4, 1, 4, 2, SR, SI, H, 4, 1, 4, Z, 4, V, 2, U, 2, 4, WH, 4, 4, WV, 4 );
40+
* // H => <Float64Array>[ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ]
41+
* // Z => <Float64Array>[ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]
42+
*/
43+
44+
// MODULES //
45+
46+
var join = require( 'path' ).join;
47+
var tryRequire = require( '@stdlib/utils/try-require' );
48+
var isError = require( '@stdlib/assert/is-error' );
49+
var main = require( './main.js' );
50+
51+
52+
// MAIN //
53+
54+
var dlaqr5;
55+
var tmp = tryRequire( join( __dirname, './native.js' ) );
56+
if ( isError( tmp ) ) {
57+
dlaqr5 = main;
58+
} else {
59+
dlaqr5 = tmp;
60+
}
61+
62+
63+
// EXPORTS //
64+
65+
module.exports = dlaqr5;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
24+
var dlaqr5 = require( './dlaqr5.js' );
25+
var ndarray = require( './ndarray.js' );
26+
27+
28+
// MAIN //
29+
30+
setReadOnly( dlaqr5, 'ndarray', ndarray );
31+
32+
33+
// EXPORTS //
34+
35+
module.exports = dlaqr5;
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* eslint-disable max-len, max-params */
20+
21+
'use strict';
22+
23+
// MODULES //
24+
25+
var base = require( './base.js' );
26+
27+
28+
// MAIN //
29+
30+
/**
31+
* Performs a single, small shift multiline QR sweep using alternative indexing semantics.
32+
*
33+
* @param {boolean} wantT - boolean value indicating whether the quasi triangular Schur factor is being computed
34+
* @param {boolean} wantZ - boolean value indicating whether the orthogonal Schur factor is being computed
35+
* @param {integer} kacc22 - integer value ranging from 0 to 2 (inclusive), specifies the computation mode for far-from-diagonal updates
36+
* @param {integer} N - number of rows/columns in `H`
37+
* @param {integer} KTOP - first row and column of the submatrix of `H` where the QR sweep will be applied
38+
* @param {integer} KBOT - last row and column of the submatrix of `H` where the QR sweep will be applied
39+
* @param {integer} nshifts - number of simultaneous shifts, must be even and positive
40+
* @param {Float64Array} SR - real parts of the shifts of origin that define the QR sweep
41+
* @param {integer} strideSR - stride length of `SR`
42+
* @param {NonNegativeInteger} offsetSR - starting index for `SR`
43+
* @param {Float64Array} SI - imaginary parts of the shifts of origin that define the QR sweep
44+
* @param {integer} strideSI - stride length of `SI`
45+
* @param {NonNegativeInteger} offsetSI - starting index of `SI`
46+
* @param {Float64Array} H - input upper hessenberg matrix
47+
* @param {integer} strideH1 - stride of the first dimension of `H`
48+
* @param {integer} strideH2 - stride of the second dimension of `H`
49+
* @param {NonNegativeInteger} offsetH - starting index of `H`
50+
* @param {integer} iloZ - starting row from where the transformation must be applied if `wantZ` is true
51+
* @param {integer} ihiZ - ending row from where the transformation must be applied if `wantZ` is true
52+
* @param {Float64Array} Z - the QR sweep orthogonal similarity transformation is accumulated into `Z` between the rows and columns `iloZ` and `ihiZ` if `wantZ` is true, otherwise `Z` is not referenced
53+
* @param {integer} strideZ1 - stride of the first dimension of `Z`
54+
* @param {integer} strideZ2 - stride of the second dimension of `Z`
55+
* @param {NonNegativeInteger} offsetZ - starting index of `Z`
56+
* @param {Float64Array} V - householder vectors are stored column-wise, used in forming bulges for the multi shift QR algorithm
57+
* @param {integer} strideV1 - stride of the first dimension of `V`
58+
* @param {integer} strideV2 - stride of the second dimension of `V`
59+
* @param {NonNegativeInteger} offsetV - starting index of `V`
60+
* @param {Float64Array} U - used to hold the product of householder reflector that represent accumulated orthogonal transformations from the bulge-chasing process
61+
* @param {integer} strideU1 - stride of the first dimension of `U`
62+
* @param {integer} strideU2 - stride of the second dimension of `U`
63+
* @param {NonNegativeInteger} offsetU - starting index of `U`
64+
* @param {integer} NH - number of columns in `WH` available for workspace
65+
* @param {Float64Array} WH - workspace array
66+
* @param {integer} strideWH1 - stride of the first dimension of `WH`
67+
* @param {integer} strideWH2 - stride of the second dimension of `WH`
68+
* @param {NonNegativeInteger} offsetWH - starting index of `WH`
69+
* @param {integer} NV - number of rows in `WV` available for workspace
70+
* @param {Float64Array} WV - workspace array
71+
* @param {integer} strideWV1 - stride of the first dimension of `WV`
72+
* @param {integer} strideWV2 - stride of the second dimension of `WV`
73+
* @param {NonNegativeInteger} offsetWV - starting index of `WV`
74+
* @returns {void}
75+
*
76+
* @example
77+
* var Float64Array = require( '@stdlib/array/float64' );
78+
*
79+
* var H = new Float64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ] );
80+
* var Z = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] );
81+
* var V = new Float64Array( 6 );
82+
* var U = new Float64Array( 10 );
83+
* var WH = new Float64Array( 16 );
84+
* var WV = new Float64Array( 16 );
85+
* var SR = new Float64Array( [ 1.1, 2.2 ] );
86+
* var SI = new Float64Array( [ 0.0, 0.0 ] );
87+
*
88+
* dlaqr5( true, true, 0, 4, 1, 4, 2, SR, 1, 0, SI, 1, 0, H, 4, 1, 0, 1, 4, Z, 4, 1, 0, V, 2, 1, 0, U, 2, 1, 0, 4, WH, 4, 1, 0, 4, WV, 4, 1, 0 );
89+
* // H => <Float64Array>[ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ]
90+
* // Z => <Float64Array>[ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]
91+
*/
92+
function dlaqr5( wantT, wantZ, kacc22, N, KTOP, KBOT, nshifts, SR, strideSR, offsetSR, SI, strideSI, offsetSI, H, strideH1, strideH2, offsetH, iloZ, ihiZ, Z, strideZ1, strideZ2, offsetZ, V, strideV1, strideV2, offsetV, U, strideU1, strideU2, offsetU, NH, WH, strideWH1, strideWH2, offsetWH, NV, WV, strideWV1, strideWV2, offsetWV ) {
93+
base( wantT, wantZ, kacc22, N, KTOP, KBOT, nshifts, SR, strideSR, offsetSR, SI, strideSI, offsetSI, H, strideH1, strideH2, offsetH, iloZ, ihiZ, Z, strideZ1, strideZ2, offsetZ, V, strideV1, strideV2, offsetV, U, strideU1, strideU2, offsetU, NH, WH, strideWH1, strideWH2, offsetWH, NV, WV, strideWV1, strideWV2, offsetWV );
94+
}
95+
96+
97+
// EXPORTS //
98+
99+
module.exports = dlaqr5;

0 commit comments

Comments
 (0)