Skip to content

Commit b5618f1

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 8104aed commit b5618f1

File tree

4 files changed

+193
-17
lines changed

4 files changed

+193
-17
lines changed

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

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ var min = require( '@stdlib/math/base/special/min' );
4343
* @param {integer} strideOut - stride length for `out`
4444
* @param {integer} offsetOut - starting index for `out`
4545
* @returns {integer} status code
46+
*
47+
* @example
48+
* var Float64Array = require( '@stdlib/array/float64' );
49+
*
50+
* var AP = new Float64Array( [ 1.0, 2.0, 3.0, 5.0, 6.0, 9.0 ] );
51+
* var S = new Float64Array( 3 );
52+
* var out = new Float64Array( 2 );
53+
*
54+
* dppequ( 'row-major', 'L', 3, AP, 1, 0, S, 1, 0, out, 1, 0 );
55+
* // S => <Float64Array>[ 1, ~0.58, ~0.33 ]
56+
* // out => <Float64Array>[ ~0.33, 9 ]
4657
*/
4758
function dppequ( order, uplo, N, AP, strideAP, offsetAP, S, strideS, offsetS, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params
4859
var info;
@@ -79,23 +90,21 @@ function dppequ( order, uplo, N, AP, strideAP, offsetAP, S, strideS, offsetS, ou
7990
amax = max( amax, S[ offsetS + (i * strideS) ] );
8091
}
8192
}
82-
} else { // order === 'col-major'
83-
if ( uplo === 'U' ) { // uplo === 'U'
84-
jj = 0;
85-
for ( i = 1; i < N; i++ ) {
86-
jj += i + 1;
87-
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
88-
smin = min( smin, S[ offsetS + (i * strideS) ] );
89-
amax = max( amax, S[ offsetS + (i * strideS) ] );
90-
}
91-
} else { // uplo === 'L'
92-
jj = 0;
93-
for ( i = 1; i < N; i++ ) {
94-
jj += N - i + 1;
95-
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
96-
smin = min( smin, S[ offsetS + (i * strideS) ] );
97-
amax = max( amax, S[ offsetS + (i * strideS) ] );
98-
}
93+
} else if ( uplo === 'U' ) { // order === 'col-major'
94+
jj = 0;
95+
for ( i = 1; i < N; i++ ) {
96+
jj += i + 1;
97+
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
98+
smin = min( smin, S[ offsetS + (i * strideS) ] );
99+
amax = max( amax, S[ offsetS + (i * strideS) ] );
100+
}
101+
} else { // uplo === 'L', order === 'col-major'
102+
jj = 0;
103+
for ( i = 1; i < N; i++ ) {
104+
jj += N - i + 1;
105+
S[ offsetS + (i * strideS) ] = AP[ offsetAP + (jj * strideAP) ];
106+
smin = min( smin, S[ offsetS + (i * strideS) ] );
107+
amax = max( amax, S[ offsetS + (i * strideS) ] );
99108
}
100109
}
101110

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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 isLayout = require( '@stdlib/blas/base/assert/is-layout' );
24+
var format = require( '@stdlib/string/format' );
25+
var base = require( './base.js' );
26+
27+
28+
// MAIN //
29+
30+
/**
31+
* Computes the row and column scaling factors intended to equilibrate a symmetric positive definite matrix `A` in packed storage and reduce it's condition number (with respect to the two-norm).
32+
*
33+
* @param {string} order - specifies whether `AP` is packed in row-major or column-major order
34+
* @param {string} uplo - 'Upper' or 'Lower' triangle of `A` is stored
35+
* @param {NonNegativeInteger} N - order of the matrix `A`
36+
* @param {Float64Array} AP - array containing the upper or lower triangle of `A` in packed form
37+
* @param {Float64Array} S - array to store the scale factors of `A`
38+
* @param {Float64Array} out - array to store the output
39+
* @throws {TypeError} first argument must be a valid order
40+
* @returns {integer} status code
41+
*
42+
* @example
43+
* var Float64Array = require( '@stdlib/array/float64' );
44+
*
45+
* var AP = new Float64Array( [ 1.0, 2.0, 3.0, 5.0, 6.0, 9.0 ] );
46+
* var S = new Float64Array( 3 );
47+
* var out = new Float64Array( 2 );
48+
*
49+
* dppequ( 'row-major', 'L', 3, AP, S, out );
50+
* // S => <Float64Array>[ 1, ~0.58, ~0.33 ]
51+
* // out => <Float64Array>[ ~0.33, 9 ]
52+
*/
53+
function dppequ( order, uplo, N, AP, S, out ) {
54+
if ( !isLayout( order ) ) {
55+
throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
56+
}
57+
return base( order, uplo, N, AP, 1, 0, S, 1, 0, out, 1, 0 );
58+
}
59+
60+
61+
// EXPORTS //
62+
63+
module.exports = dppequ;
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) 2024 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 dppequ = require( './dppequ.js' );
25+
var ndarray = require( './ndarray.js' );
26+
27+
28+
// MAIN //
29+
30+
setReadOnly( dppequ, 'ndarray', ndarray );
31+
32+
33+
// EXPORTS //
34+
35+
module.exports = dppequ;
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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 isLayout = require( '@stdlib/blas/base/assert/is-layout' );
24+
var format = require( '@stdlib/string/format' );
25+
var base = require( './base.js' );
26+
27+
28+
// MAIN //
29+
30+
/**
31+
* Computes the row and column scaling factors intended to equilibrate a symmetric positive definite matrix `A` in packed storage and reduce it's condition number (with respect to the two-norm).
32+
*
33+
* @param {string} order - specifies whether `AP` is packed in row-major or column-major order
34+
* @param {string} uplo - 'Upper' or 'Lower' triangle of `A` is stored
35+
* @param {NonNegativeInteger} N - order of the matrix `A`
36+
* @param {Float64Array} AP - array containing the upper or lower triangle of `A` in packed form
37+
* @param {integer} strideAP - stride length for `AP`
38+
* @param {integer} offsetAP - starting index for `AP`
39+
* @param {Float64Array} S - array to store the scale factors of `A`
40+
* @param {integer} strideS - stride length for `S`
41+
* @param {integer} offsetS - starting index for `S`
42+
* @param {Float64Array} out - array to store the output
43+
* @param {integer} strideOut - stride length for `out`
44+
* @param {integer} offsetOut - starting index for `out`
45+
* @throws {TypeError} first argument must be a valid order
46+
* @returns {integer} status code
47+
*
48+
* @example
49+
* var Float64Array = require( '@stdlib/array/float64' );
50+
*
51+
* var AP = new Float64Array( [ 1.0, 2.0, 3.0, 5.0, 6.0, 9.0 ] );
52+
* var S = new Float64Array( 3 );
53+
* var out = new Float64Array( 2 );
54+
*
55+
* dppequ( 'row-major', 'L', 3, AP, 1, 0, S, 1, 0, out, 1, 0 );
56+
* // S => <Float64Array>[ 1, ~0.58, ~0.33 ]
57+
* // out => <Float64Array>[ ~0.33, 9 ]
58+
*/
59+
function dppequ( order, uplo, N, AP, strideAP, offsetAP, S, strideS, offsetS, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params
60+
if ( !isLayout( order ) ) {
61+
throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
62+
}
63+
return base( order, uplo, N, AP, strideAP, offsetAP, S, strideS, offsetS, out, strideOut, offsetOut ); // eslint-disable-line max-len
64+
}
65+
66+
67+
// EXPORTS //
68+
69+
module.exports = dppequ;

0 commit comments

Comments
 (0)