diff --git a/include/aare/ArrayExpr.hpp b/include/aare/ArrayExpr.hpp index 7f8015c..d326601 100644 --- a/include/aare/ArrayExpr.hpp +++ b/include/aare/ArrayExpr.hpp @@ -1,22 +1,24 @@ #pragma once -#include //int64_t -#include //size_t +#include +#include #include - #include +#include "aare/defs.hpp" + + namespace aare { -template class ArrayExpr { +template class ArrayExpr { public: static constexpr bool is_leaf = false; auto operator[](size_t i) const { return static_cast(*this)[i]; } auto operator()(size_t i) const { return static_cast(*this)[i]; } auto size() const { return static_cast(*this).size(); } - std::array shape() const { return static_cast(*this).shape(); } + std::array shape() const { return static_cast(*this).shape(); } }; -template +template class ArrayAdd : public ArrayExpr, Ndim> { const A &arr1_; const B &arr2_; @@ -27,10 +29,10 @@ class ArrayAdd : public ArrayExpr, Ndim> { } auto operator[](int i) const { return arr1_[i] + arr2_[i]; } size_t size() const { return arr1_.size(); } - std::array shape() const { return arr1_.shape(); } + std::array shape() const { return arr1_.shape(); } }; -template +template class ArraySub : public ArrayExpr, Ndim> { const A &arr1_; const B &arr2_; @@ -41,10 +43,10 @@ class ArraySub : public ArrayExpr, Ndim> { } auto operator[](int i) const { return arr1_[i] - arr2_[i]; } size_t size() const { return arr1_.size(); } - std::array shape() const { return arr1_.shape(); } + std::array shape() const { return arr1_.shape(); } }; -template +template class ArrayMul : public ArrayExpr,Ndim> { const A &arr1_; const B &arr2_; @@ -55,10 +57,10 @@ class ArrayMul : public ArrayExpr,Ndim> { } auto operator[](int i) const { return arr1_[i] * arr2_[i]; } size_t size() const { return arr1_.size(); } - std::array shape() const { return arr1_.shape(); } + std::array shape() const { return arr1_.shape(); } }; -template +template class ArrayDiv : public ArrayExpr, Ndim> { const A &arr1_; const B &arr2_; @@ -69,27 +71,27 @@ class ArrayDiv : public ArrayExpr, Ndim> { } auto operator[](int i) const { return arr1_[i] / arr2_[i]; } size_t size() const { return arr1_.size(); } - std::array shape() const { return arr1_.shape(); } + std::array shape() const { return arr1_.shape(); } }; -template +template auto operator+(const ArrayExpr &arr1, const ArrayExpr &arr2) { return ArrayAdd, ArrayExpr, Ndim>(arr1, arr2); } -template +template auto operator-(const ArrayExpr &arr1, const ArrayExpr &arr2) { return ArraySub, ArrayExpr, Ndim>(arr1, arr2); } -template +template auto operator*(const ArrayExpr &arr1, const ArrayExpr &arr2) { return ArrayMul, ArrayExpr, Ndim>(arr1, arr2); } -template +template auto operator/(const ArrayExpr &arr1, const ArrayExpr &arr2) { return ArrayDiv, ArrayExpr, Ndim>(arr1, arr2); } diff --git a/include/aare/FilePtr.hpp b/include/aare/FilePtr.hpp index 4c88ecb..4ddc76e 100644 --- a/include/aare/FilePtr.hpp +++ b/include/aare/FilePtr.hpp @@ -18,8 +18,8 @@ class FilePtr { FilePtr(FilePtr &&other); FilePtr &operator=(FilePtr &&other); FILE *get(); - int64_t tell(); - void seek(int64_t offset, int whence = SEEK_SET) { + ssize_t tell(); + void seek(ssize_t offset, int whence = SEEK_SET) { if (fseek(fp_, offset, whence) != 0) throw std::runtime_error("Error seeking in file"); } diff --git a/include/aare/Frame.hpp b/include/aare/Frame.hpp index 5ce63ac..02ea82f 100644 --- a/include/aare/Frame.hpp +++ b/include/aare/Frame.hpp @@ -107,8 +107,8 @@ class Frame { * @return NDView */ template NDView view() { - std::array shape = {static_cast(m_rows), - static_cast(m_cols)}; + std::array shape = {static_cast(m_rows), + static_cast(m_cols)}; T *data = reinterpret_cast(m_data); return NDView(data, shape); } diff --git a/include/aare/NDArray.hpp b/include/aare/NDArray.hpp index ceb1e0b..3c08a3c 100644 --- a/include/aare/NDArray.hpp +++ b/include/aare/NDArray.hpp @@ -22,10 +22,10 @@ TODO! Add expression templates for operators namespace aare { -template +template class NDArray : public ArrayExpr, Ndim> { - std::array shape_; - std::array strides_; + std::array shape_; + std::array strides_; size_t size_{}; T *data_; @@ -42,7 +42,7 @@ class NDArray : public ArrayExpr, Ndim> { * * @param shape shape of the new NDArray */ - explicit NDArray(std::array shape) + explicit NDArray(std::array shape) : shape_(shape), strides_(c_strides(shape_)), size_(std::accumulate(shape_.begin(), shape_.end(), 1, std::multiplies<>())), @@ -55,7 +55,7 @@ class NDArray : public ArrayExpr, Ndim> { * @param shape shape of the new array * @param value value to initialize the array with */ - NDArray(std::array shape, T value) : NDArray(shape) { + NDArray(std::array shape, T value) : NDArray(shape) { this->operator=(value); } @@ -186,22 +186,22 @@ class NDArray : public ArrayExpr, Ndim> { } // TODO! is int the right type for index? - T &operator()(int64_t i) { return data_[i]; } - const T &operator()(int64_t i) const { return data_[i]; } + T &operator()(ssize_t i) { return data_[i]; } + const T &operator()(ssize_t i) const { return data_[i]; } - T &operator[](int64_t i) { return data_[i]; } - const T &operator[](int64_t i) const { return data_[i]; } + T &operator[](ssize_t i) { return data_[i]; } + const T &operator[](ssize_t i) const { return data_[i]; } T *data() { return data_; } std::byte *buffer() { return reinterpret_cast(data_); } ssize_t size() const { return static_cast(size_); } size_t total_bytes() const { return size_ * sizeof(T); } - std::array shape() const noexcept { return shape_; } - int64_t shape(int64_t i) const noexcept { return shape_[i]; } - std::array strides() const noexcept { return strides_; } + std::array shape() const noexcept { return shape_; } + ssize_t shape(ssize_t i) const noexcept { return shape_[i]; } + std::array strides() const noexcept { return strides_; } size_t bitdepth() const noexcept { return sizeof(T) * 8; } - std::array byte_strides() const noexcept { + std::array byte_strides() const noexcept { auto byte_strides = strides_; for (auto &val : byte_strides) val *= sizeof(T); @@ -228,7 +228,7 @@ class NDArray : public ArrayExpr, Ndim> { }; // Move assign -template +template NDArray & NDArray::operator=(NDArray &&other) noexcept { if (this != &other) { @@ -242,7 +242,7 @@ NDArray::operator=(NDArray &&other) noexcept { return *this; } -template +template NDArray &NDArray::operator+=(const NDArray &other) { // check shape if (shape_ == other.shape_) { @@ -254,7 +254,7 @@ NDArray &NDArray::operator+=(const NDArray &other) { throw(std::runtime_error("Shape of ImageDatas must match")); } -template +template NDArray &NDArray::operator-=(const NDArray &other) { // check shape if (shape_ == other.shape_) { @@ -266,7 +266,7 @@ NDArray &NDArray::operator-=(const NDArray &other) { throw(std::runtime_error("Shape of ImageDatas must match")); } -template +template NDArray &NDArray::operator*=(const NDArray &other) { // check shape if (shape_ == other.shape_) { @@ -278,14 +278,14 @@ NDArray &NDArray::operator*=(const NDArray &other) { throw(std::runtime_error("Shape of ImageDatas must match")); } -template +template NDArray &NDArray::operator&=(const T &mask) { for (auto it = begin(); it != end(); ++it) *it &= mask; return *this; } -template +template NDArray NDArray::operator>(const NDArray &other) { if (shape_ == other.shape_) { NDArray result{shape_}; @@ -297,7 +297,7 @@ NDArray NDArray::operator>(const NDArray &other) { throw(std::runtime_error("Shape of ImageDatas must match")); } -template +template NDArray &NDArray::operator=(const NDArray &other) { if (this != &other) { delete[] data_; @@ -310,7 +310,7 @@ NDArray &NDArray::operator=(const NDArray &other) { return *this; } -template +template bool NDArray::operator==(const NDArray &other) const { if (shape_ != other.shape_) return false; @@ -322,23 +322,23 @@ bool NDArray::operator==(const NDArray &other) const { return true; } -template +template bool NDArray::operator!=(const NDArray &other) const { return !((*this) == other); } -template +template NDArray &NDArray::operator++() { for (uint32_t i = 0; i < size_; ++i) data_[i] += 1; return *this; } -template +template NDArray &NDArray::operator=(const T &value) { std::fill_n(data_, size_, value); return *this; } -template +template NDArray &NDArray::operator+=(const T &value) { for (uint32_t i = 0; i < size_; ++i) data_[i] += value; @@ -348,57 +348,57 @@ NDArray &NDArray::operator+=(const T &value) { -template +template NDArray NDArray::operator+(const T &value) { NDArray result = *this; result += value; return result; } -template +template NDArray &NDArray::operator-=(const T &value) { for (uint32_t i = 0; i < size_; ++i) data_[i] -= value; return *this; } -template +template NDArray NDArray::operator-(const T &value) { NDArray result = *this; result -= value; return result; } -template +template NDArray &NDArray::operator/=(const T &value) { for (uint32_t i = 0; i < size_; ++i) data_[i] /= value; return *this; } -template +template NDArray NDArray::operator/(const T &value) { NDArray result = *this; result /= value; return result; } -template +template NDArray &NDArray::operator*=(const T &value) { for (uint32_t i = 0; i < size_; ++i) data_[i] *= value; return *this; } -template +template NDArray NDArray::operator*(const T &value) { NDArray result = *this; result *= value; return result; } -// template void NDArray::Print() { +// template void NDArray::Print() { // if (shape_[0] < 20 && shape_[1] < 20) // Print_all(); // else // Print_some(); // } -template +template std::ostream &operator<<(std::ostream &os, const NDArray &arr) { for (auto row = 0; row < arr.shape(0); ++row) { for (auto col = 0; col < arr.shape(1); ++col) { @@ -410,7 +410,7 @@ std::ostream &operator<<(std::ostream &os, const NDArray &arr) { return os; } -template void NDArray::Print_all() { +template void NDArray::Print_all() { for (auto row = 0; row < shape_[0]; ++row) { for (auto col = 0; col < shape_[1]; ++col) { std::cout << std::setw(3); @@ -419,7 +419,7 @@ template void NDArray::Print_all() { std::cout << "\n"; } } -template void NDArray::Print_some() { +template void NDArray::Print_some() { for (auto row = 0; row < 5; ++row) { for (auto col = 0; col < 5; ++col) { std::cout << std::setw(7); @@ -429,7 +429,7 @@ template void NDArray::Print_some() { } } -template +template void save(NDArray &img, std::string &pathname) { std::ofstream f; f.open(pathname, std::ios::binary); @@ -437,9 +437,9 @@ void save(NDArray &img, std::string &pathname) { f.close(); } -template +template NDArray load(const std::string &pathname, - std::array shape) { + std::array shape) { NDArray img{shape}; std::ifstream f; f.open(pathname, std::ios::binary); diff --git a/include/aare/NDView.hpp b/include/aare/NDView.hpp index ddb5d1c..56054e2 100644 --- a/include/aare/NDView.hpp +++ b/include/aare/NDView.hpp @@ -14,10 +14,10 @@ #include namespace aare { -template using Shape = std::array; +template using Shape = std::array; // TODO! fix mismatch between signed and unsigned -template Shape make_shape(const std::vector &shape) { +template Shape make_shape(const std::vector &shape) { if (shape.size() != Ndim) throw std::runtime_error("Shape size mismatch"); Shape arr; @@ -25,41 +25,41 @@ template Shape make_shape(const std::vector &shape) return arr; } -template int64_t element_offset(const Strides & /*unused*/) { return 0; } +template ssize_t element_offset(const Strides & /*unused*/) { return 0; } -template -int64_t element_offset(const Strides &strides, int64_t i, Ix... index) { +template +ssize_t element_offset(const Strides &strides, ssize_t i, Ix... index) { return i * strides[Dim] + element_offset(strides, index...); } -template std::array c_strides(const std::array &shape) { - std::array strides{}; +template std::array c_strides(const std::array &shape) { + std::array strides{}; std::fill(strides.begin(), strides.end(), 1); - for (int64_t i = Ndim - 1; i > 0; --i) { + for (ssize_t i = Ndim - 1; i > 0; --i) { strides[i - 1] = strides[i] * shape[i]; } return strides; } -template std::array make_array(const std::vector &vec) { +template std::array make_array(const std::vector &vec) { assert(vec.size() == Ndim); - std::array arr{}; + std::array arr{}; std::copy_n(vec.begin(), Ndim, arr.begin()); return arr; } -template class NDView : public ArrayExpr, Ndim> { +template class NDView : public ArrayExpr, Ndim> { public: NDView() = default; ~NDView() = default; NDView(const NDView &) = default; NDView(NDView &&) = default; - NDView(T *buffer, std::array shape) + NDView(T *buffer, std::array shape) : buffer_(buffer), strides_(c_strides(shape)), shape_(shape), size_(std::accumulate(std::begin(shape), std::end(shape), 1, std::multiplies<>())) {} - // NDView(T *buffer, const std::vector &shape) + // NDView(T *buffer, const std::vector &shape) // : buffer_(buffer), strides_(c_strides(make_array(shape))), shape_(make_array(shape)), // size_(std::accumulate(std::begin(shape), std::end(shape), 1, std::multiplies<>())) {} @@ -73,14 +73,14 @@ template class NDView : public ArrayExpr(size_); } size_t total_bytes() const { return size_ * sizeof(T); } - std::array strides() const noexcept { return strides_; } + std::array strides() const noexcept { return strides_; } T *begin() { return buffer_; } T *end() { return buffer_ + size_; } T const *begin() const { return buffer_; } T const *end() const { return buffer_ + size_; } - T &operator()(int64_t i) const { return buffer_[i]; } - T &operator[](int64_t i) const { return buffer_[i]; } + T &operator()(ssize_t i) const { return buffer_[i]; } + T &operator[](ssize_t i) const { return buffer_[i]; } bool operator==(const NDView &other) const { if (size_ != other.size_) @@ -136,15 +136,15 @@ template class NDView : public ArrayExpr strides_{}; - std::array shape_{}; + std::array strides_{}; + std::array shape_{}; uint64_t size_{}; template NDView &elemenwise(T val, BinaryOperation op) { @@ -160,7 +160,7 @@ template class NDView : public ArrayExpr void NDView::print_all() const { +template void NDView::print_all() const { for (auto row = 0; row < shape_[0]; ++row) { for (auto col = 0; col < shape_[1]; ++col) { std::cout << std::setw(3); @@ -171,7 +171,7 @@ template void NDView::print_all() const { } -template +template std::ostream& operator <<(std::ostream& os, const NDView& arr){ for (auto row = 0; row < arr.shape(0); ++row) { for (auto col = 0; col < arr.shape(1); ++col) { @@ -186,7 +186,7 @@ std::ostream& operator <<(std::ostream& os, const NDView& arr){ template NDView make_view(std::vector& vec){ - return NDView(vec.data(), {static_cast(vec.size())}); + return NDView(vec.data(), {static_cast(vec.size())}); } } // namespace aare \ No newline at end of file diff --git a/include/aare/NumpyFile.hpp b/include/aare/NumpyFile.hpp index 9cd2d61..7381a76 100644 --- a/include/aare/NumpyFile.hpp +++ b/include/aare/NumpyFile.hpp @@ -69,7 +69,7 @@ class NumpyFile : public FileInterface { */ template NDArray load() { NDArray arr(make_shape(m_header.shape)); - if (fseek(fp, static_cast(header_size), SEEK_SET)) { + if (fseek(fp, static_cast(header_size), SEEK_SET)) { throw std::runtime_error(LOCATION + "Error seeking to the start of the data"); } size_t rc = fread(arr.data(), sizeof(T), arr.size(), fp); diff --git a/include/aare/Pedestal.hpp b/include/aare/Pedestal.hpp index 102d730..d6223c1 100644 --- a/include/aare/Pedestal.hpp +++ b/include/aare/Pedestal.hpp @@ -107,7 +107,7 @@ template class Pedestal { assert(frame.size() == m_rows * m_cols); // TODO! move away from m_rows, m_cols - if (frame.shape() != std::array{m_rows, m_cols}) { + if (frame.shape() != std::array{m_rows, m_cols}) { throw std::runtime_error( "Frame shape does not match pedestal shape"); } @@ -128,7 +128,7 @@ template class Pedestal { assert(frame.size() == m_rows * m_cols); // TODO! move away from m_rows, m_cols - if (frame.shape() != std::array{m_rows, m_cols}) { + if (frame.shape() != std::array{m_rows, m_cols}) { throw std::runtime_error( "Frame shape does not match pedestal shape"); } diff --git a/include/aare/VarClusterFinder.hpp b/include/aare/VarClusterFinder.hpp index 161941a..596bf06 100644 --- a/include/aare/VarClusterFinder.hpp +++ b/include/aare/VarClusterFinder.hpp @@ -28,7 +28,7 @@ template class VarClusterFinder { }; private: - const std::array shape_; + const std::array shape_; NDView original_; NDArray labeled_; NDArray peripheral_labeled_; diff --git a/include/aare/defs.hpp b/include/aare/defs.hpp index 4d22bd4..01d291b 100644 --- a/include/aare/defs.hpp +++ b/include/aare/defs.hpp @@ -207,20 +207,20 @@ struct DetectorGeometry{ }; struct ROI{ - int64_t xmin{}; - int64_t xmax{}; - int64_t ymin{}; - int64_t ymax{}; + ssize_t xmin{}; + ssize_t xmax{}; + ssize_t ymin{}; + ssize_t ymax{}; - int64_t height() const { return ymax - ymin; } - int64_t width() const { return xmax - xmin; } - bool contains(int64_t x, int64_t y) const { + ssize_t height() const { return ymax - ymin; } + ssize_t width() const { return xmax - xmin; } + bool contains(ssize_t x, ssize_t y) const { return x >= xmin && x < xmax && y >= ymin && y < ymax; } }; -using dynamic_shape = std::vector; +using dynamic_shape = std::vector; //TODO! Can we uniform enums between the libraries? diff --git a/python/src/ctb_raw_file.hpp b/python/src/ctb_raw_file.hpp index a88a9d1..c9b5310 100644 --- a/python/src/ctb_raw_file.hpp +++ b/python/src/ctb_raw_file.hpp @@ -34,7 +34,7 @@ m.def("adc_sar_05_decode64to16", [](py::array_t input) { } //Create a 2D output array with the same shape as the input - std::vector shape{input.shape(0), input.shape(1)/static_cast(bits_per_byte)}; + std::vector shape{input.shape(0), input.shape(1)/static_cast(bits_per_byte)}; py::array_t output(shape); //Create a view of the input and output arrays @@ -55,7 +55,7 @@ m.def("adc_sar_04_decode64to16", [](py::array_t input) { } //Create a 2D output array with the same shape as the input - std::vector shape{input.shape(0), input.shape(1)/static_cast(bits_per_byte)}; + std::vector shape{input.shape(0), input.shape(1)/static_cast(bits_per_byte)}; py::array_t output(shape); //Create a view of the input and output arrays diff --git a/python/src/file.hpp b/python/src/file.hpp index 2d0f53e..f97db96 100644 --- a/python/src/file.hpp +++ b/python/src/file.hpp @@ -198,7 +198,7 @@ void define_file_io_bindings(py::module &m) { py::class_(m, "ROI") .def(py::init<>()) - .def(py::init(), py::arg("xmin"), + .def(py::init(), py::arg("xmin"), py::arg("xmax"), py::arg("ymin"), py::arg("ymax")) .def_readwrite("xmin", &ROI::xmin) .def_readwrite("xmax", &ROI::xmax) diff --git a/python/src/np_helper.hpp b/python/src/np_helper.hpp index 3d3ee3c..78166aa 100644 --- a/python/src/np_helper.hpp +++ b/python/src/np_helper.hpp @@ -13,7 +13,7 @@ namespace py = pybind11; using namespace aare; // Pass image data back to python as a numpy array -template +template py::array return_image_data(aare::NDArray *image) { py::capsule free_when_done(image, [](void *f) { diff --git a/src/FilePtr.cpp b/src/FilePtr.cpp index 4fed3d7..e3cdb4b 100644 --- a/src/FilePtr.cpp +++ b/src/FilePtr.cpp @@ -21,7 +21,7 @@ FilePtr &FilePtr::operator=(FilePtr &&other) { FILE *FilePtr::get() { return fp_; } -int64_t FilePtr::tell() { +ssize_t FilePtr::tell() { auto pos = ftell(fp_); if (pos == -1) throw std::runtime_error(fmt::format("Error getting file position: {}", error_msg())); diff --git a/src/NDArray.test.cpp b/src/NDArray.test.cpp index c37a285..819a1a9 100644 --- a/src/NDArray.test.cpp +++ b/src/NDArray.test.cpp @@ -44,9 +44,9 @@ TEST_CASE("3D NDArray from NDView"){ REQUIRE(image.size() == view.size()); REQUIRE(image.data() != view.data()); - for(int64_t i=0; i shape{{20}}; + std::array shape{{20}}; NDArray img(shape, 3); REQUIRE(img.size() == 20); REQUIRE(img(5) == 3); @@ -71,7 +71,7 @@ TEST_CASE("Accessing a const object") { } TEST_CASE("Indexing of a 2D image") { - std::array shape{{3, 7}}; + std::array shape{{3, 7}}; NDArray img(shape, 5); for (uint32_t i = 0; i != img.size(); ++i) { REQUIRE(img(i) == 5); @@ -114,7 +114,7 @@ TEST_CASE("Divide double by int") { } TEST_CASE("Elementwise multiplication of 3D image") { - std::array shape{3, 4, 2}; + std::array shape{3, 4, 2}; NDArray a{shape}; NDArray b{shape}; for (uint32_t i = 0; i != a.size(); ++i) { @@ -179,9 +179,9 @@ TEST_CASE("Compare two images") { } TEST_CASE("Size and shape matches") { - int64_t w = 15; - int64_t h = 75; - std::array shape{w, h}; + ssize_t w = 15; + ssize_t h = 75; + std::array shape{w, h}; NDArray a{shape}; REQUIRE(a.size() == w * h); REQUIRE(a.shape() == shape); @@ -224,7 +224,7 @@ TEST_CASE("Bitwise and on data") { TEST_CASE("Elementwise operations on images") { - std::array shape{5, 5}; + std::array shape{5, 5}; double a_val = 3.0; double b_val = 8.0; diff --git a/src/NDView.test.cpp b/src/NDView.test.cpp index 8750f3a..89e76e9 100644 --- a/src/NDView.test.cpp +++ b/src/NDView.test.cpp @@ -142,7 +142,7 @@ TEST_CASE("iterators") { // for (int i = 0; i != 12; ++i) { // vec.push_back(i); // } -// std::vector shape{3, 4}; +// std::vector shape{3, 4}; // NDView data(vec.data(), shape); // } @@ -151,8 +151,8 @@ TEST_CASE("divide with another span") { std::vector vec1{3, 2, 1}; std::vector result{3, 6, 3}; - NDView data0(vec0.data(), Shape<1>{static_cast(vec0.size())}); - NDView data1(vec1.data(), Shape<1>{static_cast(vec1.size())}); + NDView data0(vec0.data(), Shape<1>{static_cast(vec0.size())}); + NDView data1(vec1.data(), Shape<1>{static_cast(vec1.size())}); data0 /= data1; diff --git a/src/decode.cpp b/src/decode.cpp index 8ac7bc0..436ad7b 100644 --- a/src/decode.cpp +++ b/src/decode.cpp @@ -26,8 +26,8 @@ void adc_sar_05_decode64to16(NDView input, NDView outpu throw std::invalid_argument(LOCATION + " input and output shapes must match"); } - for(int64_t i = 0; i < input.shape(0); i++){ - for(int64_t j = 0; j < input.shape(1); j++){ + for(ssize_t i = 0; i < input.shape(0); i++){ + for(ssize_t j = 0; j < input.shape(1); j++){ output(i,j) = adc_sar_05_decode64to16(input(i,j)); } } @@ -56,8 +56,8 @@ void adc_sar_04_decode64to16(NDView input, NDView outpu if(input.shape() != output.shape()){ throw std::invalid_argument(LOCATION + " input and output shapes must match"); } - for(int64_t i = 0; i < input.shape(0); i++){ - for(int64_t j = 0; j < input.shape(1); j++){ + for(ssize_t i = 0; i < input.shape(0); i++){ + for(ssize_t j = 0; j < input.shape(1); j++){ output(i,j) = adc_sar_04_decode64to16(input(i,j)); } }