Skip to content

Commit

Permalink
change calculate_amuon() interface: use const ref to model class
Browse files Browse the repository at this point in the history
in order to guarantee that the model class will not be modified after
the function call
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Sep 13, 2015
1 parent d84a60d commit 1fb57f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion templates/g_muon_minus_2.cpp.in
Expand Up @@ -527,8 +527,11 @@ static inline double OneLoopFunctionF2N(double x)
return -3.0 / (y * y * y) * (1.0 - x * x + 2.0 * x * std::log(x));
}

double calculate_amuon(@ModelName@<Two_scale> &model)
double calculate_amuon(const @ModelName@<Two_scale>& model_)
{
// make copy since model is modified via call to calculate_MFe_pole()
@ModelName@<Two_scale> model(model_);

#ifdef ENABLE_THREADS
@GMuonMinus2_ThreadedCalculation@
#else
Expand Down
2 changes: 1 addition & 1 deletion templates/g_muon_minus_2.hpp.in
Expand Up @@ -41,7 +41,7 @@ namespace @ModelName@_GMuonMinus2 {
* @fn calculate_amuon
* @brief Calculates GMM2/2.
*/
double calculate_amuon(@ModelName@<Two_scale> &model);
double calculate_amuon(const @ModelName@<Two_scale>& model);
};
} // namespace flexiblesusy

Expand Down

0 comments on commit 1fb57f3

Please sign in to comment.