Example #1
0
static std::pair<int, int>
hit(const boost::unordered_map<int, double> &real,
    const boost::unordered_map<int, double> &fake,
    double thres = 0.0)
{
  int a = 0, b = 0;
  for (auto it = fake.cbegin(); it != fake.cend(); ++it) {
    if (it->second >= thres) {
      ++b;
      if (real.end() != real.find(it->first))
        ++a;
    }
  }
  return std::make_pair(a, b);
}