P
Piotr
I have this compile error and I have narrowed down the following piece
of code.
stddev.cpp:133: error: no matching function for call to
'transform(<unknown type>, <unknown type>,
__gnu_cxx::__normal_iterator<float*, std::vector<float,
std::allocator<float> > >, Div)'
gmake[5]: *** [stddev.o] Error 1
I can't figure it out why, I appreciate if anyone can help.
struct Div
{
public:
Div(int max):_max(max) {}
float operator()(int i)
{
return ((float)i/ _max);
}
private:
int _max;
};
float StatUtils::std_dev_max( vector<int>& v , int max)
{
vector<float> v1(v.size());
transform(v.begin, v.end, v1.begin(), Div(max));
return 0.0;
}
of code.
stddev.cpp:133: error: no matching function for call to
'transform(<unknown type>, <unknown type>,
__gnu_cxx::__normal_iterator<float*, std::vector<float,
std::allocator<float> > >, Div)'
gmake[5]: *** [stddev.o] Error 1
I can't figure it out why, I appreciate if anyone can help.
struct Div
{
public:
Div(int max):_max(max) {}
float operator()(int i)
{
return ((float)i/ _max);
}
private:
int _max;
};
float StatUtils::std_dev_max( vector<int>& v , int max)
{
vector<float> v1(v.size());
transform(v.begin, v.end, v1.begin(), Div(max));
return 0.0;
}