Exemple #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);
        }
 public static void AddEdges(List <Edge> edges, List <Edge> list)
 {
     foreach (Edge currentEdge in edges)
     {
         bool isNew = true;
         foreach (Edge listEdge in list)
         {
             if (ExtraData.EdgesAreEqual(listEdge, currentEdge))
             {
                 isNew = false;
             }
         }
         if (isNew)
         {
             list.Add(currentEdge);
         }
     }
 }