Derive hash for BitSet and BitMatrix

This commit is contained in:
Tomasz Miąsko 2021-12-14 00:00:00 +00:00
parent dde825db46
commit d496cca3b1

View File

@ -87,7 +87,7 @@ pub fn intersect<Rhs>(&mut self, other: &Rhs) -> bool
/// to or greater than the domain size. All operations that involve two bitsets
/// will panic if the bitsets have differing domain sizes.
///
#[derive(Eq, PartialEq, Decodable, Encodable)]
#[derive(Eq, PartialEq, Hash, Decodable, Encodable)]
pub struct BitSet<T> {
domain_size: usize,
words: Vec<Word>,
@ -987,7 +987,7 @@ pub fn contains(&self, elem: T) -> bool {
///
/// All operations that involve a row and/or column index will panic if the
/// index exceeds the relevant bound.
#[derive(Clone, Eq, PartialEq, Decodable, Encodable)]
#[derive(Clone, Eq, PartialEq, Hash, Decodable, Encodable)]
pub struct BitMatrix<R: Idx, C: Idx> {
num_rows: usize,
num_columns: usize,