예제 #1
0
Event count(const events_t & events) {

  if (events.empty()) {
    return {};
  }

  return events.front().copy().set_metric(events.size())
         .set_time(max_time(events));
}
예제 #2
0
Event mean(const events_t & events) {

  if (events.empty()) {
    return {};
  }

  Event e(events.front());
  e.set_metric_d(reduce(sum_fn, events) / events.size());
  e.set_time(max_time(events));

  return e;
}
예제 #3
0
Event maximum(const events_t & events) {

  if (events.empty()) {
    return {};
  }

  double max = events[0].metric();

  for (const auto & e: events) {

    auto tmp = e.metric();
    if (tmp > max) {
      max = tmp;
    }
  }

  Event e(events.front());
  e.set_metric_d(max);
  e.set_time(max_time(events));

  return e;
}
예제 #4
0
파일: folds.cpp 프로젝트: mninja/cavalieri
Event minimum(const events_t & events) {

  if (events.empty()) {
    return {};
  }

  double min = metric_to_double(events[0]);

  for (const auto & e: events) {

    auto tmp = metric_to_double(e);
    if (tmp < min) {
      min = tmp;
    }

  }

  Event e(events.front());
  e.set_metric_d(min);
  e.set_time(max_time(events));

  return e;
}