Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ParameterShifter Class Reference

Concrete mutator that shifts parameter values rather than directly setting them. More...

#include <ParameterShifter.h>

Inheritance diagram for ParameterShifter:
Collaboration diagram for ParameterShifter:

Public Member Functions

void mutate (const ParamId &pid, scalar_t value) override
 Shifts the value of a parameter by a given amount.
 
void change_mode (const ParamId &pid, ParameterMode mode) override
 Changes the mode of a parameter (e.g., from FIXED to SHIFTABLE).
 
- Public Member Functions inherited from IDataMutator< ParamId, scalar_t, ParameterMode >
virtual ~IDataMutator ()=default
 Virtual destructor for interface.
 

Detailed Description

Concrete mutator that shifts parameter values rather than directly setting them.

ParameterShifter differs from ParameterSetter in the semantics of mutate():

Modes can be adjusted via change_mode() in the same way as ParameterSetter.

Examples
param_mutation_example.cpp.

Definition at line 32 of file ParameterShifter.h.

Member Function Documentation

◆ change_mode()

void ParameterShifter::change_mode ( const ParamId pid,
ParameterMode  mode 
)
overridevirtual

Changes the mode of a parameter (e.g., from FIXED to SHIFTABLE).

Delegates to Parameters::changeParameterMode on the appropriate Parameters instance, as determined by pid.type.

Parameters
pidThe parameter ID.
modeThe new parameter mode.

Implements IDataMutator< ParamId, scalar_t, ParameterMode >.

Definition at line 11 of file ParameterShifter.cpp.

◆ mutate()

void ParameterShifter::mutate ( const ParamId pid,
scalar_t  value 
)
overridevirtual

Shifts the value of a parameter by a given amount.

If the ParamId has no type set, an error is logged, as the target Parameters instance cannot be resolved.

Internally this calls Parameters::shiftParameter(pid, value), so the new value is:

\[
    p_{\text{new}} = p_{\text{old}} + \text{value}
\]

Parameters
pidThe parameter ID.
valueThe amount by which to shift the parameter value.

Implements IDataMutator< ParamId, scalar_t, ParameterMode >.

Examples
param_mutation_example.cpp.

Definition at line 3 of file ParameterShifter.cpp.


The documentation for this class was generated from the following files: