Skip to content

Commit

Permalink
overload SetParameter[] for Re[] and Im[] parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Apr 12, 2015
1 parent ee5be2c commit 1b2217b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions meta/Parameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,22 @@

AppendIfNotEmpty[str_String, sym_String] := If[str == "", "", str <> sym];

SetParameter[Re[parameter_], value_String, class_String, castToType_:None] :=
Module[{parameterStr, newValue},
parameterStr = CConversion`RValueToCFormString[parameter];
newValue = CConversion`CreateCType[CConversion`ScalarType[complexScalarCType]] <>
"(" <> value <> ",Im(MODELPARAMETER(" <> parameterStr <> ")))";
SetParameter[parameter, newValue, class, castToType]
];

SetParameter[Im[parameter_], value_String, class_String, castToType_:None] :=
Module[{parameterStr, newValue},
parameterStr = CConversion`RValueToCFormString[parameter];
newValue = CConversion`CreateCType[CConversion`ScalarType[complexScalarCType]] <>
"(Re(MODELPARAMETER(" <> parameterStr <> "))," <> value <> ")";
SetParameter[parameter, newValue, class, castToType]
];

SetParameter[parameter_, value_String, class_String, castToType_:None] :=
Module[{parameterStr},
If[IsModelParameter[parameter],
Expand Down
1 change: 1 addition & 0 deletions templates/two_scale_model.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ using namespace @ModelName@_info;
#define PHYSICAL(parameter) physical.parameter
#define INPUT(parameter) model->get_input().parameter
#define LOCALINPUT(parameter) input.parameter
#define MODELPARAMETER(parameter) model->get_##parameter()

#define HIGGS_2LOOP_CORRECTION_AT_AS two_loop_corrections.higgs_at_as
#define HIGGS_2LOOP_CORRECTION_AB_AS two_loop_corrections.higgs_ab_as
Expand Down

0 comments on commit 1b2217b

Please sign in to comment.