-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.hpp
More file actions
31 lines (22 loc) · 771 Bytes
/
stats.hpp
File metadata and controls
31 lines (22 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <tuple>
#include <type_traits>
#include <list>
#include "mean.hpp"
#include "quantile.hpp"
namespace opar
{
template<typename Stat>
struct stat_result { };
template<typename T>
struct stat_result<mean_stat<T>> { using type = typename mean_return_type<T>::type; };
template< typename T>
struct stat_result<quantile_stat<T>> { using type = typename quantile_return_type<T>::type; };
// tuple-like stats type
// naive version - tuple itself
template<typename... Stats>
using stats = std::tuple< typename stat_result<Stats>::type...>;
template< bool IsSorted = false, class... Stats, class Iter>
// ... requres ...
stats<Stats...> calculate(Iter begin, Iter end, Stats... stats){return {};}
}