예제 #1
0
        public static void Ref(int u)
        {
            if (!Kernel.IsIthNode(u) && !Kernel.IsTerminal(u))
            {
                if (Visitor.ContainsKey(u))
                {
                    AddCount(u);
                }
                else
                {
                    if (!Kernel.IsTerminal(Kernel.Low(u)))
                    {
                        Ref(Kernel.Low(u));
                    }

                    AddCount(u);

                    if (!Kernel.IsTerminal(Kernel.High(u)))
                    {
                        Ref(Kernel.High(u));
                    }
                    if (!Visitor.ContainsKey(u))
                    {
                        Visitor.Add(u, 1);
                    }
                }
            }
        }
예제 #2
0
        static void Mark(int u)
        {
            if (Kernel.T[u].mark != true)
            {
                if (!Kernel.IsTerminal(Kernel.Low(u)))
                {
                    Mark(Kernel.Low(u));
                }

                AddMark(u);

                if (!Kernel.IsTerminal(Kernel.High(u)))
                {
                    Mark(Kernel.High(u));
                }
            }
        }
예제 #3
0
        public static void UnRef(int u)
        {
            if (!Kernel.IsIthNode(u) && !Kernel.IsTerminal(u))
            {
                if (Visitor2.ContainsKey(u))
                {
                    DelCount(u);
                    if (Kernel.T[u].refcount == 0)
                    {
                        DelNode(u);
                    }
                }
                else
                {
                    if (!Kernel.IsTerminal(Kernel.Low(u)))
                    {
                        UnRef(Kernel.Low(u));
                    }

                    DelCount(u);

                    if (!Kernel.IsTerminal(Kernel.High(u)))
                    {
                        UnRef(Kernel.High(u));
                    }

                    if (Kernel.T[u].refcount == 0)
                    {
                        DelNode(u);
                    }
                    if (!Visitor2.ContainsKey(u))
                    {
                        Visitor2.Add(u, 1);
                    }
                }
            }
        }