diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index e8c3849..75c796a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,8 @@ impl Cube { let dt = self.t ^ other.t; let df = self.f ^ other.f; + // NOTE: this should be compiled with all optimizations possible + // as `.count_ones()` is bottleneck if dt == df && dt.count_ones() == 1 { Some(Self { t: self.t & other.t, @@ -64,8 +66,9 @@ fn minimize_prime_implicants(n: usize, minterms: &[usize], maxterms: &[usize]) - let mut new_cubes = HashSet::new(); for i in 0..current_cubes.len() { + let a = ¤t_cubes[i]; + for j in i + 1..current_cubes.len() { - let a = ¤t_cubes[i]; let b = ¤t_cubes[j]; if let Some(combined_cube) = a.combine(b) { |