Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
DependentBlockManager.h
Go to the documentation of this file.
1#ifndef DEPENDENT_BLOCK_MANAGER_H
2#define DEPENDENT_BLOCK_MANAGER_H
3
4#include <map>
5#include <unordered_map>
6#include <memory>
7#include <vector>
8#include <iostream>
9
10#include "DependentParameter.h"
11#include "Block.h"
12
29public:
40 static void addDependentBlock(
41 std::string name,
42 std::unordered_map<ParameterType, std::vector<std::string>> source_names,
43 ParameterType dest,
44 DepUpdateFunc recalculateFunc
45 );
46
56 static void addDependentParameter(
57 ParamId pid,
58 std::unordered_set<ParamId> source_pids,
59 DepParamUpdateFunc recalculateFunc
60 );
61
68 static void removeDependentBlock(const std::string& name, ParameterType src);
69
76 static void update(const std::string& name, ParameterType src);
77
78private:
82 DependentBlockManager() = default;
83
87 ~DependentBlockManager() = default;
88
93
97 DependentBlockManager& operator=(const DependentBlockManager&) = delete;
98};
99
100#endif // DEPENDENT_BLOCK_MANAGER_H
Defines classes used to store parameters and to build derived/dependent parameter blocks.
std::function< void(const BlockSrc &, std::shared_ptr< DependentBlock >)> DepUpdateFunc
Function type used to recompute a DependentBlock from its sources.
Definition Block.h:56
Defines parameters whose values are lazily computed from other parameters.
std::function< void(const ParamSrc &, std::shared_ptr< DependentParameter >)> DepParamUpdateFunc
Function signature used to recompute a DependentParameter.
ParameterType
Static class for handling dependent blocks and parameters across different Parameters instances.
static void update(const std::string &name, ParameterType src)
Manually triggers an update on a DependentBlock.
static void removeDependentBlock(const std::string &name, ParameterType src)
Removes a DependentBlock from a specified Parameters instance.
static void addDependentBlock(std::string name, std::unordered_map< ParameterType, std::vector< std::string > > source_names, ParameterType dest, DepUpdateFunc recalculateFunc)
Adds a DependentBlock with multiple sources coming from various Parameters instances.
static void addDependentParameter(ParamId pid, std::unordered_set< ParamId > source_pids, DepParamUpdateFunc recalculateFunc)
Adds a DependentParameter based on multiple source parameters.
Composite identifier for a single parameter.
Definition ParamID.h:57