Skip to content
Open
119 changes: 60 additions & 59 deletions lib/node_modules/@stdlib/blas/base/srotm/test/test.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ tape( 'the function applies a modified Givens plane rotation (sx=1, sy=1)', func
oy = [ 0, 0, 0, 0 ];

xe = [
new Float32Array( [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -0.9, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -0.9, 2.8, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -0.9, 2.8, -1.4, -1.3, 0.9, -0.3, -0.4 ] )
new Float32Array([ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -0.9, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -0.9, 2.8, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -0.9, 2.8, -1.4, -1.3, 0.9, -0.3, -0.4 ])
];
ye = [
new Float32Array( [ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ 1.7, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ 1.7, -0.7, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ 1.7, -0.7, -0.7, 2.3, -0.6, 0.2, 0.8 ] )
new Float32Array([ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ 1.7, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ 1.7, -0.7, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ 1.7, -0.7, -0.7, 2.3, -0.6, 0.2, 0.8 ])
];

for ( i = 0; i < N.length; i++ ) {
Expand Down Expand Up @@ -143,16 +143,16 @@ tape( 'the function applies a modified Givens plane rotation (sx=2, sy=-2)', fun
oy = [ 0, 0, 2, 6 ];

xe = [
new Float32Array( [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ 3.5, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ 3.3, 0.1, -2.0, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ 3.8, 0.1, -3.1, 0.8, 4.8, -0.3, -1.5 ] )
new Float32Array([ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ 3.5, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ 3.3, 0.1, -2.0, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ 3.8, 0.1, -3.1, 0.8, 4.8, -0.3, -1.5 ])
];
ye = [
new Float32Array( [ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ -2.6, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ -1.5, -0.9, -1.8, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ -1.6, -0.9, -2.1, 0.7, 2.9, 0.2, -3.8 ] )
new Float32Array([ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ -2.6, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ -1.5, -0.9, -1.8, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ -1.6, -0.9, -2.1, 0.7, 2.9, 0.2, -3.8 ])
];

for ( i = 0; i < N.length; i++ ) {
Expand Down Expand Up @@ -191,16 +191,16 @@ tape( 'the function applies a modified Givens plane rotation (sx=-2, sy=1)', fun
oy = [ 0, 0, 0, 0 ];

xe = [
new Float32Array( [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -0.9, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ 3.3, 0.1, -2.0, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -1.5, 0.1, -1.4, 0.8, 3.6, -0.3, -1.9 ] )
new Float32Array([ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -0.9, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ 3.3, 0.1, -2.0, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -1.5, 0.1, -1.4, 0.8, 3.6, -0.3, -1.9 ])
];
ye = [
new Float32Array( [ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ 1.7, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ -0.5, 0.3, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ -0.3, 0.9, -0.7, 1.9, -0.6, 0.2, 0.8 ] )
new Float32Array([ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ 1.7, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ -0.5, 0.3, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ -0.3, 0.9, -0.7, 1.9, -0.6, 0.2, 0.8 ])
];

for ( i = 0; i < N.length; i++ ) {
Expand Down Expand Up @@ -239,16 +239,16 @@ tape( 'the function applies a plane rotation (sx=-1, sy=-2)', function test( t )
oy = [ 0, 0, 2, 6 ];

xe = [
new Float32Array( [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -0.9, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ] ),
new Float32Array( [ -0.9, -0.8, 1.3, -1.6, 0.9, -0.3, -0.4 ] )
new Float32Array([ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -0.9, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ]),
new Float32Array([ -0.9, -0.8, 1.3, -1.6, 0.9, -0.3, -0.4 ])
];
ye = [
new Float32Array( [ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ 1.7, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ] ),
new Float32Array( [ 1.7, -0.9, 0.5, 0.7, -1.6, 0.2, 2.4 ] )
new Float32Array([ 0.5, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ 1.7, -0.9, 0.3, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ]),
new Float32Array([ 1.7, -0.9, 0.5, 0.7, -1.6, 0.2, 2.4 ])
];

for ( i = 0; i < N.length; i++ ) {
Expand Down Expand Up @@ -283,7 +283,7 @@ tape( 'the function applies a plane rotation', function test( t ) {
9.0,
10.0 // 2
]);
param = new Float32Array( [ -1.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ -1.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 3, x, 2, 0, y, 2, 0, param );

Expand Down Expand Up @@ -319,7 +319,7 @@ tape( 'the function applies a plane rotation', function test( t ) {
9.0, // 1
10.0
]);
param = new Float32Array( [ 1.0, 0.0, 2.0, 3.0, 0.0 ] );
param = new Float32Array([ 1.0, 0.0, 2.0, 3.0, 0.0 ]);

srotm( 2, x, 3, 0, y, 3, 0, param );

Expand Down Expand Up @@ -366,7 +366,7 @@ tape( 'the function supports an `x` stride', function test( t ) {
10.0
]);

param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ 0.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, 2, 0, y, 1, 0, param );

Expand Down Expand Up @@ -402,7 +402,7 @@ tape( 'the function supports an `x` stride', function test( t ) {
9.0,
10.0
]);
param = new Float32Array( [ -1.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ -1.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, 3, 0, y, 1, 0, param );

Expand Down Expand Up @@ -449,12 +449,12 @@ tape( 'the function supports an `x` offset', function test( t ) {
10.0
]);

param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ 0.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, 1, 1, y, 2, 0, param );

xe = new Float32Array( [ 1.0, -16.0, -21.0, 4.0, 5.0 ] );
ye = new Float32Array( [ 10.0, 7.0, 14.0, 9.0, 10.0 ] );
xe = new Float32Array([ 1.0, -16.0, -21.0, 4.0, 5.0 ]);
ye = new Float32Array([ 10.0, 7.0, 14.0, 9.0, 10.0 ]);

isApprox( t, x, xe, 2.0 );
isApprox( t, y, ye, 2.0 );
Expand All @@ -473,7 +473,7 @@ tape( 'the function supports an `x` offset', function test( t ) {
9.0,
10.0
]);
param = new Float32Array( [ -1.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ -1.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, -2, 2, y, 1, 0, param );

Expand Down Expand Up @@ -509,7 +509,7 @@ tape( 'the function supports an `x` offset', function test( t ) {
9.0,
10.0
]);
param = new Float32Array( [ 1.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ 1.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 3, x, -2, 4, y, 1, 0, param );

Expand Down Expand Up @@ -555,7 +555,7 @@ tape( 'the function supports a `y` stride', function test( t ) {
9.0,
10.0 // 2
]);
param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ 0.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 3, x, 1, 0, y, 2, 0, param );

Expand Down Expand Up @@ -591,7 +591,7 @@ tape( 'the function supports a `y` stride', function test( t ) {
9.0, // 1
10.0
]);
param = new Float32Array( [ -1.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ -1.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, 1, 0, y, 3, 0, param );

Expand Down Expand Up @@ -638,12 +638,12 @@ tape( 'the function supports a `y` offset', function test( t ) {
10.0
]);

param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ 0.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, 1, 0, y, 2, 1, param );

xe = new Float32Array( [ -20.0, -25.0, 3.0, 4.0, 5.0 ] );
ye = new Float32Array( [ 6.0, 9.0, 8.0, 13.0, 10.0 ] );
xe = new Float32Array([ -20.0, -25.0, 3.0, 4.0, 5.0 ]);
ye = new Float32Array([ 6.0, 9.0, 8.0, 13.0, 10.0 ]);

isApprox( t, x, xe, 2.0 );
isApprox( t, y, ye, 2.0 );
Expand All @@ -662,7 +662,7 @@ tape( 'the function supports a `y` offset', function test( t ) {
9.0,
10.0
]);
param = new Float32Array( [ 1.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ 1.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, 1, 0, y, -2, 2, param );

Expand Down Expand Up @@ -698,7 +698,7 @@ tape( 'the function supports a `y` offset', function test( t ) {
9.0,
10.0 // 0
]);
param = new Float32Array( [ -1.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ -1.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 3, x, 1, 0, y, -2, 4, param );

Expand Down Expand Up @@ -729,13 +729,14 @@ tape( 'the function returns a reference to the second input array', function tes
var x;
var y;

x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );
param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] );
x = new Float32Array([1.0, 2.0, 3.0, 4.0, 5.0]);
y = new Float32Array([6.0, 7.0, 8.0, 9.0, 10.0]);

out = srotm( x.length, x, 1, 0, y, 1, 0, param );
param = new Float32Array([0.0, 0.0, 2.0, -3.0, 0.0]);

t.strictEqual( out, y, 'returns expected value' );
out = srotm(3, x, 1, 0, y, 1, 0, param);

t.strictEqual(out, y, 'returns expected value');
t.end();
});

Expand All @@ -746,9 +747,9 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav
var x;
var y;

x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );
param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] );
x = new Float32Array([ 1.0, 2.0, 3.0, 4.0, 5.0 ]);
y = new Float32Array([ 6.0, 7.0, 8.0, 9.0, 10.0 ]);
param = new Float32Array([ 0.0, 0.0, 2.0, -3.0, 0.0 ]);

xe = new Float32Array( x.length );
scopy( x.length, x, 1, xe, 1 );
Expand Down Expand Up @@ -792,12 +793,12 @@ tape( 'the function supports complex access patterns', function test( t ) {
0.2,
0.8
]);
param = new Float32Array( [ 0.0, 0.0, 2.0, -3.0, 0.0 ] );
param = new Float32Array([ 0.0, 0.0, 2.0, -3.0, 0.0 ]);

srotm( 2, x, -1, 1, y, -2, 2, param );

xe = new Float32Array( [ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ] );
ye = new Float32Array( [ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ] );
xe = new Float32Array([ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ]);
ye = new Float32Array([ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ]);

isApprox( t, x, xe, 5.0 );
isApprox( t, y, ye, 5.0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ tape( 'a FancyArray constructor returns an instance which has a custom `toString
var arr;

dtype = 'generic';
buffer = new Array( 1e4 );
buffer = [];
shape = [ buffer.length ];
order = 'row-major';
strides = [ 1 ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ bench( pkg, function benchmark( b ) {
b.end();
});

bench( format( '%s:factory', pkg ), function benchmark( b ) {

bench( pkg+'::factory', function benchmark( b ) {
var mycdf;
var alpha;
var beta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ bench( pkg, function benchmark( b ) {
b.end();
});

bench( format( '%s:factory', pkg ), function benchmark( b ) {

bench( pkg+'::factory', function benchmark( b ) {
var mylogcdf;
var alpha;
var beta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ bench( pkg, function benchmark( b ) {
b.end();
});

bench( format( '%s:factory', pkg ), function benchmark( b ) {

bench( pkg+'::factory', function benchmark( b ) {
var mylogpdf;
var alpha;
var beta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ bench( pkg, function benchmark( b ) {
b.end();
});

bench( format( '%s:factory', pkg ), function benchmark( b ) {

bench( pkg+'::factory', function benchmark( b ) {
var mymgf;
var alpha;
var beta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ var x = new ndarray( 'float64', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
var v = dmeanors( [ x ] );
// returns 2.5
```

The function has the following parameters:

- **arrays**: array-like object containing a one-dimensional input ndarray.
Expand Down
10 changes: 4 additions & 6 deletions lib/node_modules/@stdlib/stats/fligner-test/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ var print = require( './print.js' ); // eslint-disable-line stdlib/no-redeclare
function repeat( val, len ) {
var out = [];
var i;

for ( i = 0; i < len; i++ ) {
out.push( val );
}
Expand Down Expand Up @@ -158,9 +157,8 @@ function fligner() {
}
loc = median( args[ i ] );
for ( j = 0; j < args[ i ].length; j++ ) {
args[ i ][ j ] -= loc;
}
x = x.concat( args[ i ] );
x.push( args[ i ][ j ] - loc );
}
}
n = x.length;
xabs = [];
Expand All @@ -175,9 +173,9 @@ function fligner() {
for ( i = 0; i < n; i++ ) {
a.push( qnorm( ( 1.0 + ( scores[ i ]/(n+1) ) ) / 2.0, 0.0, 1.0 ) );
sums[ ( levels ) ? indexOf( levels, groups[i] ) : groups[i] ] += a[ i ];
delta = a[ i ] - mean;
delta = a[ a.length - 1 ] - mean;
mean += delta / ( i+1 );
M2 += delta * ( a[ i ] - mean );
M2 += delta * ( a[ a.length - 1 ] - mean );
}
variance = M2 / ( n - 1 );
stat = 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var snanmskminabs = require( '@stdlib/stats/strided/snanmskminabs' );

#### snanmskminabs( N, x, strideX, mask, strideMask )

Computes the minimum absolute value of a single-precision floating-point strided array according to a `mask`, ignoring `NaN` values.
Computes the minimum absolute value of a single-precision floating-point strided arrays according to a `mask`, ignoring `NaN` values.

```javascript
var Float32Array = require( '@stdlib/array/float32' );
Expand Down Expand Up @@ -94,7 +94,7 @@ var v = snanmskminabs( 4, x1, 2, mask1, 2 );

#### snanmskminabs.ndarray( N, x, strideX, offsetX, mask, strideMask, offsetMask )

Computes the minimum absolute value of a single-precision floating-point strided array according to a `mask`, ignoring `NaN` values and using alternative indexing semantics.
Computes the minimum absolute value of a single-precision floating-point strided arrays according to a `mask`, ignoring `NaN` values and using alternative indexing semantics.

```javascript
var Float32Array = require( '@stdlib/array/float32' );
Expand Down