Ejemplo n.º 1
0
        public static int[] bin(ulong[] priority_data, int binCount, BinningMethod method)
        {
            if (binCount == priority_data.Length)
            {
                int[]        indices       = new int[binCount];
                List <ulong> rawPriorities = new List <ulong>();
                for (int n = 0; n < Config.N; n++)
                {
                    rawPriorities.Add(priority_data[n]);
                }
                rawPriorities.Sort();
                for (int n = 0; n < Config.N; n++)
                {
                    indices[n] = (rawPriorities.Count - rawPriorities.IndexOf(priority_data[n]));
                }
            }
            switch (method)
            {
            case BinningMethod.KMEANS:
                return(kmeans(priority_data, 8, binCount));

            default:
                throw new Exception("Unhandled binning method type!");
            }
        }
Ejemplo n.º 2
0
 public static int[] bin(ulong[] priority_data, int binCount, BinningMethod method)
 {
     if (binCount == priority_data.Length)
     {
         int[] indices = new int[binCount];
         List<ulong> rawPriorities = new List<ulong>();
         for (int n = 0; n < Config.N; n++)
             rawPriorities.Add(priority_data[n]);
         rawPriorities.Sort();
         for (int n = 0; n < Config.N; n++)
             indices[n] = (rawPriorities.Count - rawPriorities.IndexOf(priority_data[n]));
     }
     switch (method)
     {
         case BinningMethod.KMEANS:
             return kmeans(priority_data, 8, binCount);
         default:
             throw new Exception("Unhandled binning method type!");
     }
 }