Skip to content

Commit a6da690

Browse files
committed
test: fix zlaswp tests for large datasets
--- 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: na - 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 61f1a51 commit a6da690

File tree

2 files changed

+30
-15
lines changed

2 files changed

+30
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
559559
var o;
560560

561561
ord = 'row-major';
562-
sh = [ 5, 100 ];
562+
sh = [ 5, 1000 ];
563563
st = shape2strides( sh, ord );
564564
o = 0;
565565

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

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var reverse = require( '@stdlib/array/base/reverse' );
3232
var ndarray2array = require( '@stdlib/ndarray/base/to-array' );
3333
var numel = require( '@stdlib/ndarray/base/numel' );
3434
var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
35+
var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' );
3536
var zlaswp = require( './../lib/zlaswp.js' );
3637

3738

@@ -272,8 +273,11 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0`
272273
});
273274

274275
tape( 'the function efficiently handles large datasets (column-major)', function test( t ) {
276+
var expectedMat;
277+
var expectedBuf;
275278
var expected;
276279
var IPIV;
280+
var Abuf;
277281
var buf;
278282
var mat;
279283
var out;
@@ -284,25 +288,29 @@ tape( 'the function efficiently handles large datasets (column-major)', function
284288
var o;
285289

286290
ord = 'column-major';
287-
sh = [ 5, 100 ];
291+
sh = [ 5, 1000 ];
288292
st = shape2strides( sh, ord );
289293
o = 0;
290294

291295
// Define a linear buffer:
292-
buf = oneTo( numel( sh ), 'generic' );
293-
294-
// Convert to a nested array:
295-
mat = ndarray2array( buf, sh, st, o, ord );
296+
buf = oneTo( 2 * numel( sh ), 'generic' );
296297

297298
// Define an input matrix in linear storage:
298299
A = new Complex128Array( buf );
299300

301+
Abuf = reinterpret( A, 0 );
302+
303+
// Convert to a nested array:
304+
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
305+
300306
// Create an array of pivot indices:
301307
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
302308

303309
// Define the expected output array:
304-
expected = reverse( mat.slice() );
305-
expected = new Complex128Array( flatten( expected, sh, true ) );
310+
expectedMat = reverse( mat.slice() );
311+
expectedBuf = flatten( expectedMat, sh, true );
312+
expectedBuf = flatten( expectedBuf, [ numel( sh ), 2 ], false );
313+
expected = new Complex128Array( expectedBuf );
306314

307315
// Interchange rows:
308316
out = zlaswp( ord, sh[1], A, sh[0], 3, 4, IPIV, 1 );
@@ -461,8 +469,11 @@ tape( 'if provided an increment between successive values of `IPIV` equal to `0`
461469
});
462470

463471
tape( 'the function efficiently handles large datasets (row-major)', function test( t ) {
472+
var expectedBuf;
473+
var expectedMat;
464474
var expected;
465475
var IPIV;
476+
var Abuf;
466477
var buf;
467478
var mat;
468479
var out;
@@ -473,25 +484,29 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
473484
var o;
474485

475486
ord = 'row-major';
476-
sh = [ 5, 100 ];
487+
sh = [ 5, 1000 ];
477488
st = shape2strides( sh, ord );
478489
o = 0;
479490

480491
// Define a linear buffer:
481-
buf = oneTo( numel( sh ), 'generic' );
482-
483-
// Convert to a nested array:
484-
mat = ndarray2array( buf, sh, st, o, ord );
492+
buf = oneTo( 2 * numel( sh ), 'generic' );
485493

486494
// Define an input matrix in linear storage:
487495
A = new Complex128Array( buf );
488496

497+
Abuf = reinterpret( A, 0 );
498+
499+
// Convert to a nested array:
500+
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
501+
489502
// Create an array of pivot indices:
490503
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
491504

492505
// Define the expected output array:
493-
expected = reverse( mat.slice() );
494-
expected = new Complex128Array( flatten( expected, sh, false ) );
506+
expectedMat = reverse( mat.slice() );
507+
expectedBuf = flatten( expectedMat, sh, false );
508+
expectedBuf = flatten( expectedBuf, [ numel( sh ), 2 ], false );
509+
expected = new Complex128Array( expectedBuf );
495510

496511
// Interchange rows:
497512
out = zlaswp( ord, sh[1], A, sh[1], 3, 4, IPIV, 1 );

0 commit comments

Comments
 (0)