tern.algorithm.iteration

Algorithms for doing calculations on a range.

Members

Functions

combinations
size_t[][] combinations(size_t length)

Creates a size_t[][] holding every indices combination of a range of length.

difference
size_t difference(A comparer, B comparee)

Calculates the difference between comparer and comparee.

firstOrDefault
ElementType!T firstOrDefault(T range)

Gets the first value in range that abides by F, or the default value of T.

fold
auto fold(T range)

Folds all values in range based on a predicate.

lastOrDefault
ElementType!T lastOrDefault(T range)

Gets the last value in range that abides by F, or the default value of T.

levenshteinDistance
size_t levenshteinDistance(A comparer, B comparee)

Calculates the distance between comparer and comparee.

mean
ElementType!T mean(T range)

Calculates the mean of all values in range.

permutations
ubyte[][] permutations(size_t length)

Creates a ubyte[][] holding every ubyte[] permutation of a range of length.

repeat
T repeat(T range, size_t iter)

Concats range to itself iter times.

sum
ElementType!T sum(T range)

Calculates the sum of all values in range.

uniq
ElementType!T[] uniq(T range)

Creates an array of all unique values in range.

Meta