Skip to content

Commit b91e028

Browse files
committed
test: add fixtures
1 parent 2b693bf commit b91e028

File tree

8 files changed

+107
-84
lines changed

8 files changed

+107
-84
lines changed

lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_complex_access_pattern.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"offsetY": 3,
1212
"A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 6.0, 999.0, 999.0, 0.0, 0.0, 0.0, 0.0, 3.0, 4.0, 8.0, 9.0, 999.0, 999.0, 0.0, 0.0, 1.0, 0.0, 7.0, 0.0, 11.0, 0.0, 999.0, 999.0 ],
1313
"A_mat": [
14-
[ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ],
15-
[ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ],
16-
[ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ]
14+
[ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
15+
[ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ],
16+
[ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ]
1717
],
1818
"LDA": 5,
1919
"strideA1": -4,

lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_l.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"offsetY": 0,
1212
"A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ],
1313
"A_mat": [
14-
[ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ],
15-
[ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ],
16-
[ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ]
14+
[ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
15+
[ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ],
16+
[ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ]
1717
],
1818
"LDA": 3,
1919
"strideA1": 1,

lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oa.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"offsetY": 0,
1212
"A": [ 999.0, 999.0, 999.0, 999.0, 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ],
1313
"A_mat": [
14-
[ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ],
15-
[ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ],
16-
[ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ]
14+
[ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
15+
[ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ],
16+
[ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ]
1717
],
1818
"LDA": 3,
1919
"strideA1": 1,

lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_ox.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"offsetY": 0,
1212
"A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ],
1313
"A_mat": [
14-
[ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ],
15-
[ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ],
16-
[ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ]
14+
[ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
15+
[ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ],
16+
[ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ]
1717
],
1818
"LDA": 3,
1919
"strideA1": 1,

lib/node_modules/@stdlib/blas/base/cher2/test/fixtures/column_major_oy.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"offsetY": 1,
1212
"A": [ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0, 0.0, 0.0, 7.0, 0.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ],
1313
"A_mat": [
14-
[ 1.0, 0.0, 3.0, 4.0, 5.0, 6.0 ],
15-
[ 0.0, 0.0, 7.0, 0.0, 8.0, 9.0 ],
16-
[ 0.0, 0.0, 0.0, 0.0, 11.0, 0.0 ]
14+
[ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
15+
[ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ],
16+
[ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ]
1717
],
1818
"LDA": 3,
1919
"strideA1": 1,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"order": "column-major",
3+
"uplo": "lower",
4+
"N": 3,
5+
"alpha": [ 1.0, 0.0 ],
6+
"x": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ],
7+
"strideX": 1,
8+
"offsetX": 0,
9+
"y": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ],
10+
"strideY": 1,
11+
"offsetY": 0,
12+
"A": [ 1.0, 0.0, 999.0, 999.0, 999.0, 999.0, 3.0, 4.0, 999.0, 999.0, 999.0, 999.0, 5.0, 6.0, 7.0, 0.0, 0.0, 0.0, 999.0, 999.0, 8.0, 9.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0, 11.0, 0.0 ],
13+
"A_mat": [
14+
[ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
15+
[ 3.0, 4.0, 7.0, 0.0, 8.0, 0.0 ],
16+
[ 5.0, 6.0, 8.0, 9.0, 11.0, 0.0 ]
17+
],
18+
"LDA": 4,
19+
"strideA1": 3,
20+
"strideA2": 4,
21+
"offsetA": 0,
22+
"A_out": [ 11.0, 0.0, 999.0, 999.0, 999.0, 999.0, 25.0, 8.0, 999.0, 999.0, 999.0, 999.0, 39.0, 14.0, 57.0, 0.0, 0.0, 0.0, 999.0, 999.0, 86.0, 13.0, 0.0, 0.0, 0.0, 0.0, 999.0, 999.0, 133.0, 0.0 ]
23+
}

lib/node_modules/@stdlib/blas/base/cher2/test/test.cher2.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var tape = require( 'tape' );
2626
var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
2727
var Complex64Array = require( '@stdlib/array/complex64' );
2828
var Complex64 = require( '@stdlib/complex/float32/ctor' );
29-
var cher = require( './../lib/cher.js' );
29+
var cher2 = require( './../lib/cher2.js' );
3030

3131

3232
// FIXTURES //
@@ -50,12 +50,12 @@ var cyn = require( './fixtures/column_major_yn.json' );
5050

5151
tape( 'main export is a function', function test( t ) {
5252
t.ok( true, __filename );
53-
t.strictEqual( typeof cher, 'function', 'main export is a function' );
53+
t.strictEqual( typeof cher2, 'function', 'main export is a function' );
5454
t.end();
5555
});
5656

5757
tape( 'the function has an arity of 10', function test( t ) {
58-
t.strictEqual( cher.length, 10, 'returns expected value' );
58+
t.strictEqual( cher2.length, 10, 'returns expected value' );
5959
t.end();
6060
});
6161

@@ -80,7 +80,7 @@ tape( 'the function throws an error if provided an invalid first argument', func
8080

8181
function badValue( value ) {
8282
return function badValue() {
83-
cher( value, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, y, strideY, new Complex64Array( data.A ), data.LDA );
83+
cher2( value, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, y, strideY, new Complex64Array( data.A ), data.LDA );
8484
};
8585
}
8686
});
@@ -106,7 +106,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun
106106

107107
function badValue( value ) {
108108
return function badValue() {
109-
cher( data.order, value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA );
109+
cher2( data.order, value, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA );
110110
};
111111
}
112112
});
@@ -131,7 +131,7 @@ tape( 'the function throws an error if provided an invalid third argument', func
131131

132132
function badValue( value ) {
133133
return function badValue() {
134-
cher( data.order, data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA );
134+
cher2( data.order, data.uplo, value, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA );
135135
};
136136
}
137137
});
@@ -154,7 +154,7 @@ tape( 'the function throws an error if provided an invalid sixth argument', func
154154

155155
function badValue( value ) {
156156
return function badValue() {
157-
cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA );
157+
cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), value, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), data.LDA );
158158
};
159159
}
160160
});
@@ -177,7 +177,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun
177177

178178
function badValue( value ) {
179179
return function badValue() {
180-
cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), value, new Complex64Array( data.A ), data.LDA );
180+
cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), value, new Complex64Array( data.A ), data.LDA );
181181
};
182182
}
183183
});
@@ -205,7 +205,7 @@ tape( 'the function throws an error if provided an invalid tenth argument', func
205205

206206
function badValue( value ) {
207207
return function badValue() {
208-
cher( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), value );
208+
cher2( data.order, data.uplo, data.N, new Complex64( data.alpha ), new Complex64Array( data.x ), data.strideX, new Complex64Array( data.y ), strideY, new Complex64Array( data.A ), value );
209209
};
210210
}
211211
});
@@ -227,7 +227,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (
227227

228228
expected = new Complex64Array( data.A_out );
229229

230-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
230+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
231231
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
232232
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
233233

@@ -251,7 +251,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (
251251

252252
expected = new Complex64Array( data.A_out );
253253

254-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
254+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
255255
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
256256
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
257257

@@ -275,7 +275,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (
275275

276276
expected = new Complex64Array( data.A_out );
277277

278-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
278+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
279279
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
280280
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
281281

@@ -299,7 +299,7 @@ tape( 'the function performs hermitian rank 1 operation `A = alpha*x*x**H + A` (
299299

300300
expected = new Complex64Array( data.A_out );
301301

302-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
302+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
303303
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
304304
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
305305

@@ -320,7 +320,7 @@ tape( 'the function returns a reference to the second input matrix (row-major)',
320320
y = new Complex64Array( data.y );
321321
alpha = new Complex64Array( data.alpha );
322322

323-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
323+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
324324
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
325325

326326
t.end();
@@ -340,7 +340,7 @@ tape( 'the function returns a reference to the second input matrix (column-major
340340
y = new Complex64Array( data.y );
341341
alpha = new Complex64Array( data.alpha );
342342

343-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
343+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
344344
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
345345

346346
t.end();
@@ -363,7 +363,7 @@ tape( 'if `N` is `0`, the function returns the second input matrix unchanged (ro
363363

364364
expected = new Complex64Array( data.A );
365365

366-
out = cher( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA );
366+
out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA );
367367
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
368368
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
369369

@@ -387,7 +387,7 @@ tape( 'if `N` is `0`, the function returns the second input matrix unchanged (co
387387

388388
expected = new Complex64Array( data.A );
389389

390-
out = cher( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA );
390+
out = cher2( data.order, data.uplo, 0, alpha, x, data.strideX, y, strideY, a, data.LDA );
391391
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
392392
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
393393

@@ -411,7 +411,7 @@ tape( 'if `α` is `0`, the function returns the second input matrix unchanged (r
411411

412412
expected = new Complex64Array( data.A );
413413

414-
out = cher( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA );
414+
out = cher2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA );
415415
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
416416
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
417417

@@ -435,7 +435,7 @@ tape( 'if `α` is `0`, the function returns the second input matrix unchanged (c
435435

436436
expected = new Complex64Array( data.A );
437437

438-
out = cher( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA );
438+
out = cher2( data.order, data.uplo, data.N, 0.0, x, data.strideX, y, strideY, a, data.LDA );
439439
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
440440
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
441441

@@ -459,7 +459,7 @@ tape( 'the function supports specifying `x` stride (row-major)', function test(
459459

460460
expected = new Complex64Array( data.A_out );
461461

462-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
462+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
463463
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
464464
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
465465

@@ -483,7 +483,7 @@ tape( 'the function supports specifying `x` stride (column-major)', function tes
483483

484484
expected = new Complex64Array( data.A_out );
485485

486-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
486+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
487487
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
488488
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
489489

@@ -507,7 +507,7 @@ tape( 'the function supports specifying negative `x` stride (row-major)', functi
507507

508508
expected = new Complex64Array( data.A_out );
509509

510-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
510+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
511511
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
512512
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
513513

@@ -531,7 +531,7 @@ tape( 'the function supports specifying negative `x` stride (column-major)', fun
531531

532532
expected = new Complex64Array( data.A_out );
533533

534-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
534+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
535535
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
536536
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
537537

@@ -555,7 +555,7 @@ tape( 'the function supports specifying `y` stride (row-major)', function test(
555555

556556
expected = new Complex64Array( data.A_out );
557557

558-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
558+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
559559
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
560560
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
561561

@@ -579,7 +579,7 @@ tape( 'the function supports specifying `y` stride (column-major)', function tes
579579

580580
expected = new Complex64Array( data.A_out );
581581

582-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
582+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
583583
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
584584
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
585585

@@ -603,7 +603,7 @@ tape( 'the function supports specifying negative `y` stride (row-major)', functi
603603

604604
expected = new Complex64Array( data.A_out );
605605

606-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
606+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
607607
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
608608
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
609609

@@ -627,7 +627,7 @@ tape( 'the function supports specifying negative `x` stride (column-major)', fun
627627

628628
expected = new Complex64Array( data.A_out );
629629

630-
out = cher( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
630+
out = cher2( data.order, data.uplo, data.N, alpha, x, data.strideX, y, strideY, a, data.LDA );
631631
t.strictEqual( isSameComplex64Array( out, a ), true, 'returns expected value' );
632632
t.deepEqual( isSameComplex64Array( out, expected ), true, 'returns expected value' );
633633

0 commit comments

Comments
 (0)