Ejemplo n.º 1
0
            public TreeGroup(TreePart[] a)
            {
                this.Parts    = new TreePart[a.Length - 1];
                this.Smallest = a[0];
                this.Edges    = EdgeSetFactory.NewSet();

                this.Size = a[0].Size;
                int index = 0;

                for (int i = 1; i < a.Length; ++i)
                {
                    this.Size += a[i].Size;

                    this.Edges.Merge(a[i].Edges);

                    if (a[i].Size < Smallest.Size)
                    {
                        this.Parts[index++] = Smallest;
                        this.Smallest       = a[i];
                    }
                    else
                    {
                        this.Parts[index++] = a[i];
                    }
                }
            }
Ejemplo n.º 2
0
            public TreeGroup(TreePart a, TreePart[] b)
            {
                this.Parts    = new TreePart[b.Length];
                this.Smallest = a;
                this.Edges    = EdgeSetFactory.NewSet(a.Edges);

                this.Size = a.Size;
                int index = 0;

                for (int i = 0; i < b.Length; ++i)
                {
                    this.Size += b[i].Size;

                    this.Edges.Merge(b[i].Edges);

                    if (b[i].Size < Smallest.Size)
                    {
                        this.Parts[index++] = Smallest;
                        this.Smallest       = b[i];
                    }
                    else
                    {
                        this.Parts[index++] = b[i];
                    }
                }
            }
 /**
  * Construct a new fast lookup directed specifics.
  *
  * @param abstractBaseGraph the graph for which these specifics are for
  * @param vertexMap map for the storage of vertex edge sets
  * @param edgeSetFactory factory for the creation of vertex edge sets
  */
 public FastLookupDirectedSpecifics(
     AbstractBaseGraph <V, E> abstractBaseGraph, Dictionary <V, DirectedEdgeContainer <V, E> > vertexMap,
     EdgeSetFactory <V, E> edgeSetFactory)
     : base(abstractBaseGraph, vertexMap, edgeSetFactory)
 {
     this.touchingVerticesToEdgeMap = new Dictionary <KeyValuePair <V, V>, ArrayUnenforcedSet <E> >();
 }
Ejemplo n.º 4
0
            public TreePart(ushort start)
            {
                this.Nodes = NodeSetFactory.NewSet();
                this.Edges = EdgeSetFactory.NewSet();
                this.Size  = 0;

                this.Nodes.Add(start);
            }
Ejemplo n.º 5
0
 /**
  * Construct a new directed specifics.
  *
  * @param abstractBaseGraph the graph for which these specifics are for
  * @param vertexMap map for the storage of vertex edge sets
  * @param edgeSetFactory factory for the creation of vertex edge sets
  */
 public DirectedSpecifics(
     AbstractBaseGraph <V, E> abstractBaseGraph,
     Dictionary <V, DirectedEdgeContainer <V, E> > vertexMap,
     EdgeSetFactory <V, E> edgeSetFactory)
 {
     this.abstractBaseGraph = abstractBaseGraph;
     this.vertexMapDirected = vertexMap;
     this.edgeSetFactory    = edgeSetFactory;
 }
Ejemplo n.º 6
0
 public DirectedEdgeContainer(EdgeSetFactory <V, E> edgeSetFactory, V vertex)
 {
     incoming = edgeSetFactory.createEdgeSet(vertex);
     outgoing = edgeSetFactory.createEdgeSet(vertex);
 }
Ejemplo n.º 7
0
 public TreePart(TreePart clone)
 {
     this.Nodes = NodeSetFactory.NewSet(clone.Nodes);
     this.Edges = EdgeSetFactory.NewSet(clone.Edges);
     this.Size  = clone.Size;
 }