Skip to content
Closed
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
Expand Up @@ -88,11 +88,9 @@ function plugin( dir ) {

opts = {};
opts.cwd = dir;

args = new Array( 1 );

// Target:
args[ 0 ] = 'view-cov';
// target
args = [];
args.push('view-cov');

proc = spawn( 'make', args, opts );
proc.on( 'error', onError );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ tape( 'the function finds the index of the element with the maximum absolute val
idx = isamax( 4, x, 1 );
t.strictEqual( idx, expected, 'returns expected value' );

x = new Float32Array( [
x = new Float32Array([
0.2, // 1
-0.6, // 2
0.3, // 3
5.0,
5.0
] );
]);
expected = 1;

idx = isamax( 3, x, 1 );
Expand All @@ -86,11 +86,11 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', o
var idx;
var x;

x = new Float32Array( [
x = new Float32Array([
1.0,
2.0,
3.0
] );
]);
expected = -1;

idx = isamax( 0, x, 1 );
Expand Down Expand Up @@ -125,7 +125,7 @@ tape( 'the function supports specifying a negative stride', opts, function test(
var idx;
var x;

x = new Float32Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
x = new Float32Array([ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ]);

idx = isamax( x.length, x, -1 );
t.strictEqual( idx, 2, 'returns expected value' );
Expand Down
18 changes: 8 additions & 10 deletions lib/node_modules/@stdlib/utils/tabulate-by/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,26 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var floor = require( '@stdlib/math/base/special/floor' );

var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var take = require( '@stdlib/array/take' );
var tabulateBy = require( './../lib' );

var vals;
var arr;
var out;
var i;
var j;

function indicator( value ) {
return value[ 0 ];
}

vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ];

// Generate a random collection...
arr = [];
for ( i = 0; i < 100; i++ ) {
j = floor( randu()*vals.length );
arr.push( vals[ j ] );
}
// Generate random indices:
var idx = discreteUniform( 100, 0, vals.length-1 );

// Select values:
arr = take( vals, idx );

// Generate a frequency table:
out = tabulateBy( arr, indicator );
Expand Down
Loading