A
lgorithmique
N
umérique
D
istribuée
Private GIT Repository
projects
/
loba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 0.4.
[loba.git]
/
cost_func.cpp
diff --git
a/cost_func.cpp
b/cost_func.cpp
index 12c20f6a2cd88824de1645f4c7650f4f6488c6a9..4248c5654c568221667a5afd21169941ffec6c4e 100644
(file)
--- a/
cost_func.cpp
+++ b/
cost_func.cpp
@@
-1,5
+1,4
@@
#include <algorithm>
#include <algorithm>
-#include <tr1/functional>
#include <numeric>
#include <iterator>
#include <sstream>
#include <numeric>
#include <iterator>
#include <sstream>
@@
-30,13
+29,10
@@
cost_func::~cost_func()
double cost_func::operator()(double amount) const
{
double cost_func::operator()(double amount) const
{
- using std::tr1::bind;
- using std::tr1::placeholders::_1;
- using std::tr1::placeholders::_2;
return std::accumulate(++factors.begin(), factors.end(), factors.front(),
return std::accumulate(++factors.begin(), factors.end(), factors.front(),
- bind(std::plus<double>(),
- bind(std::multiplies<double>(), amount, _1),
-
_2)
);
+ [&amount](double a, double b) {
+ return amount * a + b;
+
}
);
}
std::string cost_func::to_string()
}
std::string cost_func::to_string()