Skip to content

Commit deb41b8

Browse files
committed
feat: add main 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 2339ecb commit deb41b8

File tree

5 files changed

+229
-1
lines changed

5 files changed

+229
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function setLower( M, N, A, strideA1, strideA2, offsetA, alpha, beta ) {
202202
* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.
203203
*
204204
* @private
205-
* @param {string} uplo - specifies whether to copy the upper or lower triangular/trapezoidal part of matrix `A`
205+
* @param {string} uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A`
206206
* @param {NonNegativeInteger} M - number of rows in matrix `A`
207207
* @param {NonNegativeInteger} N - number of columns in matrix `A`
208208
* @param {Float64Array} A - input matrix
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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 isLayout = require( '@stdlib/blas/base/assert/is-layout' );
24+
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
25+
var format = require( '@stdlib/string/format' );
26+
var base = require( './base.js' );
27+
28+
29+
// MAIN //
30+
31+
/**
32+
* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.
33+
*
34+
* @param {string} order - storage layout of `A` and `B`
35+
* @param {string} uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A`
36+
* @param {NonNegativeInteger} M - number of rows in matrix `A`
37+
* @param {NonNegativeInteger} N - number of columns in matrix `A`
38+
* @param {Float64Array} A - input matrix
39+
* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
40+
* @param {number} alpha - number to set on off diagonal elements
41+
* @param {number} beta - number to set on diagonal elements
42+
* @throws {TypeError} first argument must be a valid order
43+
* @throws {RangeError} sixth argument must be greater than or equal to `N`
44+
* @returns {Float64Array} `A`
45+
*
46+
* @example
47+
* var Float64Array = require( '@stdlib/array/float64' );
48+
*
49+
* var A = new Float64Array( 4 );
50+
*
51+
* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 );
52+
* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
53+
*/
54+
function dlaset( order, uplo, M, N, A, LDA, alpha, beta ) {
55+
var sa1;
56+
var sa2;
57+
if ( !isLayout( order ) ) {
58+
throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
59+
}
60+
if ( isColumnMajor( order ) ) {
61+
sa1 = 1;
62+
sa2 = LDA;
63+
} else { // order === 'row-major'
64+
if ( LDA < N ) {
65+
throw new RangeError( format( 'invalid argument. Sixth argument must be greater than or equal to %d. Value: `%d`.', N, LDA ) );
66+
}
67+
sa1 = LDA;
68+
sa2 = 1;
69+
}
70+
return base( uplo, M, N, A, sa1, sa2, 0, alpha, beta );
71+
}
72+
73+
74+
// EXPORTS //
75+
76+
module.exports = dlaset;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 initialize an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.
23+
*
24+
* @module @stdlib/lapack/base/dlaset
25+
*
26+
* @example
27+
* var Float64Array = require( '@stdlib/array/float64' );
28+
* var dlaset = require( '@stdlib/lapack/base/dlaset' );
29+
*
30+
* var A = new Float64Array( 4 );
31+
*
32+
* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 );
33+
* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
34+
*/
35+
36+
// MODULES //
37+
38+
var join = require( 'path' ).join;
39+
var tryRequire = require( '@stdlib/utils/try-require' );
40+
var isError = require( '@stdlib/assert/is-error' );
41+
var main = require( './main.js' );
42+
43+
44+
// MAIN //
45+
46+
var dlaset;
47+
var tmp = tryRequire( join( __dirname, './native.js' ) );
48+
if ( isError( tmp ) ) {
49+
dlaset = main;
50+
} else {
51+
dlaset = tmp;
52+
}
53+
54+
55+
// EXPORTS //
56+
57+
module.exports = dlaset;
58+
59+
// exports: { "ndarray": "dlaset.ndarray" }
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 dlaset = require( './dlaset.js' );
25+
var ndarray = require( './ndarray.js' );
26+
27+
28+
// MAIN //
29+
30+
setReadOnly( dlaset, 'ndarray', ndarray );
31+
32+
33+
// EXPORTS //
34+
35+
module.exports = dlaset;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 base = require( './base.js' );
24+
25+
26+
// MAIN //
27+
28+
/**
29+
* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals using alternative indexing semantics.
30+
*
31+
* @private
32+
* @param {string} uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A`
33+
* @param {NonNegativeInteger} M - number of rows in matrix `A`
34+
* @param {NonNegativeInteger} N - number of columns in matrix `A`
35+
* @param {Float64Array} A - input matrix
36+
* @param {integer} strideA1 - stride of the first dimension of `A`
37+
* @param {integer} strideA2 - stride of the second dimension of `A`
38+
* @param {NonNegativeInteger} offsetA - starting index for `A`
39+
* @param {number} alpha - number to set on off diagonal elements
40+
* @param {number} beta - number to set on diagonal elements
41+
* @returns {Float64Array} `A`
42+
*
43+
* @example
44+
* var Float64Array = require( '@stdlib/array/float64' );
45+
*
46+
* var A = new Float64Array( 4 );
47+
*
48+
* dlaset( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 );
49+
* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
50+
*/
51+
function dlaset( uplo, M, N, A, strideA1, strideA2, offsetA, alpha, beta ) {
52+
return base( uplo, M, N, A, strideA1, strideA2, offsetA, alpha, beta );
53+
}
54+
55+
56+
// EXPORTS //
57+
58+
module.exports = dlaset;

0 commit comments

Comments
 (0)