Yes, I thought about that, but what do I do if I don't know the number of
dimensions beforehand? I guess I have to use templates, but what do I do
for the slices, can I use a list of continguous slices to access the
relevant dimensions?
On Mon, Jan 25, 2021 at 7:21 AM Serge Guelton <
serge.guelton@xxxxxxxxxxxxxxxxxxx> wrote:
On Sun, Jan 24, 2021 at 10:55:53PM +0100, Jochen S wrote:
I'm still banging my head against how to copy a smaller array into alarger
array in c++ with pythran's ndarray (I'm trying to implement the nd fftthought
functions). Neal showed my how this can be done using xtensor and I
could adjust that method, but I can't get it to work.a
So again what I'm trying to do is to copy a (N-n)x(M-m)x(K-k) array into
NxM,K array (however I might have more than 3 dimensions). So in pythonI would
do something like: out[:n,:m,:k] = in, is there some way to do this using
pythran functions?
You can write the code you want in python and use pythran -e to generate
the C++
code, and then use that :-)
out(types::contiguous_slice(0, n, types::none_type()),
types::contiguous_slice(0, m, types::none_type()),
types::contiguous_slice(0, k, types::none_type()))
Should be close to what you need