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
20 changes: 14 additions & 6 deletions lib/node_modules/@stdlib/blas/ext/base/cxpy/test/test.cxpy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
var tape = require( 'tape' );
var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var caddf = require( '@stdlib/complex/float32/base/add' );
var cxpy = require( './../lib/cxpy.js' );


Expand Down Expand Up @@ -283,6 +285,8 @@ tape( 'the function supports view offsets', function test( t ) {

tape( 'if both strides are equal to `1`, the function efficiently adds elements of `x` to the corresponding elements of `y` and assigns the results to `y`', function test( t ) {
var expected;
var xv;
var yv;
var x;
var y;
var i;
Expand All @@ -291,9 +295,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 100 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, y, 1 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand All @@ -302,9 +308,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 240 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, y, 1 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var caddf = require( '@stdlib/complex/float32/base/add' );
var tryRequire = require( '@stdlib/utils/try-require' );


Expand Down Expand Up @@ -292,6 +294,8 @@ tape( 'the function supports view offsets', opts, function test( t ) {

tape( 'if both strides are equal to `1`, the function efficiently adds elements of `x` to the corresponding elements of `y` and assigns the results to `y`', opts, function test( t ) {
var expected;
var xv;
var yv;
var x;
var y;
var i;
Expand All @@ -300,9 +304,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 100 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, y, 1 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand All @@ -311,9 +317,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 240 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, y, 1 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand Down
20 changes: 14 additions & 6 deletions lib/node_modules/@stdlib/blas/ext/base/cxpy/test/test.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
var tape = require( 'tape' );
var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var caddf = require( '@stdlib/complex/float32/base/add' );
var cxpy = require( './../lib/ndarray.js' );


Expand Down Expand Up @@ -283,6 +285,8 @@ tape( 'the function supports view offsets', function test( t ) {

tape( 'if both strides are equal to `1`, the function efficiently adds elements of `x` to the corresponding elements of `y` and assigns the results to `y`', function test( t ) {
var expected;
var xv;
var yv;
var x;
var y;
var i;
Expand All @@ -291,9 +295,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 100 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, 0, y, 1, 0 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand All @@ -302,9 +308,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 240 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, 0, y, 1, 0 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' );
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var caddf = require( '@stdlib/complex/float32/base/add' );
var tryRequire = require( '@stdlib/utils/try-require' );


Expand Down Expand Up @@ -292,6 +294,8 @@ tape( 'the function supports view offsets', opts, function test( t ) {

tape( 'if both strides are equal to `1`, the function efficiently adds elements of `x` to the corresponding elements of `y` and assigns the results to `y`', opts, function test( t ) {
var expected;
var xv;
var yv;
var x;
var y;
var i;
Expand All @@ -300,9 +304,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 100 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, 0, y, 1, 0 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand All @@ -311,9 +317,11 @@ tape( 'if both strides are equal to `1`, the function efficiently adds elements
y = new Complex64Array( 240 );
expected = new Complex64Array( x.length );
for ( i = 0; i < x.length; i++ ) {
x[ i ] = i;
y[ i ] = x.length - i;
expected[ i ] = x[ i ] + y[ i ];
xv = new Complex64( i, 0.0 );
yv = new Complex64( x.length - i, 0.0 );
x.set( xv, i );
y.set( yv, i );
expected.set( caddf( xv, yv ), i );
}
cxpy( x.length, x, 1, 0, y, 1, 0 );
t.strictEqual( isSameComplex64Array( y, expected ), true, 'returns expected value' );
Expand Down