dalicious.algorithm.comparison

Some additional alogorithm functions.

Members

Functions

cmpLexicographically
int cmpLexicographically(T a, T b)

Compare a and b lexicographically by applying each fun to them. For unary functions compares fun(a) < fun(b).

isPermutation
bool isPermutation(R1 r1, R2 r2)
bool isPermutation(R1 r1, R2 r2, size_t[] index)

Checks if both ranges are permutations of each other.

Templates

orderLexicographically
template orderLexicographically(fun...)

Order a and b lexicographically by applying each fun to them. For unary functions compares fun(a) < fun(b).

staticPredSwitch
template staticPredSwitch(T...)

Returns one of a collection of expressions based on the value of the switch expression.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE file.

Authors

Arne Ludwig <arne.ludwig@posteo.de>