pub type SparseBinVec = SparseBinVecBase<Vec<usize>>;

Implementations

Creates a vector fill with zeros of the given length.

Example
let vector = SparseBinVec::zeros(3);

assert_eq!(vector.len(), 3);
assert_eq!(vector.weight(), 0);

Creates an empty vector.

This allocate minimally, so it is a good placeholder.

Example
let vector = SparseBinVec::empty();

assert_eq!(vector.len(), 0);
assert_eq!(vector.weight(), 0);

Converts the sparse binary vector to a Vec of the non trivial positions.

Example
let vector = SparseBinVec::new(3, vec![0, 2]);

assert_eq!(vector.to_positions_vec(), vec![0, 2]);