Analyzer.WakitaTsurumiClusterDetector.tryPartition C# (CSharp) Method

tryPartition() public method

public tryPartition ( IGraph graph, BackgroundWorker bgw, Groups &results ) : bool
graph IGraph
bgw System.ComponentModel.BackgroundWorker
results Groups
return bool
        public override bool tryPartition(IGraph graph, BackgroundWorker bgw, out Groups results)
        {
            ICollection<Community> oGraphMetrics;
            Groups oGroups;
            int i = 1;
            bool rv = TryCalculateClustersWakitaTsurumi(graph, bgw, out oGraphMetrics);
            if (rv == true)
            {
                oGroups = new Groups(oGraphMetrics.Count);
                foreach (Community m in oGraphMetrics)
                {
                    oGroups.Add(i, m);
                    i++;
                }
            }
            else oGroups = new Groups(1);
            results = oGroups;
            return rv;

        }