Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"order": "column-major",
"uplo": "lower",
"N": 3,
"alpha": 2.0,
"x": [ 0.0, 0.0, 1.0, 2.0, 3.0 ],
"strideX": 1,
"offsetX": 2,
"y": [ 1.0, 2.0, 3.0 ],
"strideY": 1,
"offsetY": 0,
"A": [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ],
"lda": 3,
"strideA1": 1,
"strideA2": 3,
"offsetA": 0,
"A_out": [ 5.0, 9.0, 13.0, 0.0, 18.0, 26.0, 0.0, 0.0, 39.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"order": "column-major",
"uplo": "lower",
"N": 3,
"alpha": 2.0,
"x": [ 1.0, 2.0, 3.0 ],
"strideX": 1,
"offsetX": 0,
"y": [ 0.0, 0.0, 1.0, 2.0, 3.0 ],
"strideY": 1,
"offsetY": 2,
"A": [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ],
"lda": 3,
"strideA1": 1,
"strideA2": 3,
"offsetA": 0,
"A_out": [ 5.0, 9.0, 13.0, 0.0, 18.0, 26.0, 0.0, 0.0, 39.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"order": "row-major",
"uplo": "lower",
"N": 3,
"alpha": 2.0,
"x": [ 0.0, 0.0, 1.0, 2.0, 3.0 ],
"strideX": 1,
"offsetX": 2,
"y": [ 1.0, 2.0, 3.0 ],
"strideY": 1,
"offsetY": 0,
"A": [ 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0 ],
"lda": 3,
"strideA1": 3,
"strideA2": 1,
"offsetA": 0,
"A_out": [ 5.0, 0.0, 0.0, 9.0, 18.0, 0.0, 13.0, 26.0, 39.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"order": "row-major",
"uplo": "lower",
"N": 3,
"alpha": 2.0,
"x": [ 1.0, 2.0, 3.0 ],
"strideX": 1,
"offsetX": 0,
"y": [ 0.0, 0.0, 1.0, 2.0, 3.0 ],
"strideY": 1,
"offsetY": 2,
"A": [ 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0 ],
"lda": 3,
"strideA1": 3,
"strideA2": 1,
"offsetA": 0,
"A_out": [ 5.0, 0.0, 0.0, 9.0, 18.0, 0.0, 13.0, 26.0, 39.0 ]
}
96 changes: 96 additions & 0 deletions lib/node_modules/@stdlib/blas/base/ssyr2/test/test.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ var rxnyp = require( './fixtures/row_major_xnyp.json' );
var rxpyn = require( './fixtures/row_major_xpyn.json' );
var rxnyn = require( './fixtures/row_major_xnyn.json' );
var roa = require( './fixtures/row_major_oa.json' );
var rox = require( './fixtures/row_major_ox.json' );
var roy = require( './fixtures/row_major_oy.json' );
var rsa1sa2 = require( './fixtures/row_major_sa1_sa2.json' );
var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' );
var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' );
Expand All @@ -51,6 +53,8 @@ var cxnyp = require( './fixtures/column_major_xnyp.json' );
var cxpyn = require( './fixtures/column_major_xpyn.json' );
var cxnyn = require( './fixtures/column_major_xnyn.json' );
var coa = require( './fixtures/column_major_oa.json' );
var cox = require( './fixtures/column_major_ox.json' );
var coy = require( './fixtures/column_major_oy.json' );
var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' );
var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' );
var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' );
Expand Down Expand Up @@ -839,6 +843,98 @@ tape( 'the function supports specifying negative strides for `x` and `y` (column
t.end();
});

tape( 'the function supports specifying an `x` offset (row-major)', function test( t ) {
var expected;
var data;
var out;
var a;
var x;
var y;

data = rox;

a = new Float32Array( data.A );
x = new Float32Array( data.x );
y = new Float32Array( data.y );

expected = new Float32Array( data.A_out );

out = ssyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA );
t.strictEqual( out, a, 'returns expected value' );
t.deepEqual( out, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports specifying an `x` offset (column-major)', function test( t ) {
var expected;
var data;
var out;
var a;
var x;
var y;

data = cox;

a = new Float32Array( data.A );
x = new Float32Array( data.x );
y = new Float32Array( data.y );

expected = new Float32Array( data.A_out );

out = ssyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA );
t.strictEqual( out, a, 'returns expected value' );
t.deepEqual( out, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports specifying a `y` offset (row-major)', function test( t ) {
var expected;
var data;
var out;
var a;
var x;
var y;

data = roy;

a = new Float32Array( data.A );
x = new Float32Array( data.x );
y = new Float32Array( data.y );

expected = new Float32Array( data.A_out );

out = ssyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA );
t.strictEqual( out, a, 'returns expected value' );
t.deepEqual( out, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports specifying a `y` offset (column-major)', function test( t ) {
var expected;
var data;
var out;
var a;
var x;
var y;

data = coy;

a = new Float32Array( data.A );
x = new Float32Array( data.x );
y = new Float32Array( data.y );

expected = new Float32Array( data.A_out );

out = ssyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA );
t.strictEqual( out, a, 'returns expected value' );
t.deepEqual( out, expected, 'returns expected value' );

t.end();
});

tape( 'the function supports complex access patterns (row-major)', function test( t ) {
var expected;
var data;
Expand Down