Esempio n. 1
0
        public static List <Edge <TVertex> > CreateAllPairwiseEdges <TVertex>(
            [NotNull, ItemNotNull] IEnumerable <TVertex> leftVertices,
            [NotNull, ItemNotNull] IEnumerable <TVertex> rightVertices,
            [NotNull] EdgeFactory <TVertex, Edge <TVertex> > edgeFactory)
        {
            var edges = new List <Edge <TVertex> >();
            var rightVerticesArray = rightVertices.ToArray();

            foreach (TVertex left in leftVertices)
            {
                foreach (TVertex right in rightVerticesArray)
                {
                    edges.Add(edgeFactory(left, right));
                }
            }

            return(edges);
        }