Skip to content

Commit 2a5a501

Browse files
committed
fix: fix tests
--- 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: passed - 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 871e7fc commit 2a5a501

File tree

3 files changed

+19
-33
lines changed

3 files changed

+19
-33
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var base = require( './base.js' );
6161
* @throws {TypeError} first argument must be a valid order
6262
* @throws {TypeError} second argument must be a valid operation side
6363
* @throws {TypeError} third argument must be a valid transpose operation
64-
* @throws {RangeError} eighth argument must be greater than or equal to max(1,K) when side is 'left' or max(1,M) when side is 'right'
64+
* @throws {RangeError} eighth argument must be greater than or equal to max(1,M) when side is 'left' or max(1,N) when side is 'right'
6565
* @throws {RangeError} twelfth argument must be greater than or equal to max(1,M)
6666
* @returns {Float64Array} the modified matrix `C`
6767
*
@@ -90,6 +90,16 @@ function dorm2r( order, side, trans, M, N, K, A, LDA, tau, C, LDC, work ) { // e
9090
if ( !isTransposeOperation( trans ) ) {
9191
throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', trans ) );
9292
}
93+
if ( isColumnMajor( order ) ) {
94+
if ( side === 'left' && LDA < max( 1, M ) ) {
95+
throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d) when side is left. Value: `%d`.', M, LDA ) );
96+
}
97+
if ( side === 'right' && LDA < max( 1, N ) ) {
98+
throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d) when side is right. Value: `%d`.', N, LDA ) );
99+
}
100+
} else if ( LDA < max( 1, K ) ) {
101+
throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d) for row-major layout. Value: `%d`.', K, LDA ) );
102+
}
93103
if ( isRowMajor( order ) && LDC < max( 1, N ) ) {
94104
throw new RangeError( format( 'invalid argument. Twelfth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDC ) );
95105
}

lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.dorm2r.js

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,9 @@ tape( 'the function throws an error if provided an eighth argument which is not
175175
work = new Float64Array( 3 );
176176

177177
values = [
178-
-1,
179178
0,
180-
NaN,
181-
'5',
182-
null,
183-
void 0,
184-
true,
185-
false,
186-
[],
187-
{},
188-
function noop() {}
179+
1,
180+
2
189181
];
190182

191183
for ( i = 0; i < values.length; i++ ) {
@@ -214,17 +206,9 @@ tape( 'the function throws an error if provided a twelfth argument which is not
214206
work = new Float64Array( 3 );
215207

216208
values = [
217-
-1,
218209
0,
219-
NaN,
220-
'5',
221-
null,
222-
void 0,
223-
true,
224-
false,
225-
[],
226-
{},
227-
function noop() {}
210+
1,
211+
2
228212
];
229213

230214
for ( i = 0; i < values.length; i++ ) {
@@ -253,17 +237,9 @@ tape( 'the function throws an error if provided a twelfth argument which is not
253237
work = new Float64Array( 3 );
254238

255239
values = [
256-
-1,
257240
0,
258-
NaN,
259-
'5',
260-
null,
261-
void 0,
262-
true,
263-
false,
264-
[],
265-
{},
266-
function noop() {}
241+
1,
242+
2
267243
];
268244

269245
for ( i = 0; i < values.length; i++ ) {

lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ tape( 'main export is a function', function test( t ) {
3333
t.end();
3434
});
3535

36-
tape( 'the function has an arity of 18', function test( t ) {
37-
t.strictEqual( dorm2r.length, 18, 'returns expected value' );
36+
tape( 'the function has an arity of 19', function test( t ) {
37+
t.strictEqual( dorm2r.length, 19, 'returns expected value' );
3838
t.end();
3939
});
4040

0 commit comments

Comments
 (0)