|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Lightweight view over a set of source parameters keyed by ParamId. More...
#include <SourcesView.h>
Public Member Functions | |
| ParamSrc (const std::unordered_map< ParamId, std::shared_ptr< Parameter > > &m, std::string ctx={}) | |
| Constructs a ParamSrc view from an existing map. | |
| ParamSrc ()=default | |
| Default constructor: creates an empty, unbound view. | |
| bool | has (const ParamId &id) const |
| Checks whether a parameter with the given ID exists. | |
| const std::shared_ptr< Parameter > & | require (const ParamId &id) const |
| Returns a parameter reference or throws if missing. | |
| std::shared_ptr< Parameter > | get_param (const ParamId &id) const |
| Convenience wrapper for require(). | |
| scalar_t | get_val (const ParamId &id) const |
| Retrieves the current value of a parameter. | |
| scalar_t | get_val (ParameterType t, std::string_view block, std::initializer_list< long > code) const |
| Helper: get value from typed (ParameterType, block, code-list). | |
| scalar_t | get_val (ParameterType t, std::string_view block, const LhaID &code) const |
| Helper: get value from typed (ParameterType, block, LhaID). | |
| scalar_t | get_val (ParameterType t, std::string_view block, int code) const |
| Helper: get value from typed (ParameterType, block, int). | |
| scalar_t | get_val (ParameterType t, std::string_view block, std::pair< int, int > code) const |
| Helper: get value from typed (ParameterType, block, pair<int,int>). | |
| const std::unordered_map< ParamId, std::shared_ptr< Parameter > > & | raw () const |
| Access to the underlying parameter map. | |
Lightweight view over a set of source parameters keyed by ParamId.
This class wraps a map std::unordered_map<ParamId, std::shared_ptr<Parameter>> without owning it, and provides:
get_val helpers accepting (type, block, code...).It is particularly useful for dependency graphs where derived parameters are functions of other parameters identified by full ParamId.
Definition at line 249 of file SourcesView.h.
|
explicit |
Constructs a ParamSrc view from an existing map.
| m | Map of ParamId to Parameter pointers (not owned). |
| ctx | Optional context string used in error messages. |
Definition at line 89 of file SourceView.cpp.
|
default |
Default constructor: creates an empty, unbound view.
Convenience wrapper for require().
| id | ParamId to retrieve. |
| std::invalid_argument | if the parameter is not found. |
Definition at line 110 of file SourceView.cpp.
Retrieves the current value of a parameter.
| id | ParamId to retrieve. |
Definition at line 111 of file SourceView.cpp.
| scalar_t ParamSrc::get_val | ( | ParameterType | t, |
| std::string_view | block, | ||
| const LhaID & | code | ||
| ) | const |
Helper: get value from typed (ParameterType, block, LhaID).
Definition at line 117 of file SourceView.cpp.
| scalar_t ParamSrc::get_val | ( | ParameterType | t, |
| std::string_view | block, | ||
| int | code | ||
| ) | const |
Helper: get value from typed (ParameterType, block, int).
Definition at line 120 of file SourceView.cpp.
| scalar_t ParamSrc::get_val | ( | ParameterType | t, |
| std::string_view | block, | ||
| std::initializer_list< long > | code | ||
| ) | const |
Helper: get value from typed (ParameterType, block, code-list).
Constructs a ParamId and forwards to the main get_val().
| t | ParameterType (owner / category). |
| block | Block name. |
| code | List of integer components used to build LhaID. |
Definition at line 113 of file SourceView.cpp.
| scalar_t ParamSrc::get_val | ( | ParameterType | t, |
| std::string_view | block, | ||
| std::pair< int, int > | code | ||
| ) | const |
Helper: get value from typed (ParameterType, block, pair<int,int>).
Definition at line 123 of file SourceView.cpp.
| bool ParamSrc::has | ( | const ParamId & | id | ) | const |
Checks whether a parameter with the given ID exists.
| id | ParamId to test. |
Definition at line 93 of file SourceView.cpp.
Access to the underlying parameter map.
Definition at line 127 of file SourceView.cpp.
Returns a parameter reference or throws if missing.
On failure, throws std::invalid_argument with a message that includes the context (if any) and the list of available ParamIds.
| id | ParamId to retrieve. |
| std::invalid_argument | if the parameter is not found. |
Definition at line 95 of file SourceView.cpp.