Stack allocated uint multiset implementation on rust stable, with optional SIMD implementations available using rust nightly.
The SIMD implementation uses packed_simd (behind a feature
flag). packed_simd
was chosen over alternatives due to it's simplicity and based on the assumption that when
std::simd is stabilised it will look similar in API structure to packed_simd
as it is now.
The implementations in utote
are built using macros rather than generics because there is no generic interface
available for the SIMD types available from packed_simd
. Although there are crates available that enable generic
implementation of SIMD code they either lack features in comparison to packed_simd
, increase the complexity of the
code, or are unstable themselves. The other benefit of using macros is that the actual implementation code is
straightforward.
Since multisets are essentially collections of counters + some useful methods on those counters, and to keep things
simple, implementations are only provided for uint
types. The current Multiset is thus quite low level, perhaps
better serving as a backend for a higher level multiset that works for any given type.
Please see the docs for the API and more information!
T
which uses the uint
implementations as a backend to handle the element
counters.std::simd
is more fully implemented it should be possible to replace most of the macros with generic
implementations. And once this feature is stabilised it will be possible to enable all the SIMD implementations on
the stable toolchain. Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
The implementations in this crate are inspired by generic-array, nalgebra and simba.
choose_random
rand
dependency optionalStdRng
to SmallRng