Crate utote[−][src]
The Utote crate provides a statically allocated implementation of a multiset of unsigned integers.
Each multiset is an ordered collection of unsigned counters, where the index of each counter is the
element of the counter, and the value of that counter is the number of times that element occurrs
in the multiset. A count of zero at index i
indicates that element i
is not in the multiset.
Any multiset where all counters are zero is equivalent to the empty multiset.
Examples
use utote::MSu8; // A multiset of 4 elements, which can be counted up to u8::MAX let multiset = MSu8::<4>::from_slice(&[1, 3, 5, 7]); assert_eq!(multiset.total(), 16); assert_eq!(multiset.get(1), Some(3));
Cargo Features
- packed_simd: Requires nightly rust toolchain. Enables SIMD implementations using the
packed_simd
crate. - rand: Enables
choose_random
methods for multiset structs using therand
crate.
Using SIMD
Optionally the packed_simd crate can be enabled (requires nightly) to allow for multisets which are built either from an array of SIMD vectors, or directly from a single SIMD vector.
[dependencies]
utote = { version = ..., features = ["packed_simd"] }
Although the compiler is is able to auto-vectorise code, these capabilities are provided so that you can explicitly direct the compiler to use SIMD vectors, if they are available.
Examples
use utote::MSu8x2; let multiset = MSu8x2::<2>::from_slice(&[1, 3, 5, 7]); assert_eq!(multiset.total(), 16); assert_eq!(multiset.get(1), Some(3));
Re-exports
pub use packed_simd; |
Structs
Multiset | Multiset! yay |
MultisetIterator |
Type Definitions
MS0u8x2 | Deprecated |
MS0u8x4 | Deprecated |
MS0u8x8 | Deprecated |
MS0u8x16 | Deprecated |
MS0u8x32 | Deprecated |
MS0u8x64 | Deprecated |
MS0u16x2 | Deprecated |
MS0u16x4 | Deprecated |
MS0u16x8 | Deprecated |
MS0u16x16 | Deprecated |
MS0u16x32 | Deprecated |
MS0u32x2 | Deprecated |
MS0u32x4 | Deprecated |
MS0u32x8 | Deprecated |
MS0u32x16 | Deprecated |
MS0u64x2 | Deprecated |
MS0u64x4 | Deprecated |
MS0u64x8 | Deprecated |
MSu8 | |
MSu8x2 | |
MSu8x4 | |
MSu8x8 | |
MSu8x16 | |
MSu8x32 | |
MSu8x64 | |
MSu16 | |
MSu16x2 | |
MSu16x4 | |
MSu16x8 | |
MSu16x16 | |
MSu16x32 | |
MSu32 | |
MSu32x2 | |
MSu32x4 | |
MSu32x8 | |
MSu32x16 | |
MSu64 | |
MSu64x2 | |
MSu64x4 | |
MSu64x8 |