Commit 7023b907 authored by Martin Reinecke's avatar Martin Reinecke

int64_t -> ptrdiff_t

parent 74dd5e0b
......@@ -1966,7 +1966,7 @@ template<typename T0> class pocketfft_r
//
using shape_t = vector<size_t>;
using stride_t = vector<int64_t>;
using stride_t = vector<ptrdiff_t>;
size_t prod(const shape_t &shape)
{
......@@ -1996,10 +1996,10 @@ template<typename T> class ndarr
const shape_t &shape() const { return shp; }
size_t shape(size_t i) const { return shp[i]; }
const stride_t &stride() const { return str; }
const int64_t &stride(size_t i) const { return str[i]; }
T &operator[](int64_t ofs)
const ptrdiff_t &stride(size_t i) const { return str[i]; }
T &operator[](ptrdiff_t ofs)
{ return *reinterpret_cast<T *>(d+ofs); }
const T &operator[](int64_t ofs) const
const T &operator[](ptrdiff_t ofs) const
{ return *reinterpret_cast<const T *>(cd+ofs); }
};
......@@ -2011,8 +2011,8 @@ template<size_t N, typename Ti, typename To> class multi_iter
ndarr<To> &oarr;
private:
int64_t p_ii, p_i[N], str_i;
int64_t p_oi, p_o[N], str_o;
ptrdiff_t p_ii, p_i[N], str_i;
ptrdiff_t p_oi, p_o[N], str_o;
size_t idim;
size_t rem;
......@@ -2055,8 +2055,8 @@ template<size_t N, typename Ti, typename To> class multi_iter
To &out (size_t j, size_t i) { return oarr[p_o[j] + i*str_o]; }
size_t length_in() const { return iarr.shape(idim); }
size_t length_out() const { return oarr.shape(idim); }
int64_t stride_in() const { return str_i; }
int64_t stride_out() const { return str_o; }
ptrdiff_t stride_in() const { return str_i; }
ptrdiff_t stride_out() const { return str_o; }
size_t remaining() const { return rem; }
bool inplace() const { return &iarr[0]==&oarr[0]; }
bool contiguous_in() const { return str_i==sizeof(Ti); }
......@@ -2441,7 +2441,7 @@ template<typename T> py::array irfftn_internal(const py::array &in,
size_t axis = axes.back();
if (lastsize==0) lastsize=2*inter.shape(axis)-1;
if (int64_t(lastsize/2) + 1 != inter.shape(axis))
if (ptrdiff_t(lastsize/2) + 1 != inter.shape(axis))
throw runtime_error("bad lastsize");
auto dims_out(copy_shape(inter));
dims_out[axis] = lastsize;
......@@ -2494,7 +2494,7 @@ template<typename T>py::array complex2hartley(const py::array &in,
swp[i] = true;
while(it.remaining()>0)
{
int64_t rofs = 0;
ptrdiff_t rofs = 0;
for (size_t i=0; i<it.pos.size(); ++i)
{
if (i==axis) continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment