Module utils

Source
Expand description

A collection of various utility helpers.

Structs§

DefaultDistributionSampler
Provides way to sample from different distributions.
DefaultRandom
A default random implementation.
Environment
Keeps track of environment specific information which influences algorithm behavior.
FixedBitArray
A bit array type of fixed size.
GenericError
A basic error type which, essentially, a wrapper on String type.
Noise
Provides way to generate some noise to floating point value.
Parallelism
Specifies data parallelism settings.
RandomGen
Provides underlying random generator API.
SelectionSamplingIterator
An iterator which visits given range using selection sampling (Algorithm S).
ThreadPool
Represents a thread pool wrapper.
TimeQuota
A time quota.

Enums§

Either
Represents a type with two values.

Traits§

CollectGroupBy
An iterator which collects items into group.
DistributionSampler
Provides the way to sample from different distributions.
Quota
Specifies a computational quota for executions. The main purpose is to allow to stop algorithm in reaction to external events such as user cancellation, timer, etc.
Random
Provides the way to use randomized values in generic way.
SelectionSamplingSearch
Provides way to search with help of selection sampling algorithm on iterator where elements have ordered index values.
UnwrapValue
Unwraps value from inner state.

Functions§

cartesian_product
Creates a cartesian product returning a parallel iterator.
create_range_sampling_iter
Returns a new iterator which samples some range from existing one.
fold_reduce
Performs fold and then reduce operations in parallel.
map_reduce
Performs map reduce operations in parallel.
parallel_collect
Maps collection and collects results into vector in parallel.
parallel_foreach_mut
Performs mutable foreach in parallel.
parallel_into_collect
Maps collection and collects results into vector in parallel.
random_argmax
Returns an index of max element in values. In case of many same max elements, returns the one from them at random.
short_type_name
Returns a short name of a type.

Type Aliases§

Float
Alias to a scalar floating type.
GenericResult
A type alias for result type with GenericError.
InfoLogger
A logger type which is called with various information.
Timer
Implements performance timer functionality, mostly exists due to problem with Instant on wasm32 arch.