Пример #1
0
        public void Append(ICollection <FeatureItem> itemCollection)
        {
            int currentCount = FeatureItemList.Count;

            FeatureItemList.AddRange(itemCollection);

            //start from 0 (Chin Xi) or from the currently added collection (RR) ? in my opinion it should be from currentCount, otherwise unecessary and redundant calculations
            for (int i = currentCount; i < FeatureItemList.Count; i++)
            {
                FeatureItemList[i].Id = i;          //update Id according to FeatureItemList numeration
                AssignCluster(FeatureItemList[i]);
            }

            //Get items assigned to hyperClusters
            for (int i = 0; i < HyperClusterList.Count; i++)
            {
                HyperClusterList[i].GetHyperClusterItemList();
            }
        }
Пример #2
0
        public void Create(ICollection <FeatureItem> itemCollection)
        {
            FeatureItemList.AddRange(itemCollection);

            ClusterList.Clear();
            HyperClusterList.Clear();
            ItemToClusterMap.Clear();
            ClusterToHyperClusterMap.Clear();

            for (int i = 0; i < FeatureItemList.Count; i++)
            {
                FeatureItemList[i].Id = i;
                AssignCluster(FeatureItemList[i]);
            }

            //Get items assigned to hyperClusters
            for (int i = 0; i < HyperClusterList.Count; i++)
            {
                HyperClusterList[i].GetHyperClusterItemList();
            }
        }