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

Adapter that builds a ParamOptimizer from Parameters instances. More...

#include <ParamOptimizerAdapter.h>

Inheritance diagram for ParamOptimizerAdapter:
Collaboration diagram for ParamOptimizerAdapter:

Public Member Functions

 ParamOptimizerAdapter (std::vector< ParameterType > scopes)
 Constructs the adapter from a list of parameter type scopes.
 
void set_value (const BlockName &block, const LhaID &id, scalar_t v) override
 Stage a change of central value for a parameter.
 
void set_param (const BlockName &block, const LhaID &id, std::shared_ptr< Parameter > p) override
 Stage a full replacement of a parameter object.
 
void remove (const BlockName &block, const LhaID &id) override
 Stage the removal of a parameter.
 
void commit (bool coalesce=true) override
 Commit all staged operations.
 
void clear () override
 Clears all currently staged operations without applying them.
 
- Public Member Functions inherited from IParamOptimizer
virtual ~IParamOptimizer ()=default
 Virtual destructor for interface.
 

Detailed Description

Adapter that builds a ParamOptimizer from Parameters instances.

ParamOptimizerAdapter:

Example:

optimizer.set_value("MASS", LhaID(25), 123.4);
optimizer.commit(); // propagate changes in a batched way
Adapter that builds a ParamOptimizer from Parameters instances.
void set_value(const BlockName &block, const LhaID &id, scalar_t v) override
Stage a change of central value for a parameter.
Represents an identifier of a LHA element, possibly containing several sub-ids.
Definition LhaID.h:56

Definition at line 34 of file ParamOptimizerAdapter.h.

Constructor & Destructor Documentation

◆ ParamOptimizerAdapter()

ParamOptimizerAdapter::ParamOptimizerAdapter ( std::vector< ParameterType scopes)

Constructs the adapter from a list of parameter type scopes.

For each ParameterType in scopes, the constructor retrieves Parameters::GetInstance(scope)->get_block_accessor() and passes the resulting collection of BlockAccessor pointers to an internal ParamOptimizer instance.

Parameters
scopesList of ParameterTypes to include in the optimization scope.

Definition at line 4 of file ParamOptimizerAdapter.cpp.

Member Function Documentation

◆ clear()

void ParamOptimizerAdapter::clear ( )
overridevirtual

Clears all currently staged operations without applying them.

Implements IParamOptimizer.

Definition at line 27 of file ParamOptimizerAdapter.cpp.

◆ commit()

void ParamOptimizerAdapter::commit ( bool  coalesce = true)
overridevirtual

Commit all staged operations.

Implementations may:

  • coalesce multiple operations on the same (block, id) into a single effective update,
  • freeze/unfreeze affected blocks during the update,
  • notify observers only once per block.
Parameters
coalesceIf true, coalesce multiple operations on the same parameter.

Implements IParamOptimizer.

Definition at line 23 of file ParamOptimizerAdapter.cpp.

◆ remove()

void ParamOptimizerAdapter::remove ( const BlockName block,
const LhaID id 
)
overridevirtual

Stage the removal of a parameter.

Parameters
blockBlock name where the parameter resides.
idLhaID of the parameter to remove.

Implements IParamOptimizer.

Definition at line 19 of file ParamOptimizerAdapter.cpp.

◆ set_param()

void ParamOptimizerAdapter::set_param ( const BlockName block,
const LhaID id,
std::shared_ptr< Parameter p 
)
overridevirtual

Stage a full replacement of a parameter object.

Parameters
blockBlock name where the parameter resides.
idLhaID of the parameter.
pShared pointer to the new Parameter.

Implements IParamOptimizer.

Definition at line 16 of file ParamOptimizerAdapter.cpp.

◆ set_value()

void ParamOptimizerAdapter::set_value ( const BlockName block,
const LhaID id,
scalar_t  v 
)
overridevirtual

Stage a change of central value for a parameter.

Parameters
blockBlock name where the parameter resides.
idLhaID of the parameter.
vNew value to set.

Implements IParamOptimizer.

Definition at line 13 of file ParamOptimizerAdapter.cpp.


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