Virtual (or lazy) representation of a repeated array

Maybe a combination of FillArrays and BlockArrays?

sz = (64, 64, 2, 10589)
tmp = reshape(range(-1,1,64),(:,1,1,1));
x = repeat(tmp,1,sz[2],sz[3],sz[4]);
using FillArrays, BlockArrays
y = mortar(Fill(tmp, (1,sz[2:4]...)))
x == y #true

This is almost purely virtual I think.

1 Like