Skip to content

Instantly share code, notes, and snippets.

@9il
Created May 20, 2017 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 9il/6abea2f62adec4ff6e1b5128a8f5af75 to your computer and use it in GitHub Desktop.
Save 9il/6abea2f62adec4ff6e1b5128a8f5af75 to your computer and use it in GitHub Desktop.
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