Struct compacts_bits::Vec32 [] [src]

pub struct Vec32 { /* fields omitted */ }

Map of Vec16(internal).

Methods

impl Vec32
[src]

Optimize innternal data representaions.

impl Vec32
[src]

Clear contents.

Examples

use compacts_bits::Vec32;

let mut bits = Vec32::new();
bits.insert(0);
assert!(bits.count_ones() == 1);
bits.clear();
assert!(bits.count_ones() == 0);

Return true if the value exists.

Examples

use compacts_bits::Vec32;

let mut bits = Vec32::new();
assert_eq!(bits.count_zeros(), 1 << 32);
bits.insert(1);
assert!(!bits.contains(0));
assert!(bits.contains(1));
assert!(!bits.contains(2));
assert_eq!(bits.count_ones(), 1);

Return true if the value doesn't exists and inserted successfuly.

Examples

use compacts_bits::Vec32;
let mut bits = Vec32::new();
assert!(bits.insert(3));
assert!(!bits.insert(3));
assert!(bits.contains(3));
assert_eq!(bits.count_ones(), 1);

Return true if the value exists and removed successfuly.

Examples

use compacts_bits::Vec32;
let mut bits = Vec32::new();
assert!(bits.insert(3));
assert!(bits.remove(3));
assert!(!bits.contains(3));
assert_eq!(bits.count_ones(), 0);

impl Vec32
[src]

Trait Implementations

impl Intersection<Vec32> for Vec32
[src]

impl<'r> Intersection<&'r Vec32> for Vec32
[src]

impl<'r1, 'r2> Intersection<&'r2 Vec32> for &'r1 Vec32
[src]

impl Union<Vec32> for Vec32
[src]

impl<'r> Union<&'r Vec32> for Vec32
[src]

impl<'r1, 'r2> Union<&'r2 Vec32> for &'r1 Vec32
[src]

impl Difference<Vec32> for Vec32
[src]

impl<'r> Difference<&'r Vec32> for Vec32
[src]

impl<'r1, 'r2> Difference<&'r2 Vec32> for &'r1 Vec32
[src]

impl SymmetricDifference<Vec32> for Vec32
[src]

impl<'r> SymmetricDifference<&'r Vec32> for Vec32
[src]

impl<'r1, 'r2> SymmetricDifference<&'r2 Vec32> for &'r1 Vec32
[src]

impl<'r> IntersectionWith<&'r Vec32> for Vec32
[src]

impl<'r> UnionWith<&'r Vec32> for Vec32
[src]

impl<'r> DifferenceWith<&'r Vec32> for Vec32
[src]

impl<'r> SymmetricDifferenceWith<&'r Vec32> for Vec32
[src]

impl Default for Vec32
[src]

Returns the "default value" for a type. Read more

impl Debug for Vec32
[src]

Formats the value using the given formatter.

impl Clone for Vec32
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Index<u32> for Vec32
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl Rank<u32> for Vec32
[src]

Hamming Weight or Population Count.

SIZE: Self::Weight = 1 << 32

Returns occurences of non-zero bit in 0...i. It's equivalent to i+1 - self.rank0(i). Read more

Returns occurences of zero bit in 0...i. It's equivalent to i+1 - self.rank1(i). Read more

impl Select1<u32> for Vec32
[src]

Returns the position of 'c+1'th appearance of non-zero bit.

impl Select0<u32> for Vec32
[src]

Returns the position of 'c+1'th appearance of non-zero bit.