コード例 #1
0
ファイル: Tester.cs プロジェクト: whoaitsjoe/LatticePolytopes
        public static void testGenUV()
        {
            List <Point> u;

            u = GenerateUV.generateU();
            int vCount = 0;

            foreach (Point ui in u)
            {
                List <Point> v = GenerateUV.generateV(ui);

                vCount += v.Count;
                Console.WriteLine("u: " + ui);
                MainClass.display(v);
            }

            Console.WriteLine("Total number of uv pairs: " + vCount);
        }
コード例 #2
0
        public static void shelling()
        {
            List <Graph> tempResult, shellings, polytopes, uniquePolytopes, retractablePolytopes, finalPolytopes;
            List <Point> vertices = new List <Point>();
            List <Point> startPoints, endPoints;
            List <Tuple <Point, Point> > allPoints = new List <Tuple <Point, Point> >();

            startPoints = GenerateUV.generateU();

            foreach (Point p in startPoints)
            {
                endPoints = GenerateUV.generateV(p);
                foreach (Point q in endPoints)
                {
                    allPoints.Add(new Tuple <Point, Point>(p, q));
                }
            }
            Console.WriteLine("Total u,v pairs: " + allPoints.Count);

            List <Graph> allShelling               = new List <Graph>();
            int          totalShellings            = 0;

            foreach (Tuple <Point, Point> item in allPoints)
            {
                Globals.convexHullCount = 0;
                Console.WriteLine("Start Point: " + item.Item1 + ". End Point: " + item.Item2);
                Globals.u = item.Item1;
                Globals.v = item.Item2;

                tempResult = Shell.shell(item.Item1, item.Item2);
                allShelling.AddRange(tempResult);

                Parse.writeToFile(tempResult, Globals.directory + Globals.d.ToString() + Globals.k.ToString()
                                  + Globals.gap.ToString() + "/_" + item.Item1.Coordinates[0] + item.Item1.Coordinates[1]
                                  + item.Item1.Coordinates[2] + item.Item2.Coordinates[0] + item.Item2.Coordinates[1]
                                  + item.Item2.Coordinates[2] + "allShellings");

                Console.WriteLine("Number of Convex Hulls checked: " + Globals.convexHullCount);

                totalShellings += allShelling.Count;

                Console.WriteLine(allShelling.Count);
            }
            Console.WriteLine("Total Shellings: " + totalShellings);

            if (Globals.writeToFile)
            {
                Parse.writeToFile(allShelling, Globals.directory + Globals.d.ToString() + Globals.k.ToString()
                                  + Globals.gap.ToString() + "/_allShellings");
            }

            Shell.symmetryGroup(allShelling, out shellings);

            Console.WriteLine("Unique Shellings: " + shellings.Count);

            if (Globals.writeToFile)
            {
                Parse.writeToFile(shellings, Globals.directory + Globals.d.ToString() + Globals.k.ToString()
                                  + Globals.gap.ToString() + "/_uniqueShellings");
            }

            polytopes = Shell.checkInterior(shellings);
            Shell.symmetryGroup(polytopes, out uniquePolytopes);

            Console.WriteLine("All valid polytopes: " + polytopes.Count);

            if (Globals.writeToFile)
            {
                Parse.writeToFile(polytopes, Globals.directory + Globals.d.ToString() + Globals.k.ToString()
                                  + Globals.gap.ToString() + "/_allPolytopes");
            }

            Console.WriteLine("Unique polytopes: " + uniquePolytopes.Count);

            if (Globals.writeToFile)
            {
                Parse.writeToFile(polytopes, Globals.directory + Globals.d.ToString() + Globals.k.ToString()
                                  + Globals.gap.ToString() + "/_uniquePolytopes");
            }


            retractablePolytopes = Shell.retractable(uniquePolytopes);
            Shell.symmetryGroup(retractablePolytopes, out finalPolytopes);

            Console.WriteLine("Retractable polytopes: " + uniquePolytopes.Count);

            if (Globals.writeToFile)
            {
                Parse.writeToFile(polytopes, Globals.directory + Globals.d.ToString() + Globals.k.ToString()
                                  + Globals.gap.ToString() + "/_retractablePolytopes");
            }

            Console.WriteLine("Final polytopes: " + uniquePolytopes.Count);

            if (Globals.writeToFile)
            {
                Parse.writeToFile(polytopes, Globals.directory + Globals.d.ToString() + Globals.k.ToString()
                                  + Globals.gap.ToString() + "/_finalPolytopes");
            }
        }