ComPWA
Common Partial-Wave-Analysis Framework
Function.hpp
Go to the documentation of this file.
1 #ifndef CORE_FUNCTION_HPP_
2 #define CORE_FUNCTION_HPP_
3 
4 #include <string>
5 #include <unordered_map>
6 #include <vector>
7 
8 namespace ComPWA {
9 
10 struct Parameter {
11  std::string Name;
12  double Value;
13 };
14 
15 using DataMap = std::unordered_map<std::string, std::vector<double>>;
16 
24 template <typename OutputType, typename... InputTypes> class Function {
25 public:
26  virtual ~Function() = default;
27 
28  virtual OutputType evaluate(const InputTypes &... args) noexcept = 0;
29 
34  virtual void updateParametersFrom(const std::vector<double> &) = 0;
35  virtual std::vector<Parameter> getParameters() const = 0;
36 };
37 
41 
42 } // namespace ComPWA
43 
44 #endif
std::unordered_map< std::string, std::vector< double > > DataMap
Definition: Function.hpp:15
std::string Name
Definition: Function.hpp:11
Interface template for a general Function of the form OutputType Function(InputTypes) The concept clo...
Definition: Function.hpp:24