Skip to content

Commit 54aca86

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 9e8d0f6 commit 54aca86

File tree

5 files changed

+225
-3
lines changed

5 files changed

+225
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' );
3535
* @param {integer} strideA1 - stride of the first dimension of `A`
3636
* @param {integer} strideA2 - stride of the second dimension of `A`
3737
* @param {NonNegativeInteger} offsetA - index offset for `A`
38-
* @returns {integer} index of the last column
38+
* @returns {integer} index of the last non zero column
3939
*
4040
* @example
4141
* var Float64array = require( '@stdlib/array/float64' );
4242
*
4343
* var A = new Float64array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 2.0, 0.0 ], [ 3.0, 4.0, 0.0 ] ]
4444
*
45-
* var out = iladlc( 3, 2, A, 2, 1, 0 );
45+
* var out = iladlc( 2, 3, A, 3, 1, 0 );
4646
* // returns 1
4747
*/
4848
function iladlc( M, N, A, strideA1, strideA2, offsetA ) {
@@ -56,7 +56,7 @@ function iladlc( M, N, A, strideA1, strideA2, offsetA ) {
5656
}
5757

5858
ia1 = offsetA + ( (N-1) * strideA2 ); // A( 1, N )
59-
ia2 = ia1 + ( (M-1) * strideA2 ); // A( M, N )
59+
ia2 = ia1 + ( (M-1) * strideA1 ); // A( M, N )
6060

6161
// Quick test for common case where corners are non-zero:
6262
if ( A[ ia1 ] !== 0.0 || A[ ia2 ] !== 0.0 ) {
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 isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
25+
var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
26+
var max = require( '@stdlib/math/base/special/max' );
27+
var format = require( '@stdlib/string/format' );
28+
var base = require( './base.js' );
29+
30+
31+
// MAIN //
32+
33+
/**
34+
* Finds the index of the last non zero column in a matrix `A`.
35+
*
36+
* @param {string} order - storage layout
37+
* @param {PositiveInteger} M - number of rows in `A`
38+
* @param {PositiveInteger} N - number of columns in `A`
39+
* @param {Float64Array} A - input matrix
40+
* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
41+
* @throws {TypeError} first argument must be a valid order
42+
* @throws {RangeError} fifth argument must be greater than or equal to max(1,N)
43+
* @returns {integer} index of the last non zero column
44+
*
45+
* @example
46+
* var Float64array = require( '@stdlib/array/float64' );
47+
*
48+
* var A = new Float64array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 2.0, 0.0 ], [ 3.0, 4.0, 0.0 ] ]
49+
*
50+
* var out = iladlc( 'row-major', 2, 3, A, 3 );
51+
* // returns 1
52+
*/
53+
function iladlc( order, M, N, A, LDA ) {
54+
var sa1;
55+
var sa2;
56+
57+
if ( !isLayout( order ) ) {
58+
throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
59+
}
60+
if ( isRowMajor( order ) && LDA < max( 1, N ) ) {
61+
throw new RangeError( format( 'invalid argument. Fourth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) );
62+
}
63+
if ( isColumnMajor( order ) ) {
64+
sa1 = 1;
65+
sa2 = LDA;
66+
} else { // order === 'row-major'
67+
sa1 = LDA;
68+
sa2 = 1;
69+
}
70+
return base( M, N, A, sa1, sa2, 0 );
71+
}
72+
73+
74+
// EXPORTS //
75+
76+
module.exports = iladlc;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 find the index of the last non zero row in a input matrix.
23+
*
24+
* @module @stdlib/lapack/base/iladlc
25+
*
26+
* @example
27+
* var Float64array = require( '@stdlib/array/float64' );
28+
* var iladlc = require( '@stdlib/lapack/base/iladlc' );
29+
*
30+
* var A = new Float64array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 2.0, 0.0 ], [ 3.0, 4.0, 0.0 ] ]
31+
*
32+
* var out = iladlc( 'row-major', 2, 3, A, 3 );
33+
* // returns 1
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 iladlc;
47+
var tmp = tryRequire( join( __dirname, './native.js' ) );
48+
if ( isError( tmp ) ) {
49+
iladlc = main;
50+
} else {
51+
iladlc = tmp;
52+
}
53+
54+
55+
// EXPORTS //
56+
57+
module.exports = iladlc;
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 iladlc = require( './iladlc.js' );
25+
var ndarray = require( './ndarray.js' );
26+
27+
28+
// MAIN //
29+
30+
setReadOnly( iladlc, 'ndarray', ndarray );
31+
32+
33+
// EXPORTS //
34+
35+
module.exports = iladlc;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
* Finds the index of the last non zero column in a matrix `A` using alternative indexing semantics.
30+
*
31+
* @param {PositiveInteger} M - number of rows in `A`
32+
* @param {PositiveInteger} N - number of columns in `A`
33+
* @param {Float64Array} A - input matrix
34+
* @param {integer} strideA1 - stride of the first dimension of `A`
35+
* @param {integer} strideA2 - stride of the second dimension of `A`
36+
* @param {NonNegativeInteger} offsetA - index offset for `A`
37+
* @returns {integer} index of the last non zero column
38+
*
39+
* @example
40+
* var Float64array = require( '@stdlib/array/float64' );
41+
*
42+
* var A = new Float64array( [ 1.0, 2.0, 0.0, 3.0, 4.0, 0.0 ] ); // => [ [ 1.0, 2.0, 0.0 ], [ 3.0, 4.0, 0.0 ] ]
43+
*
44+
* var out = iladlc( 2, 3, A, 3, 1, 0 );
45+
* // returns 1
46+
*/
47+
function iladlc( M, N, A, strideA1, strideA2, offsetA ) {
48+
return base( M, N, A, strideA1, strideA2, offsetA );
49+
}
50+
51+
52+
// EXPORTS //
53+
54+
module.exports = iladlc;

0 commit comments

Comments
 (0)