コード例 #1
0
            public EulerHalfEdge Link(EulerVertex other)
            {
                //Create half edges and link them to each other
                var st = new EulerHalfEdge(this, other, null, null);
                var ts = new EulerHalfEdge(other, this, null, st);

                st.opposite = ts;

                // check whether the nodes are
                if (!this.AreConnected(other))
                {
                    //Move both vertices to root
                    this.MakeRoot();
                    other.MakeRoot();

                    //Insert entries in Euler tours
                    st.node = this.node.Insert(st);
                    ts.node = other.node.Insert(ts);

                    //Link tours together
                    this.node.Concat(other.node);
                }
                //Return half edge
                return(st);
            }
コード例 #2
0
 public void CleanUp()
 {
     node.Remove();
     node.val = null;
     node     = null;
     opposite = null;
     source   = null;
     dest     = null;
 }
コード例 #3
0
            public EulerHalfEdge(EulerVertex s, EulerVertex t, TopTreeNode node, EulerHalfEdge opposite)
            {
                if (s == null)
                {
                    throw new ArgumentNullException("s");
                }
                if (t == null)
                {
                    throw new ArgumentNullException("t");
                }

                this.s        = s;
                this.t        = t;
                this.node     = node;
                this.opposite = opposite;
                this.count    = 1;
            }
コード例 #4
0
        public EulerHalfEdge <T> Link(EulerVertex <T> other, T value)
        {
            // Move both vertices to root
            MakeRoot();
            other.MakeRoot();

            // Create half edges and link them to each other
            var st = new EulerHalfEdge <T>(value, this, other);
            var ts = new EulerHalfEdge <T>(value, other, this);

            ts.opposite = st;
            st.opposite = ts;

            // Insert entries in Euler tours
            st.node = node.Insert(st);
            ts.node = other.node.Insert(ts);

            // Link tours together
            node.Merge(other.node);

            // Return half edge
            return(st);
        }