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(); } }
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(); } }
public KMapTester(KMap map) { Map = map; }