Сount bits until set bit count is reached. Works with ndslices created with mir.ndslice.topology.bitwise, mir.ndslice.allocation.bitSlice.
Implements the higher order filter function. The predicate is passed to mir.functional.naryFun, and can either accept a string, or any callable that can be executed via pred(element).
Authros: Andrei Alexandrescu (original Phobos code), Ilya Yaroshenko (betterC rework)
Checks if all of the elements verify pred.
Like find, but only returns whether or not the search was successful.
Performs three-way recursive lexicographical comparison on two slices according to predicate pred. Iterating sl1 and sl2 in lockstep, cmp compares each N-1 dimensional element e1 of sl1 with the corresponding element e2 in sl2 recursively. If one of the slices has been finished,cmp returns a negative value if sl1 has fewer elements than sl2, a positive value if sl1 has more elements than sl2, and 0 if the ranges have the same number of elements.
Counts elements in slices according to the fun.
The call each!(fun)(slice1, ..., sliceN) evaluates fun for each set of elements x1, ..., xN in slice1, ..., sliceN respectively.
The call eachLower!(fun)(slice1, ..., sliceN) evaluates fun on the lower triangle in slice1, ..., sliceN respectively.
The call each!(fun)(slice1, ..., sliceN) evaluates fun for each set of elements x1, ..., xN in the borders of slice1, ..., sliceN respectively.
The call eachUploPair!(fun)(matrix) evaluates fun for each pair (matrix[j, i], matrix[i, j]), for i <= j (default) or i < j (if includeDiagonal is false).
The call eachUpper!(fun)(slice1, ..., sliceN) evaluates fun on the upper triangle in slice1, ..., sliceN, respectively.
Compares two or more slices for equality, as defined by predicate pred.
Implements the higher order filter function. The predicate is passed to mir.functional.naryFun, and can either accept a string, or any callable that can be executed via pred(element).
Finds a backward index such that pred(slices[0].backward(index), ..., slices[$-1].backward(index)) is true.
Finds an index such that pred(slices[0][index], ..., slices[$-1][index]) is true.
Implements the homonym function (also known as accumulate, compress, inject, or foldl) present in various programming languages of functional flavor. The call fold!(fun)(slice, seed) first assigns seed to an internal variable result, also called the accumulator. Then, for each element x in slice, result = fun(result, x) gets evaluated. Finally, result is returned.
Checks if the matrix is symmetric.
Finds an index such that slice[index] is minimal(maximal).
Finds a backward index such that slice.backward(index) is minimal(maximal).
Finds an index such that slice[index] is minimal(maximal).
Finds a backward index such that slice.backward(index) is minimal(maximal).
Finds a backward indices such that slice[indices[0]] is minimal and slice[indices[1]] is maximal elements in the slice.
Finds a positions (ndslices) such that position[0].first is minimal and position[1].first is maximal elements in the slice.
Implements the higher order filter and map function. The predicate and map functions are passed to mir.functional.naryFun, and can either accept a string, or any callable that can be executed via pred(element) and map(element).
Implements the homonym function (also known as accumulate, compress, inject, or fold) present in various programming languages of functional flavor. The call reduce!(fun)(seed, slice1, ..., sliceN) first assigns seed to an internal variable result, also called the accumulator. Then, for each set of element x1, ..., xN in slice1, ..., sliceN, result = fun(result, x1, ..., xN) gets evaluated. Finally, result is returned.
Lazily iterates unique consecutive elements of the given range (functionality akin to the _uniq system utility). Equivalence of elements is assessed by using the predicate pred, by default "a == b". The predicate is passed to mir.functional.nary, and can either accept a string, or any callable that can be executed via pred(element, element). If the given range is bidirectional, uniq also yields a std,range,primitives.
2020 Ilya Yaroshenko, Kaleidic Associates Advisory Limited, Symmetry Investments 2020 Ilya Yaroshenko, Kaleidic Associates Advisory Limited, Symmetry Investments
This module contains generic iteration algorithms.
Function
Transform function is represented by $(REF_ALTTEXT $(TT map), map, mir, ndslice, topology)$(NBSP) .
All operators are suitable to change slices using ref argument qualification in a function declaration. Note, that string lambdas in Mir are auto ref functions.