Closed amarrerod closed 1 year ago
It is hard to tell from your code snippet, probably missing an include I would guess. This minimal example compiles and runs just fine:
#include "NumCpp.hpp"
#include <iostream>
int main()
{
const auto x = nc::random::rand<double>({ 1, 10 }) * 10.;
const auto bins = nc::linspace<double>(0., 10., 10.);
const auto xDigitized = nc::digitize(x, bins);
std::cout << "x : " << x;
std::cout << "xDigitized: " << xDigitized;
return EXIT_SUCCESS;
}
which outputs:
x : [[7.86821, 2.5048, 7.10671, 9.46668, 0.192711, 4.04902, 2.51318, 0.227124, 5.20643, 3.4467, ]]
xDigitized: [[8, 3, 7, 9, 1, 4, 3, 1, 5, 4, ]]
I tried the snippet above and it does work on my computer. However, the thing is that I also use nc::linspace in the same file and it works just fine.
Closing due to inactivity. Above example compiles and runs. Cannon reproduce users issue, most likely caused by a missing include in their code.
Describe the bug I'm trying to use the digitize function but for some reason, the code doesn't compile correctly. However, if I just copy and paste the entire code from your digitize.hpp file it works.
Screenshots
The GCC output is the following: