Created
December 27, 2012 11:56
-
-
Save anonymous/4387720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public unsafe long[] EvalRandom(int instance) | |
{ | |
fixed (int* HR = he.HR) | |
{ | |
int p; | |
if (Hands == null || Hands.Length == 0) | |
throw new InvalidOperationException("No hands to evaluate"); | |
for (int i = instance; i < Hands.Length; i += Instances) | |
{ | |
p = HR[53 + Hands[i][0] + 1]; | |
p = HR[p + Hands[i][1] + 1]; | |
p = HR[p + Hands[i][2] + 1]; | |
p = HR[p + Hands[i][3] + 1]; | |
p = HR[p + Hands[i][4] + 1]; | |
p = HR[p + Hands[i][5] + 1]; | |
handTypeSum[(HR[p + Hands[i][6]+1] >> 24)]++; | |
} | |
return handTypeSum; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//Parallelization
Parallel.For(0, Environment.ProcessorCount, i => { handTypeSum[i] = func.Invoke().EvalRandom(i); });