Beispiel #1
0
        public static void SetDefaultEventHandlers( BiGraph graph )
        {
            DirectedGraph.SetDefaultEventHandlers( graph );

            graph.OnAddEdge += new EventHandler<EdgesModifiedEventArgs>(graph.BiGraph_OnAddEdge);
            graph.OnVertexAdded += new EventHandler<VerticesModifiedEventArgs>(graph.graph_OnVertexAdded);
            graph.OnVertexRemoved += new EventHandler<VerticesModifiedEventArgs>(graph.graph_OnVertexRemoved);
        }
Beispiel #2
0
        //public override Matrix IncidentsMatrix
        //{
        //    get
        //    {
        //        Matrix matrix = new Matrix(this.firstPart.Count, this.secondPart.Count);
        //        for (int i = 0; i < this.firstPart.Count; i++)
        //        {
        //            for (int j = 0; j < this.secondPart.Count; j++)
        //            {
        //                WeightedArc arc = this[this.firstPart[i].Value, this.secondPart[j].Value] as WeightedArc;
        //                matrix[j, i] = arc == null ?
        //                    new DoubleMatrixElement(0) : new DoubleMatrixElement(arc.Weight);
        //            }
        //        }
        //        return matrix;
        //    }
        //}
        //public override object[] IncidentsMatrixTopHeaders
        //{
        //    get
        //    {
        //        return this.firstPart.Select( v => v.Value).ToArray();
        //    }
        //}
        //public override object[] IncidentsMatrixLeftHeaders
        //{
        //    get
        //    {
        //        return this.secondPart.Select( v => v.Value ).ToArray();
        //    }
        //}
        public override object Clone()
        {
            BiGraph b = new BiGraph();

            this.CopyTo(b);

            return b;
        }