@@ -237,23 +237,12 @@ impl<T: Idx> BitSet<T> {
237237 new_word != word
238238 }
239239
240- /// Gets a slice of the underlying words.
241- pub fn words ( & self ) -> & [ Word ] {
242- & self . words
243- }
244-
245240 /// Iterates over the indices of set bits in a sorted order.
246241 #[ inline]
247242 pub fn iter ( & self ) -> BitIter < ' _ , T > {
248243 BitIter :: new ( & self . words )
249244 }
250245
251- /// Duplicates the set as a hybrid set.
252- pub fn to_hybrid ( & self ) -> HybridBitSet < T > {
253- // Note: we currently don't bother trying to make a Sparse set.
254- HybridBitSet :: Dense ( self . to_owned ( ) )
255- }
256-
257246 /// Set `self = self | other`. In contrast to `union` returns `true` if the set contains at
258247 /// least one bit that is not in `other` (i.e. `other` is not a superset of `self`).
259248 ///
@@ -1601,11 +1590,11 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
16011590 pub fn from_row_n ( row : & BitSet < C > , num_rows : usize ) -> BitMatrix < R , C > {
16021591 let num_columns = row. domain_size ( ) ;
16031592 let words_per_row = num_words ( num_columns) ;
1604- assert_eq ! ( words_per_row, row. words( ) . len( ) ) ;
1593+ assert_eq ! ( words_per_row, row. words. len( ) ) ;
16051594 BitMatrix {
16061595 num_rows,
16071596 num_columns,
1608- words : iter:: repeat ( row. words ( ) ) . take ( num_rows) . flatten ( ) . cloned ( ) . collect ( ) ,
1597+ words : iter:: repeat ( & row. words ) . take ( num_rows) . flatten ( ) . cloned ( ) . collect ( ) ,
16091598 marker : PhantomData ,
16101599 }
16111600 }
@@ -1700,9 +1689,9 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
17001689 assert_eq ! ( with. domain_size( ) , self . num_columns) ;
17011690 let ( write_start, write_end) = self . range ( write) ;
17021691 let mut changed = false ;
1703- for ( read_index, write_index) in iter:: zip ( 0 ..with. words ( ) . len ( ) , write_start..write_end) {
1692+ for ( read_index, write_index) in iter:: zip ( 0 ..with. words . len ( ) , write_start..write_end) {
17041693 let word = self . words [ write_index] ;
1705- let new_word = word | with. words ( ) [ read_index] ;
1694+ let new_word = word | with. words [ read_index] ;
17061695 self . words [ write_index] = new_word;
17071696 changed |= word != new_word;
17081697 }
@@ -2002,54 +1991,6 @@ impl std::fmt::Debug for FiniteBitSet<u32> {
20021991 }
20031992}
20041993
2005- impl FiniteBitSetTy for u64 {
2006- const DOMAIN_SIZE : u32 = 64 ;
2007-
2008- const FILLED : Self = Self :: MAX ;
2009- const EMPTY : Self = Self :: MIN ;
2010-
2011- const ONE : Self = 1u64 ;
2012- const ZERO : Self = 0u64 ;
2013-
2014- fn checked_shl ( self , rhs : u32 ) -> Option < Self > {
2015- self . checked_shl ( rhs)
2016- }
2017-
2018- fn checked_shr ( self , rhs : u32 ) -> Option < Self > {
2019- self . checked_shr ( rhs)
2020- }
2021- }
2022-
2023- impl std:: fmt:: Debug for FiniteBitSet < u64 > {
2024- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
2025- write ! ( f, "{:064b}" , self . 0 )
2026- }
2027- }
2028-
2029- impl FiniteBitSetTy for u128 {
2030- const DOMAIN_SIZE : u32 = 128 ;
2031-
2032- const FILLED : Self = Self :: MAX ;
2033- const EMPTY : Self = Self :: MIN ;
2034-
2035- const ONE : Self = 1u128 ;
2036- const ZERO : Self = 0u128 ;
2037-
2038- fn checked_shl ( self , rhs : u32 ) -> Option < Self > {
2039- self . checked_shl ( rhs)
2040- }
2041-
2042- fn checked_shr ( self , rhs : u32 ) -> Option < Self > {
2043- self . checked_shr ( rhs)
2044- }
2045- }
2046-
2047- impl std:: fmt:: Debug for FiniteBitSet < u128 > {
2048- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
2049- write ! ( f, "{:0128b}" , self . 0 )
2050- }
2051- }
2052-
20531994/// A fixed-sized bitset type represented by an integer type. Indices outwith than the range
20541995/// representable by `T` are considered set.
20551996#[ derive( Copy , Clone , Eq , PartialEq , Decodable , Encodable ) ]
0 commit comments