Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,9 +1,8 @@
import std.stdio, std.algorithm, std.array, combinations3;
auto permutationTest(T)(in T[] a, in T[] b) /*pure nothrow*/ {
auto permutationTest(T)(in T[] a, in T[] b) pure nothrow @safe {
immutable tObs = a.sum;
//auto combs = combinations!false(a ~ b, a.length); // Not a Range.
const combs = combinations(a ~ b, a.length).array; // Slow.
auto combs = combinations!false(a ~ b, a.length);
immutable under = combs.count!(perm => perm.sum <= tObs);
return under * 100.0 / combs.length;
}