Example #1
0
        public static bool DotIsRegular(Dot dot, Edge edge, Function function)
        {
            Sheaf      sheaf = new Sheaf(dot, function);
            List <Dot> coveredBySheafDots = new List <Dot>();

            foreach (Edge currentEdge in sheaf.Edges)
            {
                if (!ExtraData.EdgesAreEqual(edge, currentEdge))
                {
                    foreach (Dot currentDot in currentEdge.DotList)
                    {
                        if (!ExtraData.ListContainsDot(currentDot, edge.DotList))
                        {
                            coveredBySheafDots.Add(currentDot);
                        }
                    }
                }
            }
            foreach (Dot currentDot in coveredBySheafDots)
            {
                Sheaf currentSheaf = new Sheaf(currentDot, function);
                if (ExtraData.SheafIsSubsheaf(sheaf, currentSheaf))
                {
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
 public static bool EdgeIsCoveredByNuke(List <Dot> coveredDots, Edge edge)
 {
     foreach (Dot dot in edge.DotList)
     {
         if (!ExtraData.ListContainsDot(dot, coveredDots))
         {
             return(false);
         }
     }
     return(true);
 }
Example #3
0
        public List <Dot> GetCoveredDots()
        {
            List <Dot> result = new List <Dot>();

            foreach (Edge edge in Edges)
            {
                foreach (Dot dot in edge.DotList)
                {
                    if (!ExtraData.ListContainsDot(dot, result))
                    {
                        result.Add(dot);
                    }
                }
            }
            return(result);
        }
Example #4
0
        public static List <Dot> GetCoveredByNukeDots(Function function)
        {
            List <Dot>  result      = new List <Dot>();
            List <Dot>  nuclearDots = function.NuclearDotsList;
            List <Edge> nuke        = function.Nuke;

            foreach (Edge edge in nuke)
            {
                foreach (Dot dot in edge.DotList)
                {
                    if (!ExtraData.ListContainsDot(dot, nuclearDots) && !ExtraData.ListContainsDot(dot, result))
                    {
                        result.Add(dot);
                    }
                }
            }
            return(result);
        }
Example #5
0
 public bool ContainsDot(Dot dot)
 {
     return(ExtraData.ListContainsDot(dot, DotList));
 }