-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
padStack #1
Comments
|
Draft for 2D: auto pad(S)(S slice, size_t l0, size_t l1)
{
auto e = slice[0 .. $, 0 .. $]; //if contiguous then canonical
auto b = e[0 .. l0].reversed!0;
auto h = e.reversed!0[0 .. l0];
auto d = e[0 .. $, 0 .. l1].retro.reversed!0;
auto f = e.retro.reversed!0[0 .. $, 0 .. l1];
auto a = d[0 .. l0].reversed!0;
auto c = f[0 .. l0].reversed!0;
auto g = d.reversed!0[0 .. l0];
auto k = f.reversed!0[0 .. l0];
return
stack!0(
stack!1(a, b, c),
stack!1(d, e, f),
stack!1(g, h, k),
);
} |
Hmm, probably we can add a multidimensional version to mir-algorithm |
Nice! :)
I agree! |
constant padding was added libmir/mir-algorithm#31 |
edge, symmetric and wrap paddings libmir/mir-algorithm#32 |
This issue is successor for libmir/mir#311.
The text was updated successfully, but these errors were encountered: