public object Clone()
        {
            TypesTable <T> copy = new TypesTable <T>();

            foreach (KeyValuePair <IType, Dictionary <IType, T> > row in table)
            {
                foreach (KeyValuePair <IType, T> col in row.Value)
                {
                    copy[row.Key, col.Key] = col.Value;
                }
            }
            return(copy);
        }
        private void Generate()
        {
            int vertices = list.Count;

            graph = new int[vertices, vertices];
            for (int v = 0; v < vertices; ++v)
            {
                graph[v, v] = 1;
                foreach (int u in list[v])
                {
                    graph[v, u] = 1;
                }
            }

            RoyWarshall(graph);

            result = new int[vertices, vertices];
            for (int v = 0; v < vertices; ++v)
            {
                for (int u = 0; u < vertices; ++u)
                {
                    result[v, u] = ClosestCommonSuccessor(v, u);
                }
            }

            PromotionTable = new TypesTable <bool>();
            ResultTable    = new TypesTable <IType>();
            for (int i = 0; i < vertices; ++i)
            {
                for (int j = 0; j < vertices; ++j)
                {
                    PromotionTable[revind[i], revind[j]] = graph[i, j] != 0;
                    int res = result[i, j];
                    if (res == -1)
                    {
                        ResultTable[revind[i], revind[j]] = null;
                    }
                    else
                    {
                        ResultTable[revind[i], revind[j]] = revind[result[i, j]];
                    }
                }
            }
        }