Ejemplo n.º 1
0
        /// <summary>
        /// This function reads through the dsm vDsmt identifies the identical rows (these are sccs ) and pass back this information(in an object array format) to the calling function
        /// </summary>
        /// <param name="DSM"></param>
        /// <returns></returns>
        private static List <Cluster> GatherClusters(DesignStructureMatrix DSM)
        {
            //gathers the clusters
            var clusterPresent = new List <int>();
            var clusters       = new List <Cluster>(DSM.RowCount);

            for (int c = 0; c < DSM.ColumnCount; c++)
            {
                var clusterlist = new Cluster();
                if (!clusterPresent.Contains(c))
                {
                    clusterPresent.Add(c);
                    clusterlist.Add(c);
                    for (int r = 0; r < DSM.RowCount; r++)
                    {
                        if (c == r)
                        {
                            continue;
                        }

                        if (DSM.Row(c).Equals(DSM.Row(r)))
                        {
                            clusterlist.Add(r);
                            clusterPresent.Add(r);
                        }
                    }
                    clusters.Add(clusterlist);
                    clusterlist = null;
                }
            }
            return(clusters);
        }
Ejemplo n.º 2
0
 public static void CopyDefaultInputs(this DesignStructureMatrix IM, DesignStructureMatrix IMf, Cluster models)
 {
     for (int r = 0; r < IMf.RowCount; r++)
     {
         if (models.Contains(r))
         {
             IM.SetRow(r, IMf.Row(r));
         }
     }
 }