-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Non-deterministic enumeration of weights in OverlappingModel #19
Copy link
Copy link
Closed
Description
While porting this over to Kotlin (whee), I discovered what I think is the root cause of my troubles: when populating the patterns and stationary arrays in OverlappingModel, the keys of weight are iterated over. The order of this enumeration is non-deterministic, and the patterns and stationary can vary significantly based on the ordering.
For purposes of enumeration, each item in the dictionary is treated as a KeyValuePair<TKey, TValue> structure representing a value and its key. The order in which the items are returned is undefined.
https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx
The affected code is here:
foreach (int w in weights.Keys)
{
patterns[counter] = patternFromIndex(w);
stationary[counter] = weights[w];
counter++;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels