|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Helper class to batch parameter updates on one or several BlockAccessor scopes. More...
#include <ParamOptimizer.h>
Public Member Functions | |
| ParamOptimizer (std::shared_ptr< BlockAccessor > scope) | |
| Constructs a ParamOptimizer operating on a single BlockAccessor scope. | |
| ParamOptimizer (std::vector< std::shared_ptr< BlockAccessor > > scopes) | |
| Constructs a ParamOptimizer operating on multiple BlockAccessor scopes. | |
| void | set_value (const BlockName &block, const LhaID &id, scalar_t v) |
| Queue a simple numerical value assignment for a parameter. | |
| void | set_param (const BlockName &block, const LhaID &id, std::shared_ptr< Parameter > p) |
| Queue a full Parameter object assignment. | |
| void | remove (const BlockName &block, const LhaID &id) |
| Queue a removal operation for a parameter. | |
| void | commit (bool coalesce=true) |
| Applies all queued operations. | |
| void | clear () |
| Clears the pending operation queue without applying changes. | |
Helper class to batch parameter updates on one or several BlockAccessor scopes.
ParamOptimizer is designed to:
Typical usage:
Definition at line 75 of file ParamOptimizer.h.
|
explicit |
Constructs a ParamOptimizer operating on a single BlockAccessor scope.
| scope | Shared pointer to the BlockAccessor to be modified. |
Definition at line 3 of file ParamOptimizer.cpp.
|
explicit |
Constructs a ParamOptimizer operating on multiple BlockAccessor scopes.
This is useful when parameters are distributed over several BlockAccessor instances (for example, several Parameters objects) but blocks must remain unambiguous (a given block name must resolve to the same Block in all scopes where it appears).
| scopes | Vector of shared pointers to BlockAccessor scopes. |
Definition at line 5 of file ParamOptimizer.cpp.
| void ParamOptimizer::clear | ( | ) |
Clears the pending operation queue without applying changes.
Definition at line 85 of file ParamOptimizer.cpp.
| void ParamOptimizer::commit | ( | bool | coalesce = true | ) |
Applies all queued operations.
The algorithm is:
| coalesce | If true (default), only the last operation per (block, id) is applied. |
Definition at line 18 of file ParamOptimizer.cpp.
Queue a removal operation for a parameter.
If the parameter does not exist initially in the block, the operation is ignored.
| block | Name of the block. |
| id | LHA identifier of the parameter to remove. |
Definition at line 14 of file ParamOptimizer.cpp.
| void ParamOptimizer::set_param | ( | const BlockName & | block, |
| const LhaID & | id, | ||
| std::shared_ptr< Parameter > | p | ||
| ) |
Queue a full Parameter object assignment.
If the parameter already exists, it will be overwritten (via Block::assign). Otherwise, it will be stored (via Block::store).
| block | Name of the block. |
| id | LHA identifier of the parameter. |
| p | Shared pointer to the Parameter object to use. |
Definition at line 11 of file ParamOptimizer.cpp.
Queue a simple numerical value assignment for a parameter.
If the parameter already exists, it will be updated. Otherwise, it will be created as a new Parameter with zero uncertainties.
| block | Name of the block. |
| id | LHA identifier of the parameter. |
| v | New value to set. |
Definition at line 8 of file ParamOptimizer.cpp.