Skip to content

Commit

Permalink
added expand() method to stochastic
Browse files Browse the repository at this point in the history
  • Loading branch information
tmhglnd committed Nov 9, 2020
1 parent 8cd822b commit 0a91070
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/gen-stochastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,6 @@ exports.pick = pick;
//
function expand(l=1, a=[0, 0]){
a = (Array.isArray(a))? a : [a];
// if (!Array.isArray(a) || l < a.length){
// return a;
// }
// get the differences and pick the expansion options
let p = Stat.change(a);
let chg = pick(l-a.length, p);
Expand All @@ -285,7 +282,6 @@ function expand(l=1, a=[0, 0]){
for (let c in chg){
arr.push(acc += chg[c]);
}
console.log(arr.length);
return arr;
}
exports.expand = expand;
Expand Down
2 changes: 1 addition & 1 deletion test/serialism.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ let arr = [0, 9, 7, 3, 2, 5, -1];
// let arr = Rand.random(10, 0, 12);
// Util.plot(arr)
// Util.plot(Rand.expand(30, arr));
// Util.plot(Rand.expand(30, ));
Util.plot(Rand.expand(30, [5, 6, 3, 4]));

// fullTest();

Expand Down

0 comments on commit 0a91070

Please sign in to comment.