Analyzer.OverallReciprocationCalculator.TryCalculateGraphMetrics C# (CSharp) Method

TryCalculateGraphMetrics() public method

public TryCalculateGraphMetrics ( IGraph graph, BackgroundWorker backgroundWorker, Nullable &reciprocatedVertexPairRatio, Nullable &reciprocatedEdgeRatio ) : System.Boolean
graph IGraph
backgroundWorker System.ComponentModel.BackgroundWorker
reciprocatedVertexPairRatio Nullable
reciprocatedEdgeRatio Nullable
return System.Boolean
        TryCalculateGraphMetrics
        (
            IGraph graph,
            BackgroundWorker backgroundWorker,
            out Nullable<Double> reciprocatedVertexPairRatio,
            out Nullable<Double> reciprocatedEdgeRatio
        )
        {
            Debug.Assert(graph != null);
            
            if (graph.Directedness != GraphDirectedness.Directed)
            {
                reciprocatedVertexPairRatio = reciprocatedEdgeRatio = null;
            }
            else
            {
                HashSet<Int64> oVertexIDPairsOrdered, oVertexIDPairsUnordered;

                CountEdges(graph, out oVertexIDPairsOrdered,
                    out oVertexIDPairsUnordered);

                Int32 iVertexPairsWithBothDirectedEdges =
                    CountVertexPairsWithBothDirectedEdges(
                        graph, oVertexIDPairsOrdered);

                reciprocatedVertexPairRatio = CalculateReciprocatedVertexPairRatio(
                    graph, iVertexPairsWithBothDirectedEdges,
                    oVertexIDPairsUnordered);

                reciprocatedEdgeRatio = CalculateReciprocatedEdgeRatio(
                    graph, iVertexPairsWithBothDirectedEdges);
            }

            return (true);
        }