Closed jurihock closed 1 year ago
Describe the bug
Unable to perform slicing with index arrays of type:
nc::NdArray<uint64_t>
nc::NdArray<int64_t>
nc::NdArray<int32_t>
due to errors at compile time, e.g.:
Slicing just with scalars of mentioned data types and nc::NdArray<uint32_t> arrays works as expected.
nc::NdArray<uint32_t>
To Reproduce
#include <iostream> #include <NumCpp.hpp> int main() { nc::NdArray<double> lut = { 1, 2, 3 }; const uint64_t a = 0; const int64_t b = -3; const nc::NdArray<uint64_t> c = { 2, 1, 0 }; const nc::NdArray<int64_t> d = { -1, -2, -3 }; const nc::NdArray<uint32_t> e = { 2, 1, 0 }; const nc::NdArray<int32_t> f = { -1, -2, -3 }; std::cout << lut[a] << std::endl; // 1 std::cout << lut[b] << std::endl; // 1 std::cout << lut[c] << std::endl; // error std::cout << lut[d] << std::endl; // error std::cout << lut[e] << std::endl; // [[3, 2, 1, ]] std::cout << lut[f] << std::endl; // error return 0; }
Expected behavior
At least no compile time errors, even with signed and 64-bit indices.
References
https://github.com/dpilger26/NumCpp/issues/103
Fixed in Release Version 2.10.0.
Describe the bug
Unable to perform slicing with index arrays of type:
nc::NdArray<uint64_t>
nc::NdArray<int64_t>
nc::NdArray<int32_t>
due to errors at compile time, e.g.:
Slicing just with scalars of mentioned data types and
nc::NdArray<uint32_t>
arrays works as expected.To Reproduce
Expected behavior
At least no compile time errors, even with signed and 64-bit indices.
References
https://github.com/dpilger26/NumCpp/issues/103