Esempio n. 1
0
        public static void PrintTestResults(this KMap map, bool only_min = false)
        {
            var tester = new KMapTester(map);

            (var result, var n, var coverage) = tester.Test(only_min);
            if (result)
            {
                Console.WriteLine("TEST: OK");
            }
            else
            {
                Console.WriteLine($"TEST: FAILED - with the following coverage:");
                coverage.PrintCoverage();
            }
        }
Esempio n. 2
0
        public static void PrintCoverages(this KMap map, bool only_min = true)
        {
            var coverages = map.Minimize();

            if (coverages.Count == 0)
            {
                return;
            }
            var min_cost = coverages.Min(c => c.Cost.Value);

            foreach (var coverage in coverages)
            {
                if (only_min && coverage.Cost.Value > min_cost)
                {
                    continue;
                }
                coverage.PrintCoverage();
            }
        }
Esempio n. 3
0
 public KMapTester(KMap map)
 {
     Map = map;
 }