geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Agg.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef AGG_HPP_INCLUDE
7 #define AGG_HPP_INCLUDE
8 
9 #include <functional>
10 #include <string>
11 #include <vector>
12 
13 #include "geopm_public.h"
14 
15 namespace geopm
16 {
20  {
21  public:
22  enum m_type_e {
36  M_NUM_TYPE
37  };
39  static double sum(const std::vector<double> &operand);
41  static double average(const std::vector<double> &operand);
43  static double median(const std::vector<double> &operand);
47  static double integer_bitwise_or(const std::vector<double> &operand);
51  static double logical_and(const std::vector<double> &operand);
55  static double logical_or(const std::vector<double> &operand);
58  static double min(const std::vector<double> &operand);
61  static double max(const std::vector<double> &operand);
64  static double stddev(const std::vector<double> &operand);
71  static double region_hash(const std::vector<double> &operand);
78  static double region_hint(const std::vector<double> &operand);
82  static double select_first(const std::vector<double> &operand);
87  static double expect_same(const std::vector<double> &operand);
91  static std::function<double(const std::vector<double> &)> name_to_function(const std::string &name);
95  static std::string function_to_name(std::function<double(const std::vector<double> &)> func);
99  static int function_to_type(std::function<double(const std::vector<double> &)> func);
103  static std::function<double(const std::vector<double> &)> type_to_function(int agg_type);
107  static std::string type_to_name(int agg_type);
108  };
109 }
110 
111 #endif
Definition: Agg.hpp:20
m_type_e
Definition: Agg.hpp:22
@ M_LOGICAL_AND
Definition: Agg.hpp:27
@ M_AVERAGE
Definition: Agg.hpp:24
@ M_INTEGER_BITWISE_OR
Definition: Agg.hpp:26
@ M_SELECT_FIRST
Definition: Agg.hpp:34
@ M_MAX
Definition: Agg.hpp:30
@ M_MEDIAN
Definition: Agg.hpp:25
@ M_SUM
Definition: Agg.hpp:23
@ M_STDDEV
Definition: Agg.hpp:31
@ M_REGION_HASH
Definition: Agg.hpp:32
@ M_LOGICAL_OR
Definition: Agg.hpp:28
@ M_REGION_HINT
Definition: Agg.hpp:33
@ M_EXPECT_SAME
Definition: Agg.hpp:35
@ M_MIN
Definition: Agg.hpp:29
#define GEOPM_PUBLIC
Definition: geopm_public.h:10
Definition: Agg.cpp:20