use bind2nd instead of bind1st

This commit is contained in:
Tiago Gomes 2012-05-31 12:19:13 +01:00
parent 6668ee6381
commit d00eb05624
2 changed files with 5 additions and 5 deletions

View File

@ -332,7 +332,7 @@ normalize (Params& v)
assert (sum != -numeric_limits<double>::infinity());
v -= sum;
} else {
double sum = std::accumulate (v.begin(), v.end(), 0);
double sum = std::accumulate (v.begin(), v.end(), 0.0);
assert (sum != 0.0);
v /= sum;
}

View File

@ -283,7 +283,7 @@ template <typename T>
void operator+=(std::vector<T>& v, double val)
{
std::transform (v.begin(), v.end(), v.begin(),
std::bind1st (plus<double>(), val));
std::bind2nd (plus<double>(), val));
}
@ -292,7 +292,7 @@ template <typename T>
void operator-=(std::vector<T>& v, double val)
{
std::transform (v.begin(), v.end(), v.begin(),
std::bind1st (minus<double>(), val));
std::bind2nd (minus<double>(), val));
}
@ -301,7 +301,7 @@ template <typename T>
void operator*=(std::vector<T>& v, double val)
{
std::transform (v.begin(), v.end(), v.begin(),
std::bind1st (multiplies<double>(), val));
std::bind2nd (multiplies<double>(), val));
}
@ -310,7 +310,7 @@ template <typename T>
void operator/=(std::vector<T>& v, double val)
{
std::transform (v.begin(), v.end(), v.begin(),
std::bind1st (divides<double>(), val));
std::bind2nd (divides<double>(), val));
}