Ported to C++11

This commit is contained in:
Philippe Tillet
2015-02-04 22:06:15 -05:00
parent 3a296ae3b7
commit bbf2f0188e
40 changed files with 413 additions and 563 deletions

View File

@@ -38,9 +38,9 @@ random_forest::random_forest(rapidjson::Value const & estimators)
std::vector<float> random_forest::predict(std::vector<int_t> const & x) const
{
std::vector<float> res(D_, 0);
for(std::vector<tree>::const_iterator it = estimators_.begin() ; it != estimators_.end() ; ++it)
for(const auto & elem : estimators_)
{
std::vector<float> const & subres = it->predict(x);
std::vector<float> const & subres = elem.predict(x);
for(int_t i = 0 ; i < D_ ; ++i)
res[i] += subres[i];
}