Skip to content

Instantly share code, notes, and snippets.

@9il
Created May 20, 2017 07:28
Embed
What would you like to do?
import mir.ndslice.slice;
auto copySlow(CanonicalMatrix!ubyte f, CanonicalMatrix!ubyte t)
{
assert(f.shape == t.shape);
foreach(i; 0..f.length!0)
foreach(j; 0..f.length!1)
t[i, j] = f[i, j];
}
auto copyFast(CanonicalMatrix!ubyte f, CanonicalMatrix!ubyte t)
{
assert(f.shape == t.shape);
foreach(i; 0..f.length!0)
foreach(j; 0..f.length!1)
t[i][j] = f[i][j];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment