gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
objective_plugin.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
22 
23 #ifndef OBJECTIVE_PLUGIN_HPP
24 #define OBJECTIVE_PLUGIN_HPP
25 
29 
34 #define objective_plugin(...) OBJECTIVE_PLUGIN( __VA_ARGS__ )
35 
37 #define __OBJECTIVE_SETUP__ \
38 using namespace Gambit::Scanner; \
39 using Gambit::Printers::get_point_id; \
40  \
41 inline std::vector<std::string> &get_keys() {return get_input_value<std::vector<std::string>>(0);} \
42 inline void set_dimension(unsigned int val) {get_input_value<unsigned int>(1) = val;} \
43 inline void print_parameters(std::unordered_map<std::string, double> &key_map) \
44 { \
45  using Gambit::Printers::get_main_param_id; \
46  Gambit::Scanner::printer *printer = get_printer().get_stream(); \
47  for (auto it = get_keys().begin(), end = get_keys().end(); it != end; ++it) \
48  { \
49  printer->print(key_map[*it], *it, get_main_param_id(*it), printer->getRank(), get_point_id()); \
50  } \
51 } \
52 
53 #define OBJECTIVE_PLUGIN(plug_name, ...) \
54  GAMBIT_PLUGIN_INITIALIZE(__OBJECTIVE_SETUP__, plug_name, objective, __VA_ARGS__) \
55 
56 #endif
declaration for gambit module
Utility Functions for the Gambit Scanner.
declaration for scanner module