Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
APIAdapter.cpp
Go to the documentation of this file.
1#include "APIAdapter.h"
2
3std::map<LhaID, scalar_t> APIAdapter::get_block_infos(const BlockName& block, ParameterType param_type) {
4 return Parameters::GetInstance(param_type)->get_block_infos(block);
5}
6
7std::unordered_set<BlockName> APIAdapter::get_blocks_list(ParameterType param_type) {
8 return Parameters::GetInstance(param_type)->get_blocks_list();
9}
10
14
15fs::path APIAdapter::get_path(APIPath path_name) {
16 return MemoryManager::GetInstance()->get_path(path_name);
17}
18
19std::unordered_set<BlockName> APIAdapter::get_all_blocks()
20{
21 std::unordered_set<BlockName> all_blocks;
23 auto blocks = get_blocks_list(p_type);
24 all_blocks.insert(blocks.begin(), blocks.end());
25 }
26 return all_blocks;
27}
28
29std::vector<ParameterType> APIAdapter::get_type_of_block(const BlockName& block) {
30 std::vector<ParameterType> param_type;
32 for (auto& block_ : get_blocks_list(elem)) {
33 if (block == block_) {
34 param_type.push_back(elem);
35 break;
36 }
37 }
38 }
39 return param_type;
40}
High-level monitoring and access adapter for parameter and path information.
ExternalFlag
Flags describing external input characteristics.
Definition Config.h:13
ParameterType
APIPath
Enumerates the filesystem paths exposed through the public API.
fs::path get_path(APIPath path_name) override
Retrieves a specific filesystem path exposed by APIPath.
std::unordered_set< BlockName > get_blocks_list(ParameterType param_type=ParameterType::SM)
Retrieves block names for a specific parameter type.
Definition APIAdapter.cpp:7
std::unordered_set< BlockName > get_all_blocks()
Retrieves all block names across all available model types.
std::vector< ParameterType > get_type_of_block(const BlockName &block)
Retrieves the list of parameter types that own a specific block.
bool check_flag(ExternalFlag flag)
Checks the status of a specific external flag.
std::map< LhaID, scalar_t > get_block_infos(const BlockName &block, ParameterType param_type=ParameterType::SM)
Retrieves all parameter values inside a given block.
Definition APIAdapter.cpp:3
Block identifier with alias support.
Definition BlockName.h:59
const MemoryCache & getMemoryCache()
Retrieves the current memory cache.
static MemoryManager * GetInstance()
Retrieves the singleton instance of MemoryManager.
fs::path get_path(APIPath path_name)
Retrieves a public API path from the runtime cache or path provider.
static std::shared_ptr< Parameters > GetInstance(ParameterType id=ParameterType::SM)
Returns the singleton-like repository for a given parameter type.
std::map< ExternalFlag, bool > flags
External flags describing the nature of the inputs.
Definition Config.h:26
std::vector< ParameterType > parameter_types
List of parameter types currently managed.
HyperisoConfig config
Config struct for various flags and runtime information.