Ejemplo n.º 1
0
        internal bool AddPathEdge(PathEdgesPartition NewPathEdge, BddManager Manager)
        {
            Bdd allPaths = GetJointPaths(Manager);
            Bdd tempBdd  = Manager.LogicalOr(allPaths, NewPathEdge.PathEdges);

            if (tempBdd == allPaths)
            {
                allPaths.FreeBdd();
                return(false);
            }

            allPaths.FreeBdd();

            m_PathEdgesByLength.Sort();
            int position = m_PathEdgesByLength.BinarySearch(NewPathEdge);

            bool updated = false;

            if (position >= 0)
            {
                if (m_PathEdgesByLength[position].AddPaths(NewPathEdge.PathEdges, Manager))
                {
                    updated = true;
                }
            }
            else
            {
                m_PathEdgesByLength.Add(NewPathEdge);
                updated = true;
                m_PathEdgesByLength.Sort();
            }

            return(updated);
        }
Ejemplo n.º 2
0
        public int CompareTo(object obj)
        {
            if (obj is PathEdgesPartition)
            {
                PathEdgesPartition path = (PathEdgesPartition)obj;

                return(m_Length.CompareTo(path.Length));
            }

            throw new ArgumentException("object is not a PathEdgePartition");
        }