1#ifndef GENERAL_NUM_MODEL_MODIFIER_H
2#define GENERAL_NUM_MODEL_MODIFIER_H
6#include <unordered_map>
50 bool bsm_split_generation{
false};
51 bool full_target_generation{
false};
55 std::unique_ptr<SMParamSetter> paramSetter;
63 std::map<std::string, std::string> paramMap;
66 std::unordered_map<std::string, double> params;
69 std::unordered_map<std::string, InterpretedParam> interpreted_params;
85 const std::string& model,
86 std::unique_ptr<SMParamSetter> param_setter,
88 std::shared_ptr<IInterpreterPortsFactory> ports,
102 const std::string& model,
103 const std::string& mapping_model,
104 std::unique_ptr<SMParamSetter> param_setter,
106 std::shared_ptr<IInterpreterPortsFactory> ports,
108 bool bsm_split_generation =
false,
109 bool full_target_generation =
false)
112 bsm_split_generation(bsm_split_generation),
113 full_target_generation(full_target_generation),
115 interpreter(mapping_model, api, ports),
116 paramSetter(
std::move(param_setter)),
117 fileWriter(wilson, model, bsm_split_generation, full_target_generation),
118 lineProcessor(includeManager, fileWriter, force),
119 modelWriter(lineProcessor, paramWriter) {
127 : wilson(other.wilson),
129 bsm_split_generation(other.bsm_split_generation),
130 full_target_generation(other.full_target_generation),
131 forceMode(other.forceMode),
132 interpreter(other.interpreter),
133 paramSetter(other.paramSetter ?
std::make_unique<
SMParamSetter>(*other.paramSetter) : nullptr),
134 fileWriter(other.wilson, other.model, other.bsm_split_generation, other.full_target_generation),
135 lineProcessor(includeManager, fileWriter, other.forceMode),
136 modelWriter(lineProcessor, paramWriter),
137 paramWriter(other.paramWriter),
138 includeManager(other.includeManager),
139 paramMap(other.paramMap),
140 params(other.params),
141 interpreted_params(other.interpreted_params)
154 void modify(std::ifstream& inputFile, std::ofstream& outputFile);
165 void createparamfile(std::ofstream& paramFile,
const std::unordered_map<std::string, double> ¶ms);
177 std::unordered_map<std::string, double>
get_params() {
return this->params;}
189 void initializeParams();
Manages file and directory names for generated MARTY code and assets.
Declares the Interpreter that maps MARTY parameters to Hyperiso IDs.
Declares a line-based transformer for MARTY-generated C++ files.
Declares utilities to generate C++ code for MARTY wrappers.
Declares the base interface for source-level model transformations.
Declares a helper that writes processed model code and parameters.
Declares a small helper to write parameter maps to CSV files.
High-level orchestrator for numeric MARTY model generation.
std::unordered_map< std::string, double > get_params()
Returns the map of numerical parameter values.
GeneralNumModelModifier(const std::string &wilson, const std::string &model, std::unique_ptr< SMParamSetter > param_setter, std::shared_ptr< ICoreAPI< Model > > api, std::shared_ptr< IInterpreterPortsFactory > ports, bool force=false)
Constructs a numeric model modifier for a given (Wilson, model) pair.
GeneralNumModelModifier(const std::string &wilson, const std::string &model, const std::string &mapping_model, std::unique_ptr< SMParamSetter > param_setter, std::shared_ptr< ICoreAPI< Model > > api, std::shared_ptr< IInterpreterPortsFactory > ports, bool force=false, bool bsm_split_generation=false, bool full_target_generation=false)
Constructs a numeric model modifier with distinct output and parameter-resolution models.
std::unordered_map< std::string, InterpretedParam > get_interpreted_param_map()
Returns the interpreted parameter mapping.
GeneralNumModelModifier(const GeneralNumModelModifier &other)
Copy constructor used to duplicate the whole modification pipeline.
void createparamfile(std::ofstream ¶mFile, const std::unordered_map< std::string, double > ¶ms)
Writes the parameter CSV/param file.
void modify(std::ifstream &inputFile, std::ofstream &outputFile)
Applies the numeric model transformation to a template file.
Generic interface returning a single value of type T from the core.
Manages insertion of required #include directives.
Resolves MARTY parameter names into Hyperiso blocks and IDs.
Processes lines of a template C++ file and injects custom code.
Emits C++ helper code to handle CLI, IO and Wilson output.
High-level helper for writing modified model code and parameter files.
Helper class to serialize parameter values to a text stream.
Converts Hyperiso parameters into MARTY input parameters.
Hash specialization for SymbolId<Tag>.