Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.


Multidimensional mutation algorithms

This is a submodule of mir.ndslice.


Function Name Description
Ilya Yaroshenko
void copyMinor(size_t N, IteratorFrom, SliceKind KindFrom, IteratorTo, SliceKind KindTo, IndexIterator)(Slice!(IteratorFrom, N, KindFrom) from, Slice!(IteratorTo, N, KindTo) to, Slice!IndexIterator[N] indices...);
Copies n-dimensional minor.
import mir.ndslice;
//  0  1  2  3
//  4  5  6  7
//  8  9 10 11
auto a = iota!int(3, 4);
auto b = slice!int(2, 2);
copyMinor(a, b, [2, 1].sliced, [0, 3].sliced);
assert(b == [[8, 11], [4, 7]]);
void reverseInPlace(Iterator)(Slice!Iterator slice);
Reverses data in the 1D slice.
import mir.ndslice;
auto s = 5.iota.slice;
assert([4, 3, 2, 1, 0]);