AIMA.Probability.Util.ProbabilityTable.createRadixs C# (CSharp) Method

createRadixs() private method

private createRadixs ( RVInfo>.Map mapRtoInfo ) : int[]
mapRtoInfo RVInfo>.Map
return int[]
        private int[] createRadixs(Map<RandomVariable, RVInfo> mapRtoInfo)
        {
            int[] r = new int[mapRtoInfo.size()];
            // Read in reverse order so that the enumeration
            // through the distributions is of the following
            // order using a MixedRadixNumber, e.g. for two Booleans:
            // X Y
            // true true
            // true false
            // false true
            // false false
            // which corresponds with how displayed in book.
            int x = mapRtoInfo.size() - 1;
            foreach (RVInfo rvInfo in
            mapRtoInfo.values())
            {
                r[x] = rvInfo.getDomainSize();
                rvInfo.setRadixIdx(x);
                x--;
            }
            return r;
        }