pub struct Bitset { /* private fields */ }
Expand description
任意サイズのbit列を扱う。
Implementations§
Source§impl Bitset
impl Bitset
Sourcepub fn count_ones(&self) -> u32
pub fn count_ones(&self) -> u32
1
が設定されているbitの個数を数える。
Time complexity $O(n)$
Sourcepub fn count_zeros(&self) -> u32
pub fn count_zeros(&self) -> u32
0
が設定されているbitの個数を数える。
Time complexity $O(n)$
pub fn and_count_ones(&self, rhs: &Self) -> u32
pub fn same_size_xor_assign(&mut self, rhs: &Self)
Trait Implementations§
Source§impl BitAndAssign for Bitset
impl BitAndAssign for Bitset
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moreSource§impl BitOrAssign for Bitset
impl BitOrAssign for Bitset
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moreSource§impl BitXorAssign for Bitset
impl BitXorAssign for Bitset
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moreAuto Trait Implementations§
impl Freeze for Bitset
impl RefUnwindSafe for Bitset
impl Send for Bitset
impl Sync for Bitset
impl Unpin for Bitset
impl UnwindSafe for Bitset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more