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
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/blas/base/sdsdot/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );


// VARIABLES //
Expand Down Expand Up @@ -61,7 +61,7 @@ function sdsdot( N, scalar, x, strideX, offsetX, y, strideY, offsetY ) {

dot = scalar;
if ( N <= 0 ) {
return float64ToFloat32( dot );
return f32( dot );
}
ix = offsetX;
iy = offsetY;
Expand All @@ -79,21 +79,21 @@ function sdsdot( N, scalar, x, strideX, offsetX, y, strideY, offsetY ) {
}
}
if ( N < M ) {
return float64ToFloat32( dot );
return f32( dot );
}
for ( i = m; i < N; i += M ) {
dot += ( x[ix]*y[iy] ) + ( x[ix+1]*y[iy+1] ) + ( x[ix+2]*y[iy+2] ) + ( x[ix+3]*y[iy+3] ) + ( x[ix+4]*y[iy+4] ); // eslint-disable-line max-len
ix += M;
iy += M;
}
return float64ToFloat32( dot );
return f32( dot );
}
for ( i = 0; i < N; i++ ) {
dot += x[ ix ] * y[ iy ];
ix += strideX;
iy += strideY;
}
return float64ToFloat32( dot );
return f32( dot );
}


Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/base/sdsdot/lib/sdsdot.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var stride2offset = require( '@stdlib/strided/base/stride2offset' );
var ndarray = require( './ndarray.js' );

Expand Down Expand Up @@ -51,7 +51,7 @@ function sdsdot( N, scalar, x, strideX, y, strideY ) {
var ix;
var iy;
if ( N <= 0 ) {
return float64ToFloat32( scalar );
return f32( scalar );
}
ix = stride2offset( N, strideX );
iy = stride2offset( N, strideY );
Expand Down
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/blas/base/sdsdot/test/test.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var Float32Array = require( '@stdlib/array/float32' );
var sdsdot = require( './../lib/ndarray.js' );

Expand Down Expand Up @@ -73,11 +73,11 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
dot = sdsdot( -4, 0.0, x, 1, 0, y, 1, 0 );
t.strictEqual( dot, 0.0, 'returns expected value' );

dot = sdsdot( 0, float64ToFloat32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( 0, f32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );

dot = sdsdot( -4, float64ToFloat32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( -4, f32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );
t.end();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var Float32Array = require( '@stdlib/array/float32' );
var tryRequire = require( '@stdlib/utils/try-require' );

Expand Down Expand Up @@ -82,11 +82,11 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
dot = sdsdot( -4, 0.0, x, 1, 0, y, 1, 0 );
t.strictEqual( dot, 0.0, 'returns expected value' );

dot = sdsdot( 0, float64ToFloat32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( 0, f32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );

dot = sdsdot( -4, float64ToFloat32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( -4, f32( 3.14 ), x, 1, 0, y, 1, 0 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );
t.end();
});

Expand Down
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/blas/base/sdsdot/test/test.sdsdot.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var Float32Array = require( '@stdlib/array/float32' );
var sdsdot = require( './../lib/sdsdot.js' );

Expand Down Expand Up @@ -73,11 +73,11 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
dot = sdsdot( -4, 0.0, x, 1, y, 1 );
t.strictEqual( dot, 0.0, 'returns expected value' );

dot = sdsdot( 0, float64ToFloat32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( 0, f32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );

dot = sdsdot( -4, float64ToFloat32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( -4, f32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );
t.end();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var Float32Array = require( '@stdlib/array/float32' );
var tryRequire = require( '@stdlib/utils/try-require' );

Expand Down Expand Up @@ -82,11 +82,11 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
dot = sdsdot( -4, 0.0, x, 1, y, 1 );
t.strictEqual( dot, 0.0, 'returns expected value' );

dot = sdsdot( 0, float64ToFloat32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( 0, f32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );

dot = sdsdot( -4, float64ToFloat32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, float64ToFloat32( 3.14 ), 'returns expected value' );
dot = sdsdot( -4, f32( 3.14 ), x, 1, y, 1 );
t.strictEqual( dot, f32( 3.14 ), 'returns expected value' );
t.end();
});

Expand Down