is inefficient because the reshape operation breaks the memory contiguity of the view. A way to avoid using it is to adapt the class DensityData, and more specifically, the method __getitem__ and __len__ so that, when the getitem is called with index idx, the corresponding subindices for the axis 0 and 1 are computed
Right now this code:
is inefficient because the
reshape
operation breaks the memory contiguity of the view. A way to avoid using it is to adapt the classDensityData
, and more specifically, the method__getitem__
and__len__
so that, when the getitem is called with indexidx
, the corresponding subindices for the axis 0 and 1 are computed