Accord.Genetic.PermutationChromosome.CreateIndexDictionary C# (CSharp) Method

CreateIndexDictionary() private static method

private static CreateIndexDictionary ( ushort genes ) : ushort[]
genes ushort
return ushort[]
        private static ushort[] CreateIndexDictionary(ushort[] genes)
        {
            ushort[] indexDictionary = new ushort[genes.Length];

            for (int i = 0, n = genes.Length; i < n; i++)
            {
                indexDictionary[genes[i]] = (ushort)i;
            }

            return indexDictionary;
        }
    }